/* ==========================================================================
   GlowUp AI Hairstyle Generator - Design System
   Theme: White / Soft Gray / Purple Gradient / Light Blue accent
   Includes dark mode, glassmorphism, rounded cards, smooth animations.
   ========================================================================== */

:root {
  --purple-1: #7c3aed;
  --purple-2: #a855f7;
  --blue: #38bdf8;
  --grad: linear-gradient(135deg, #7c3aed 0%, #a855f7 45%, #38bdf8 100%);
  --grad-soft: linear-gradient(135deg, rgba(124,58,237,.12), rgba(56,189,248,.12));

  --bg: #f7f8fc;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --text: #1e2235;
  --muted: #6b7192;
  --border: #eceef6;
  --shadow: 0 10px 30px rgba(45, 40, 90, .08);
  --shadow-lg: 0 24px 60px rgba(45, 40, 90, .14);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #0d1020;
  --bg-elev: #151a30;
  --surface: #171d36;
  --text: #eef1fb;
  --muted: #9aa2c4;
  --border: #262d4d;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  --grad-soft: linear-gradient(135deg, rgba(124,58,237,.22), rgba(56,189,248,.18));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

a { color: var(--purple-1); text-decoration: none; }
a:hover { color: var(--purple-2); }
img { max-width: 100%; }
h1,h2,h3,h4 { font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }

.container { width: min(1180px, 92%); margin-inline: auto; }
.section { padding: 84px 0; }
.text-grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.muted { color: var(--muted); }
.text-center { text-align: center; }
.eyebrow {
  display: inline-block; font-weight: 700; font-size: .82rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--purple-1);
  background: var(--grad-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
}

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-weight: 700; font-size: .96rem; padding: 13px 24px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .2s;
  white-space: nowrap; font-family: inherit;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 12px 26px rgba(124,58,237,.35); }
.btn-primary:hover { color:#fff; transform: translateY(-2px); box-shadow: 0 18px 36px rgba(124,58,237,.45); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.btn-ghost:hover { transform: translateY(-2px); color: var(--purple-1); }
.btn-light { background: rgba(255,255,255,.16); color:#fff; border-color: rgba(255,255,255,.25); backdrop-filter: blur(8px); }
.btn-light:hover { background: rgba(255,255,255,.28); color:#fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background:#dc2626; color:#fff; }

/* Cards ------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; transition: transform .2s ease, box-shadow .2s ease;
}
.card-hover:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.glass {
  background: rgba(255,255,255,.6); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,.5);
}
[data-theme="dark"] .glass { background: rgba(23,29,54,.6); border-color: rgba(255,255,255,.08); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Navbar ------------------------------------------------------------------ */
.navbar {
  position: sticky; top: 0; z-index: 100; padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.navbar .inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--text); }
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 900; box-shadow: 0 8px 18px rgba(124,58,237,.4);
}
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); font-weight: 600; font-size: .95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.6rem; cursor: pointer; }

.theme-toggle {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; transition: transform .2s;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.05); }

