/* ========================================
   PHOTO DREAMS STUDIO — ADMIN STYLES
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --clr-bg:        #09090b;
  --clr-surface:   #111115;
  --clr-surface2:  #18181f;
  --clr-surface3:  #202028;
  --clr-surface4:  #28282f;
  --clr-border:    rgba(255,255,255,.07);
  --clr-border2:   rgba(255,255,255,.12);
  --clr-gold:      #c9a96e;
  --clr-gold-lt:   #e0c590;
  --clr-white:     #f5f3ee;
  --clr-muted:     rgba(245,243,238,.5);
  --clr-muted2:    rgba(245,243,238,.3);
  --clr-accent:    #8b6fd4;
  --clr-success:   #4caf7d;
  --clr-danger:    #e05c5c;
  --clr-warning:   #e0a84a;

  --sidebar-w: 260px;
  --ff-serif: 'Cormorant Garamond', Georgia, serif;
  --ff-sans:  'Inter', system-ui, sans-serif;
  --radius: 10px;
  --radius-lg: 16px;
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--clr-bg);
  color: var(--clr-white);
  font-family: var(--ff-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50; overflow-y: auto;
}
.sidebar__header {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--clr-border);
}
.sidebar__logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--clr-white);
  font-family: var(--ff-serif); font-size: 1.1rem; font-weight: 300;
}
.sidebar__logo-icon { color: var(--clr-gold); font-size: 1.3rem; }
.sidebar__badge { font-size: .65rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--clr-muted2); margin-top: 4px; display: block; padding-left: 2px; }

.sidebar__nav { flex: 1; padding: 16px 12px; }
.sidebar__section-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--clr-muted2);
  padding: 12px 12px 6px;
}
.sidebar__link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--clr-muted);
  font-size: .875rem; font-weight: 400;
  transition: var(--transition);
  margin-bottom: 2px;
}
.sidebar__link:hover { background: var(--clr-surface2); color: var(--clr-white); }
.sidebar__link.active { background: rgba(201,169,110,.12); color: var(--clr-gold); }
.sidebar__link .icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar__footer {
  padding: 16px 12px;
  border-top: 1px solid var(--clr-border);
}

/* ADMIN MAIN */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* TOP BAR */
.admin-topbar {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.admin-topbar__title {
  font-family: var(--ff-serif);
  font-size: 1.4rem; font-weight: 300;
  color: var(--clr-white);
}
.admin-topbar__actions { display: flex; align-items: center; gap: 10px; }
.admin-topbar__user {
  display: flex; align-items: center; gap: 10px;
  margin-left: 8px;
}
.admin-topbar__avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--clr-gold), #a07840);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 600; color: #1a1208;
}
.admin-topbar__name { font-size: .82rem; font-weight: 500; }

/* CONTENT AREA */
.admin-content { padding: 32px; flex: 1; }

/* STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--clr-border2); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.stat-card__label { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--clr-muted2); margin-bottom: 12px; }
.stat-card__value { font-family: var(--ff-serif); font-size: 2.2rem; font-weight: 300; color: var(--clr-white); line-height: 1; }
.stat-card__sub { font-size: .78rem; color: var(--clr-muted); margin-top: 6px; }
.stat-card--gold .stat-card__value { color: var(--clr-gold); }
.stat-card--success .stat-card__value { color: var(--clr-success); }
.stat-card--accent .stat-card__value { color: var(--clr-accent); }

/* TABLES */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--clr-border); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--clr-surface2);
  padding: 12px 20px;
  text-align: left;
  font-size: .72rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--clr-muted2);
  border-bottom: 1px solid var(--clr-border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--clr-border);
  font-size: .875rem;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { background: var(--clr-surface); transition: var(--transition); }
.data-table tbody tr:hover { background: var(--clr-surface2); }

