/* ============================================
   ANIVORA — BASE
   متغیرها، ریست، تایپوگرافی، آیکون‌ها، اسکرول‌بار
   + Layout کلی: header, nav, drawer, bottom-nav,
     notif-panel, page-loader
============================================ */

/* ============================================
   ROOT VARIABLES
============================================ */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-elevated: #1c1c28;
  --bg-hover: #22222f;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --accent: #6c63ff;
  --accent-dim: rgba(108,99,255,0.15);
  --accent-hover: #7c74ff;
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --gold: #f5c842;
  --success: #4caf80;
  --danger: #e05555;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.8);
  --transition: all 0.18s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --header-h: 60px;
}

/* ============================================
   RESET
============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
* { -webkit-tap-highlight-color: transparent; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a {
  text-decoration: none;
  color: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}
img {
  display: block;
  max-width: 100%;
}
ul { list-style: none; }
input, select { font-family: inherit; }

/* ============================================
   SCROLLBAR
============================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 2px;
}

/* ============================================
   ICON SYSTEM
============================================ */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }

/* ============================================
   HEADER
============================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* LOGO */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
  cursor: pointer;
}
.logo span { color: var(--accent); }

/* NAV LINKS */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* HEADER ACTIONS */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}
.icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.notif-badge {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid transparent;
  transition: var(--transition);
}
.avatar:hover { border-color: var(--accent); }

/* MINI SEARCH BAR */
.search-bar-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  width: 190px;
  transition: var(--transition);
  cursor: text;
}
.search-bar-mini input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
}
.search-bar-mini input::placeholder { color: var(--text-muted); }

/* HAMBURGER */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: var(--radius-sm);
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
}

/* ============================================
   PAGES
============================================ */
.page {
  display: none;
  padding-top: var(--header-h);
}
.page.active { display: block; }

/* ============================================
   MOBILE DRAWER
============================================ */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1999;
}
.drawer-overlay.open { display: block; }

.mobile-drawer {
  position: fixed;
  top: 0; left: 0;
  width: 272px;
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 2000;
  padding: 24px 0;
  transform: translateX(-100%);
  transition: transform 0.24s ease;
}
.mobile-drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.drawer-nav { padding: 0 12px; }
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}
.drawer-nav a.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 20px;
}

/* ============================================
   BOTTOM NAV (MOBILE)
============================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 58px;
  background: rgba(17,17,24,0.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 1000;
  padding: 0 8px;
}
.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
}
.bottom-nav-item.active { color: var(--accent); }

/* ============================================
   NOTIFICATION PANEL
============================================ */
.notif-panel {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  right: 20px;
  width: 340px;
  max-width: calc(100vw - 40px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  z-index: 999;
  display: none;
  overflow: hidden;
}
.notif-panel.open { display: block; }

.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.notif-item.unread { background: rgba(108,99,255,0.04); }
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.notif-text {
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}
.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 5px;
}

/* ============================================
   PAGE LOADER
============================================ */
.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}
.page-loader.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(108,99,255,0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loaderSpin 0.7s linear infinite;
}
@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

/* ============================================
   ANIMATIONS
============================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-up { animation: fadeUp 0.28s ease both; }

/* ============================================
   UTILITIES
============================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.text-secondary { color: var(--text-secondary); }