/* =====================================================
   naxcivan.online — assets/css/app.css
   Dizayn dili: "Alinja" — İlandağ siluetindən (Naxçıvanın
   ikiuclu dağı) və Ordubad ərik tonlarından ilhamlanıb.
   Rəng dəyişənləri --color-primary/accent DB-dən (theme.php)
   inject olunur, buradakılar yalnız fallback-dir.
   ===================================================== */

:root{
  --color-primary: #5B3B8C;
  --color-primary-dark: #402863;
  --color-primary-light: #8467B8;
  --color-accent: #E8A33D;

  --bg: #FAF8FC;
  --surface: #FFFFFF;
  --surface-alt: #F2EEF8;
  --text: #1D1626;
  --text-muted: #6B6478;
  --border: #E7E1F0;
  --danger: #C0392B;
  --success: #1F8A5F;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-1: 0 1px 3px rgba(29,22,38,.08);
  --shadow-2: 0 8px 24px rgba(29,22,38,.14);

  --nav-h: 64px;
  --top-h: 56px;
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #16121F; --surface: #211B2E; --surface-alt: #2A2338;
    --text: #F1EDF7; --text-muted: #A79BB8; --border: #322A44;
  }
}
[data-theme="dark"]{
  --bg: #16121F; --surface: #211B2E; --surface-alt: #2A2338;
  --text: #F1EDF7; --text-muted: #A79BB8; --border: #322A44;
}
[data-theme="light"]{
  --bg: #FAF8FC; --surface: #FFFFFF; --surface-alt: #F2EEF8;
  --text: #1D1626; --text-muted: #6B6478; --border: #E7E1F0;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a{color: inherit}
img{max-width:100%}
button{font-family: inherit}

h1,h2,h3,.font-display{ font-family: var(--font-display); letter-spacing: -0.01em; }

/* -------------------- APP SHELL -------------------- */
.app{
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--nav-h) + 12px);
}

.topbar{
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: var(--color-primary);
  background-image: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
}
.topbar .brand{
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  display:flex; align-items:center; gap:8px; text-decoration:none; color:#fff;
}
.topbar .brand .peak{ display:inline-block; }
.topbar .icon-btn{
  background: rgba(255,255,255,.14); border: none; color:#fff;
  width: 36px; height: 36px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-size: 18px; cursor:pointer;
}

.app-content{ padding: 12px 14px 4px; }

/* -------------------- BOTTOM NAV -------------------- */
.bottom-nav{
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  z-index: 40;
  box-shadow: 0 -4px 16px rgba(29,22,38,.06);
}
.bottom-nav a, .bottom-nav button.nav-item{
  flex: 1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap: 3px; text-decoration:none; color: var(--text-muted);
  font-size: 11px; background:none; border:none; cursor:pointer; font-family: var(--font-body);
}
.bottom-nav .nav-icon{ font-size: 21px; line-height:1; }
.bottom-nav a.active{ color: var(--color-primary); font-weight:600; }
.bottom-nav .nav-item.disabled{ opacity:.4; }
.bottom-nav .fab{
  flex: 0 0 auto; width: 48px; height: 48px; margin-top: -14px;
  border-radius: 50%; background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color:#fff; display:flex; align-items:center; justify-content:center; font-size:22px;
  box-shadow: var(--shadow-2); align-self:center;
}

/* -------------------- SETTINGS DRAWER -------------------- */
.drawer-overlay{
  position: fixed; inset: 0; background: rgba(20,15,30,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 50;
}
.drawer-overlay.open{ opacity: 1; pointer-events: auto; }
.drawer{
  position: fixed; top: 0; right: 0; height: 100%;
  width: 84%; max-width: 340px;
  background: var(--surface);
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  z-index: 51; overflow-y: auto;
  padding: 18px;
}
.drawer.open{ transform: translateX(0); }
.drawer h3{ font-family: var(--font-display); margin: 18px 0 8px; font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing:.04em; }
.drawer-close{ background:none; border:none; font-size:22px; color:var(--text); cursor:pointer; float:right; }
.drawer .user-mini{ display:flex; align-items:center; gap:10px; padding: 6px 0 14px; }
.drawer .user-mini img{ width:44px; height:44px; border-radius:50%; object-fit:cover; background:var(--surface-alt); }
.toggle-row{ display:flex; align-items:center; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--border); font-size:14px; }
.switch{ position:relative; width:40px; height:22px; }
.switch input{ opacity:0; width:0; height:0; }
.switch .track{ position:absolute; inset:0; background: var(--border); border-radius:22px; transition:.2s; cursor:pointer; }
.switch .track:before{ content:""; position:absolute; width:16px; height:16px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; }
.switch input:checked + .track{ background: var(--color-primary); }
.switch input:checked + .track:before{ transform: translateX(18px); }
.drawer-link{ display:block; padding:11px 0; font-size:14px; text-decoration:none; color:var(--text); border-bottom:1px solid var(--border); }
.drawer-link.danger{ color: var(--danger); }

/* -------------------- COMPONENTS -------------------- */
.card{ background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); margin-bottom: 12px; overflow:hidden; }
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  background: var(--color-primary); color:#fff; border:none;
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight:600;
  cursor:pointer; text-decoration:none;
}
.btn.secondary{ background: var(--surface-alt); color: var(--text); }
.btn.block{ width:100%; }
.btn:disabled{ opacity:.5; cursor:default; }
input[type=text], input[type=file], textarea{
  width:100%; border:1px solid var(--border); border-radius: var(--radius-sm);
  padding:10px 12px; font-size:14px; font-family: inherit; background: var(--surface); color: var(--text);
}
.badge-verified{ color: var(--color-primary); }
.toast{
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 60; opacity:0; pointer-events:none; transition: opacity .2s, transform .2s;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(-4px); }

.empty-state{ text-align:center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .peak{ opacity:.35; margin-bottom: 10px; }

@media (prefers-reduced-motion: reduce){
  .drawer, .drawer-overlay, .toast{ transition: none !important; }
}
