/* ============================================================
   DAY SELLING — Admin Panel Styles
   ============================================================ */

/* ===== Layout ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.sidebar__header {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.sidebar__logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--gold-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.sidebar__subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar__nav {
  flex: 1;
  padding: 0 0.75rem;
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
  width: 100%;
  background: transparent;
  text-align: left;
}

.sidebar__nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.sidebar__nav-item.active {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
}

.sidebar__nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.sidebar__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar__user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sidebar__user-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-email {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__signout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: all var(--transition);
  cursor: pointer;
}

.sidebar__signout-btn:hover {
  background: rgba(231, 76, 60, 0.1);
  border-color: rgba(231, 76, 60, 0.3);
  color: var(--danger);
}

/* ===== Main Content ===== */
.admin-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
}

.admin-content__header {
  margin-bottom: 2rem;
}

.admin-content__title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.admin-content__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== Panels (Tab content) ===== */
.admin-panel {
  display: none;
  animation: fadeInUp 0.4s ease-out;
}

.admin-panel.active {
  display: block;
}

/* ===== Stats Cards ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stat-card__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

.stat-card__sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ===== Form Styles ===== */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 700px;
}

.form-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-group__input,
.form-group__textarea,
.form-group__select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.form-group__input:focus,
.form-group__textarea:focus,
.form-group__select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.form-group__input::placeholder,
.form-group__textarea::placeholder {
  color: var(--text-muted);
}

.form-group__textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ===== Image Upload ===== */
.image-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-primary);
}

.image-upload:hover {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.03);
}

.image-upload.dragover {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}

.image-upload__icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.image-upload__text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.image-upload__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.image-upload__input {
  display: none;
}

.image-upload__preview {
  display: none;
  position: relative;
}

.image-upload__preview img {
  max-height: 200px;
  border-radius: var(--radius-sm);
  margin: 0 auto;
}

.image-upload__preview.active {
  display: block;
}

.image-upload__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(231, 76, 60, 0.9);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.image-upload__remove:hover {
  background: var(--danger);
  transform: scale(1.1);
}

.image-upload__progress {
  margin-top: 1rem;
  display: none;
}

.image-upload__progress.active {
  display: block;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--gold-gradient-btn);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  width: 0%;
}

/* ===== Form Actions ===== */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all var(--transition);
  cursor: pointer;
}

.btn--primary {
  background: var(--gold-gradient-btn);
  background-size: 200% auto;
  color: var(--bg-primary);
  border: none;
}

.btn--primary:hover {
  background-position: right center;
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
  transform: translateY(-1px);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn--secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn--danger {
  background: transparent;
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: var(--danger);
}

.btn--danger:hover {
  background: rgba(231, 76, 60, 0.1);
  border-color: var(--danger);
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.75rem;
}

/* ===== Table Styles ===== */
.data-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table__image {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.data-table__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.data-table__status--sold {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger);
}

.data-table__status--available {
  background: rgba(46, 204, 113, 0.1);
  color: var(--success);
}

.data-table__status--scheduled {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
}

.data-table__actions {
  display: flex;
  gap: 0.5rem;
}

/* ===== Empty Table State ===== */
.table-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.table-empty__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

/* ===== Login Gate ===== */
.login-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-gate__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: scaleIn 0.5s ease-out;
  backdrop-filter: blur(10px);
}

.login-gate__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.login-gate__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.login-gate__text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.login-gate__error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 1rem;
  display: none;
}

.login-gate__error.active {
  display: block;
}

.login-gate__btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: white;
  color: #333;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
}

.login-gate__btn:hover {
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.login-gate__btn img {
  width: 20px;
  height: 20px;
}

/* ===== Mobile Sidebar Toggle ===== */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 100;
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.2rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ===== Preview Card ===== */
.preview-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.preview-card__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.preview-card__image {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.preview-card__name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.preview-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.preview-card__price {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .admin-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 4rem;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .data-table-wrapper {
    overflow-x: auto;
  }

  .form-card {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