/* SECTION HEADERS */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.section-header__left h2 {
  font-family: var(--ff-serif); font-size: 1.5rem; font-weight: 400;
}
.section-header__left p { font-size: .85rem; color: var(--clr-muted); margin-top: 2px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 20px;
  border-radius: 100px;
  font-family: var(--ff-sans);
  font-size: .85rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: var(--transition);
  border: 1.5px solid transparent;
  white-space: nowrap; user-select: none;
}
.btn--primary { background: linear-gradient(135deg, var(--clr-gold), #a07840); color: #1a1208; box-shadow: 0 3px 16px rgba(201,169,110,.2); }
.btn--primary:hover { box-shadow: 0 6px 24px rgba(201,169,110,.35); transform: translateY(-1px); }
.btn--outline { background: transparent; border-color: var(--clr-gold); color: var(--clr-gold); }
.btn--outline:hover { background: rgba(201,169,110,.1); }
.btn--ghost { background: rgba(255,255,255,.04); border-color: var(--clr-border2); color: var(--clr-muted); }
.btn--ghost:hover { background: rgba(255,255,255,.08); color: var(--clr-white); }
.btn--danger { background: var(--clr-danger); color: #fff; border-color: transparent; }
.btn--danger:hover { background: #c94a4a; }
.btn--success { background: var(--clr-success); color: #fff; border-color: transparent; }
.btn--success:hover { background: #3d9e6a; }
.btn--sm { padding: 6px 14px; font-size: .78rem; }
.btn--lg { padding: 13px 32px; font-size: .95rem; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn--icon { padding: 7px; border-radius: 50%; min-width: 32px; justify-content: center; }
.btn-group { display: flex; gap: 6px; }

/* FORMS */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .78rem; font-weight: 500; margin-bottom: 7px; color: var(--clr-muted); letter-spacing: .03em; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--clr-surface2);
  border: 1.5px solid var(--clr-border2);
  border-radius: var(--radius);
  color: var(--clr-white);
  font-family: var(--ff-sans);
  font-size: .875rem; padding: 10px 14px;
  transition: var(--transition); outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--clr-gold); background: var(--clr-surface3);
  box-shadow: 0 0 0 3px rgba(201,169,110,.12);
}
.form-input::placeholder { color: var(--clr-muted2); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c9a96e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .72rem; color: var(--clr-muted2); margin-top: 5px; }
.form-error-msg { font-size: .75rem; color: var(--clr-danger); margin-top: 5px; }

/* DRAG & DROP UPLOAD */
.upload-zone {
  border: 2px dashed var(--clr-border2);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--clr-surface2);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--clr-gold);
  background: rgba(201,169,110,.05);
}
.upload-zone__icon { font-size: 2.5rem; margin-bottom: 12px; color: var(--clr-muted); }
.upload-zone__text { font-size: .92rem; color: var(--clr-muted); }
.upload-zone__text strong { color: var(--clr-gold); }
.upload-zone__sub { font-size: .78rem; color: var(--clr-muted2); margin-top: 6px; }

/* PHOTO THUMBNAILS GRID */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 12px; }
.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--clr-surface3);
  border: 1px solid var(--clr-border);
  cursor: pointer;
  transition: var(--transition);
}
.photo-thumb:hover { border-color: rgba(201,169,110,.4); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  gap: 8px; opacity: 0; transition: var(--transition);
}
.photo-thumb:hover .photo-thumb__overlay { opacity: 1; }
.photo-thumb__check {
  position: absolute; top: 8px; left: 8px;
  width: 22px; height: 22px;
  border: 2px solid rgba(255,255,255,.6);
  border-radius: 4px; background: transparent;
  transition: var(--transition);
}
.photo-thumb.selected .photo-thumb__check {
  background: var(--clr-gold);
  border-color: var(--clr-gold);
}
.photo-thumb.selected .photo-thumb__check::after {
  content: '✓'; color: #1a1208; font-size: .7rem; font-weight: 700;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.photo-thumb__name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.7); padding: 4px 8px;
  font-size: .68rem; color: var(--clr-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.88); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--clr-surface); border: 1px solid var(--clr-border2);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  transform: translateY(16px) scale(.97); transition: transform .25s;
  padding: 32px;
}
.modal-overlay.open .modal { transform: none; }
.modal--lg { max-width: 760px; }
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.modal__title { font-family: var(--ff-serif); font-size: 1.5rem; font-weight: 400; }
.modal__close { background: none; border: none; color: var(--clr-muted); cursor: pointer; font-size: 1.4rem; line-height: 1; transition: var(--transition); padding: 2px; }
.modal__close:hover { color: var(--clr-white); }
.modal__footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--clr-border); }

/* TOAST */
#toastContainer { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--clr-surface); border: 1px solid var(--clr-border2);
  border-radius: var(--radius); padding: 13px 18px; font-size: .85rem;
  display: flex; align-items: center; gap: 12px; max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5); animation: slide-in .3s ease;
}
.toast--success { border-left: 3px solid var(--clr-success); }
.toast--error   { border-left: 3px solid var(--clr-danger); }
.toast--info    { border-left: 3px solid var(--clr-gold); }
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* MISC */
.hidden { display: none !important; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(201,169,110,.2); border-top-color: var(--clr-gold); border-radius: 50%; animation: spin .7s linear infinite; margin: 32px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.divider { height: 1px; background: var(--clr-border); margin: 24px 0; }
.text-gold { color: var(--clr-gold); }
.text-muted { color: var(--clr-muted); }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* LOGIN PAGE SPECIFIC */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(139,111,212,.12) 0%, transparent 60%),
              radial-gradient(ellipse 50% 40% at 80% 80%, rgba(201,169,110,.08) 0%, transparent 50%);
  padding: 24px;
}
.login-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border2);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 420px;
  padding: 48px 40px;
}
.login-card__logo { text-align: center; margin-bottom: 32px; }
.login-card__logo-icon { font-size: 2.5rem; color: var(--clr-gold); display: block; margin-bottom: 12px; }
.login-card__logo-title { font-family: var(--ff-serif); font-size: 1.8rem; font-weight: 300; }
.login-card__logo-sub { font-size: .77rem; color: var(--clr-muted); letter-spacing: .05em; text-transform: uppercase; margin-top: 4px; }
.login-card__footer { text-align: center; margin-top: 20px; font-size: .8rem; color: var(--clr-muted); }
.login-card__footer a { color: var(--clr-gold); text-decoration: none; }

/* BREADCRUMB */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--clr-muted); margin-bottom: 24px; }
.breadcrumb a { color: var(--clr-muted); text-decoration: none; transition: var(--transition); }
.breadcrumb a:hover { color: var(--clr-gold); }
.breadcrumb__sep { color: var(--clr-muted2); }
.breadcrumb__current { color: var(--clr-white); }

/* FOLDER COVER */
.folder-cover-thumb {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover; display: block;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--clr-surface3);
}

/* PROGRESS */
.upload-progress { margin-top: 12px; }
.progress-bar { height: 4px; background: var(--clr-surface3); border-radius: 4px; overflow: hidden; }
.progress-bar__fill { height: 100%; background: linear-gradient(90deg, var(--clr-gold), var(--clr-gold-lt)); transition: width .3s; }
.progress-label { font-size: .72rem; color: var(--clr-muted); margin-top: 4px; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 24px 16px; }
}
