/* =============================================
   ADMIN.CSS — Admin Panel Styles
   Gigi's Sweets & Treats
   ============================================= */

/* ---- Overlay ---- */
#admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(60, 20, 20, 0.55);
  z-index: 1000;
  backdrop-filter: blur(4px);
}
#admin-overlay.open {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

/* ---- Panel ---- */
#admin-panel {
  background: var(--white);
  width: 440px;
  max-width: 95vw;
  height: 100vh;
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

/* ---- Panel Header ---- */
.admin-header {
  background: linear-gradient(135deg, var(--brown), var(--mauve));
  color: var(--white);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
}

#close-admin {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#close-admin:hover { background: rgba(255, 255, 255, 0.35); }

/* ---- Login Area ---- */
#login-area { padding: 20px; }
#login-area p {
  font-size: 14px;
  color: var(--brown-light);
  margin-bottom: 16px;
}
#login-status {
  font-size: 13px;
  color: #c0392b;
  margin-top: 10px;
  font-weight: 600;
}

/* ---- Tabs ---- */
.admin-tabs {
  display: flex;
  border-bottom: 2px solid var(--pink-light);
  background: #fff8f5;
}
.admin-tab {
  flex: 1;
  padding: 10px 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--brown-light);
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  text-align: center;
  font-family: 'Nunito', sans-serif;
}
.admin-tab.active {
  color: var(--mauve);
  border-bottom-color: var(--mauve);
  background: var(--white);
}

/* ---- Content Area ---- */
.admin-content {
  flex: 1;
  padding: 20px;
}
.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-section h3 {
  font-family: 'Playfair Display', serif;
  color: var(--brown);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

/* ---- Form Elements ---- */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--brown-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--pink-light);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  transition: border-color 0.2s;
  background: var(--cream);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--pink);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group input[type="color"] { padding: 4px; height: 40px; cursor: pointer; }

/* ---- Buttons ---- */
.admin-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.04em;
  font-family: 'Nunito', sans-serif;
}
.btn-primary   { background: var(--mauve); color: var(--white); }
.btn-primary:hover { background: var(--brown); }
.btn-secondary { background: var(--pink-light); color: var(--mauve); }
.btn-secondary:hover { background: var(--pink); color: var(--white); }
.btn-danger    { background: #fde; color: #c0392b; }
.btn-danger:hover { background: #c0392b; color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---- List Items ---- */
.admin-list { list-style: none; }
.admin-list-item {
  background: var(--cream);
  border: 1px solid var(--pink-light);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-list-item span {
  font-weight: 600;
  font-size: 14px;
  color: var(--brown);
  flex: 1;
}

/* ---- Cards ---- */
.admin-card {
  background: var(--cream);
  border: 1px solid var(--pink-light);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.admin-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.admin-card .card-header strong {
  color: var(--brown);
  font-size: 14px;
}

/* ---- Color Row ---- */
.color-row { display: flex; gap: 10px; }
.color-row .form-group { flex: 1; }

/* ---- Divider ---- */
.divider-hr {
  border: none;
  border-top: 1px solid var(--pink-light);
  margin: 20px 0;
}

/* ---- Drag Handle ---- */
.drag-handle {
  cursor: grab;
  margin-right: 6px;
  color: var(--pink);
  font-size: 16px;
}

/* ---- Item Rows (in section cards) ---- */
.item-row {
  border: 1px solid var(--pink-light);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--white);
}

.item-row-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

/* ---- Reorder Buttons ---- */
.item-row-reorder {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.reorder-btn {
  background: none;
  border: 1px solid var(--pink-light);
  border-radius: 4px;
  color: var(--mauve);
  font-size: 9px;
  line-height: 1;
  padding: 2px 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.reorder-btn:hover:not(:disabled) {
  background: var(--pink-light);
  border-color: var(--pink);
}
.reorder-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* ---- Inline Edit Form ---- */
.item-edit-form {
  padding: 12px 12px 14px;
  border-top: 1px solid var(--pink-light);
  background: #fff8f5;
  animation: fadeIn 0.15s ease;
}
.item-edit-form .form-group {
  margin-bottom: 10px;
}
.item-edit-form label {
  font-size: 11px;
}