/* Hero -------------------------------------------------------------------- */
.hero { position: relative; padding: 90px 0 70px; overflow: hidden; }
.hero::before {
  content:""; position:absolute; inset:-30% 40% 40% -10%; background: var(--grad);
  filter: blur(120px); opacity:.28; border-radius:50%; z-index:-1;
}
.hero::after {
  content:""; position:absolute; inset:30% -20% -40% 50%; background: linear-gradient(135deg,#38bdf8,#a855f7);
  filter: blur(130px); opacity:.22; border-radius:50%; z-index:-1;
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 0 0 18px; }
.hero p.lead { font-size: 1.18rem; color: var(--muted); max-width: 560px; }
.hero-actions { display:flex; gap:14px; margin-top:30px; flex-wrap: wrap; }
.hero-stats { display:flex; gap:34px; margin-top:44px; flex-wrap: wrap; }
.hero-stats .num { font-size:1.8rem; font-weight:800; }

/* Before/After slider ----------------------------------------------------- */
.ba-slider {
  position: relative; width: 100%; aspect-ratio: 4/5; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg); user-select: none; touch-action: none;
}
.ba-slider img { position:absolute; inset:0; width:100%; height:100%; object-fit: cover; }
.ba-slider .after-img { clip-path: inset(0 0 0 50%); }
.ba-handle { position:absolute; top:0; bottom:0; left:50%; width:3px; background:#fff; box-shadow: 0 0 10px rgba(0,0,0,.4); cursor: ew-resize; }
.ba-handle::after {
  content:"⇆"; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:44px; height:44px; border-radius:50%; background:#fff; color:var(--purple-1);
  display:grid; place-items:center; font-size:1.2rem; box-shadow: var(--shadow);
}
.ba-label { position:absolute; bottom:14px; padding:5px 12px; border-radius:999px; font-size:.75rem; font-weight:700; color:#fff; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); }
.ba-label.before { left:14px; } .ba-label.after { right:14px; }

/* Feature / style tiles --------------------------------------------------- */
.feature-icon {
  width:54px; height:54px; border-radius:15px; background: var(--grad-soft);
  display:grid; place-items:center; font-size:1.5rem; margin-bottom:16px; color: var(--purple-1);
}
.style-chip {
  display:flex; flex-direction:column; align-items:center; gap:8px; padding:18px; border-radius:var(--radius-sm);
  background: var(--surface); border:1px solid var(--border); cursor:pointer; transition: all .2s; text-align:center; font-weight:600;
}
.style-chip:hover, .style-chip.selected { border-color: var(--purple-2); background: var(--grad-soft); transform: translateY(-3px); }
.style-emoji { font-size:1.8rem; }

/* Pricing ----------------------------------------------------------------- */
.price-card { display:flex; flex-direction:column; height:100%; position:relative; }
.price-card.featured { border-color: var(--purple-2); box-shadow: 0 24px 60px rgba(124,58,237,.25); }
.price-badge { position:absolute; top:-13px; left:50%; transform:translateX(-50%); background: var(--grad); color:#fff; font-size:.72rem; font-weight:700; padding:5px 14px; border-radius:999px; }
.price { font-size:2.6rem; font-weight:800; margin:10px 0; }
.price small { font-size:1rem; color: var(--muted); font-weight:600; }
.plan-features { list-style:none; padding:0; margin:20px 0; flex:1; }
.plan-features li { padding:8px 0; display:flex; gap:10px; align-items:flex-start; color: var(--muted); }
.plan-features li::before { content:"✓"; color: var(--purple-1); font-weight:800; }

/* Testimonials ------------------------------------------------------------ */
.stars { color:#fbbf24; letter-spacing:2px; }
.avatar { width:46px; height:46px; border-radius:50%; object-fit:cover; background: var(--grad); display:grid; place-items:center; color:#fff; font-weight:700; }

/* FAQ --------------------------------------------------------------------- */
.faq-item { border:1px solid var(--border); border-radius: var(--radius-sm); margin-bottom:12px; background: var(--surface); overflow:hidden; }
.faq-q { padding:18px 22px; font-weight:700; cursor:pointer; display:flex; justify-content:space-between; gap:12px; }
.faq-a { max-height:0; overflow:hidden; transition: max-height .3s ease, padding .3s ease; padding:0 22px; color: var(--muted); }
.faq-item.open .faq-a { max-height:400px; padding:0 22px 18px; }
.faq-item.open .faq-q .chev { transform: rotate(45deg); }
.faq-q .chev { transition: transform .3s; }

/* Forms ------------------------------------------------------------------- */
.form-group { margin-bottom:18px; }
.form-label { display:block; font-weight:600; font-size:.9rem; margin-bottom:7px; }
.form-control, .form-select, textarea.form-control {
  width:100%; padding:12px 15px; border-radius: var(--radius-sm); border:1px solid var(--border);
  background: var(--bg-elev); color: var(--text); font-family:inherit; font-size:.96rem; transition: border .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
  outline:none; border-color: var(--purple-2); box-shadow: 0 0 0 4px rgba(124,58,237,.14);
}
.form-error { color:#ef4444; font-size:.82rem; margin-top:6px; }
.input-invalid { border-color:#ef4444 !important; }

/* Auth card --------------------------------------------------------------- */
.auth-wrap { min-height:100vh; display:grid; place-items:center; padding:40px 16px; background: var(--grad-soft); }
.auth-card { width:min(440px,100%); }

/* Alerts / toasts --------------------------------------------------------- */
.alert { padding:14px 18px; border-radius: var(--radius-sm); margin-bottom:14px; font-weight:600; border:1px solid transparent; }
.alert-success { background: rgba(34,197,94,.12); color:#16a34a; border-color: rgba(34,197,94,.3); }
.alert-error { background: rgba(239,68,68,.12); color:#dc2626; border-color: rgba(239,68,68,.3); }
#toast-container { position:fixed; top:20px; right:20px; z-index:2000; display:flex; flex-direction:column; gap:10px; }
.toast {
  background: var(--surface); border:1px solid var(--border); border-left:4px solid var(--purple-1);
  border-radius: var(--radius-sm); padding:14px 18px; box-shadow: var(--shadow-lg); min-width:260px;
  animation: slideIn .3s ease; font-weight:600;
}
.toast.success { border-left-color:#16a34a; } .toast.error { border-left-color:#dc2626; }
@keyframes slideIn { from { opacity:0; transform: translateX(40px); } to { opacity:1; transform:none; } }

/* Badges ------------------------------------------------------------------ */
.badge { display:inline-block; padding:4px 11px; border-radius:999px; font-size:.75rem; font-weight:700; }
.badge-purple { background: var(--grad-soft); color: var(--purple-1); }
.badge-green { background: rgba(34,197,94,.14); color:#16a34a; }
.badge-red { background: rgba(239,68,68,.14); color:#dc2626; }
.badge-gray { background: var(--border); color: var(--muted); }

/* Footer ------------------------------------------------------------------ */
.footer { background: var(--bg-elev); border-top:1px solid var(--border); padding:60px 0 30px; margin-top:40px; }
.footer-grid { display:grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap:40px; }
.footer h4 { font-size:.95rem; margin-bottom:16px; }
.footer ul { list-style:none; padding:0; margin:0; }
.footer ul li { margin-bottom:10px; }
.footer ul a { color: var(--muted); font-size:.92rem; }
.footer-bottom { border-top:1px solid var(--border); margin-top:40px; padding-top:24px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; color: var(--muted); font-size:.88rem; }

/* Dashboard / admin layout ------------------------------------------------ */
.app-shell { display:flex; min-height:100vh; }
.sidebar {
  width:260px; background: var(--bg-elev); border-right:1px solid var(--border); padding:24px 16px;
  position:sticky; top:0; height:100vh; overflow-y:auto; flex-shrink:0;
}
.sidebar .brand { margin-bottom:26px; padding:0 8px; }
.side-link { display:flex; align-items:center; gap:12px; padding:11px 14px; border-radius: var(--radius-sm); color: var(--muted); font-weight:600; margin-bottom:4px; transition: all .18s; }
.side-link:hover { background: var(--grad-soft); color: var(--text); }
.side-link.active { background: var(--grad); color:#fff; box-shadow: 0 8px 18px rgba(124,58,237,.35); }
.side-section { font-size:.72rem; text-transform:uppercase; letter-spacing:.1em; color: var(--muted); margin:18px 10px 8px; font-weight:700; }
.main-area { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar { display:flex; align-items:center; justify-content:space-between; padding:16px 28px; border-bottom:1px solid var(--border); background: var(--bg-elev); position:sticky; top:0; z-index:50; }
.content-area { padding:28px; flex:1; }

.stat-card { display:flex; align-items:center; gap:16px; }
.stat-icon { width:52px; height:52px; border-radius:14px; background: var(--grad-soft); display:grid; place-items:center; font-size:1.4rem; }
.stat-value { font-size:1.7rem; font-weight:800; line-height:1; }

/* Tables ------------------------------------------------------------------ */
.table { width:100%; border-collapse: collapse; }
.table th, .table td { text-align:left; padding:13px 14px; border-bottom:1px solid var(--border); font-size:.92rem; }
.table th { color: var(--muted); font-weight:700; font-size:.8rem; text-transform:uppercase; letter-spacing:.05em; }
.table tbody tr:hover { background: var(--grad-soft); }
.table-wrap { overflow-x:auto; }

/* Gallery grid ------------------------------------------------------------ */
.gallery-item { border-radius: var(--radius); overflow:hidden; position:relative; aspect-ratio:1; box-shadow: var(--shadow); }
.gallery-item img { width:100%; height:100%; object-fit:cover; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-cap { position:absolute; left:0; right:0; bottom:0; padding:16px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color:#fff; font-weight:700; }

/* Result grid ------------------------------------------------------------- */
.result-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:16px; }
.result-tile { border-radius: var(--radius-sm); overflow:hidden; position:relative; box-shadow: var(--shadow); }
.result-tile img { width:100%; display:block; }
.result-tile .actions { position:absolute; top:8px; right:8px; display:flex; gap:6px; opacity:0; transition:.2s; }
.result-tile:hover .actions { opacity:1; }

/* Skeleton loaders -------------------------------------------------------- */
.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--bg-elev) 50%, var(--border) 75%); background-size:200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position:-200% 0; } }

/* Spinner ----------------------------------------------------------------- */
.spinner { width:44px; height:44px; border:4px solid var(--border); border-top-color: var(--purple-1); border-radius:50%; animation: spin 0.8s linear infinite; margin:0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Reveal-on-scroll -------------------------------------------------------- */
.reveal { opacity:0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity:1; transform:none; }

/* Pagination -------------------------------------------------------------- */
.pagination { display:flex; gap:6px; justify-content:center; margin-top:34px; flex-wrap:wrap; }
.pagination a, .pagination span { padding:9px 15px; border-radius: var(--radius-sm); border:1px solid var(--border); background: var(--surface); font-weight:600; color: var(--text); }
.pagination .active { background: var(--grad); color:#fff; border-color:transparent; }

/* Utilities --------------------------------------------------------------- */
.flex { display:flex; } .items-center { align-items:center; } .justify-between { justify-content:space-between; }
.gap-2 { gap:8px; } .gap-3 { gap:16px; } .gap-4 { gap:24px; }
.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:36px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}.mb-4{margin-bottom:36px}
.w-full{width:100%}.hidden{display:none}
.section-head { max-width:640px; margin:0 auto 50px; text-align:center; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links { position:fixed; inset:66px 0 auto 0; flex-direction:column; background: var(--bg-elev); padding:20px; border-bottom:1px solid var(--border); display:none; gap:16px; }
  .nav-links.open { display:flex; }
  .nav-toggle { display:block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .sidebar { position:fixed; left:-280px; z-index:200; transition: left .3s; }
  .sidebar.open { left:0; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding:56px 0; }
}
