﻿/* ════════════════════════════════════════════════════════════════
   🎨 متغیرهای CSS - تعریف رنگ‌ها و مقادیر عمومی
   ════════════════════════════════════════════════════════════════ */

:root {
  /* 🌑 پس‌زمینه */
  --bg-primary: #0b1b33;
  --bg-secondary: #132c4c;
  --bg-tertiary: #0d2544;
  --bg-hover: #1a3a66;

  /* 🎯 رنگ اصلی */
  --accent: #42a5f5;
  --accent-light: #90caf9;
  --accent-hover: #1e88e5;

  /* 📝 متن */
  --text-light: #ffffff;
  --text-muted: aliceblue;
  --text-dark: #333333;

  /* 🎨 گرادیان */
  --gradient-body: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
  --gradient-trainer: linear-gradient(145deg, var(--bg-secondary), var(--bg-primary));
  --gradient-hero: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);

  /* 💫 سایه */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 35px rgba(2, 6, 23, 0.12);
  --shadow-focus: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--accent);

  /* ⏱️ ترانزیشن */
  --transition-fast: 0.2s ease;
  --transition-default: 0.3s ease;
  --transition-slow: 0.9s ease;

  /* 📏 مسافت */
  --border-radius: 12px;
  --border-radius-lg: 14px;
  --line-height: 1.8;
  --spacing-sm: 10px;
  --spacing-md: 20px;
  --spacing-lg: 30px;
  --spacing-xl: 50px;

  /* ✨ انیمیشن */
  --animation-float: float 4s ease-in-out infinite;
  --animation-fade: fadeIn 1.2s ease-in-out;
  --animation-fade-delay: fadeIn 1.5s ease-in-out;
  --animation-fade-up: fadeUp 1.2s ease-in-out;

  /* 🔧 دیگر */
  --header-z-index: 999;
  --body-margin-bottom: 60px;
  --max-width-hero: 650px;
  --trainer-size: 130px;
  --icon-size: 1.1rem;
}

/* ════════════════════════════════════════════════════════════════
   📱 استایل‌های پایه‌ای
   ════════════════════════════════════════════════════════════════ */

html {
  position: relative;
  min-height: 100%;
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

* {
  font-family: 'Vazirmatn', sans-serif;
}

body {
  background: var(--gradient-body);
  color: var(--text-light);
  line-height: var(--line-height);
  margin-bottom: var(--body-margin-bottom);
}

.bg-dark {
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════
   🏠 Header / Navigation - اصلاح شده
   ════════════════════════════════════════════════════════════════ */

.header-section {
  background: rgba(11, 27, 51, 0.95);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  min-height: 60px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(66, 165, 245, 0.2);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  padding: 0 1rem;
}

.logo-section {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.logo-link:hover {
  opacity: 0.8;
}

.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  color: #42a5f5;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  display: none;
}

/* ────────────────────────────────────────────────────────────────
   📱 Desktop Navigation
   ──────────────────────────────────────────────────────────────── */

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  flex: 1;
  justify-content: center;
}

.desktop-nav .nav-link {
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.95rem;
  white-space: nowrap;
}

.desktop-nav .nav-link:hover {
  color: #90caf9;
  background: rgba(66, 165, 245, 0.1);
}

.desktop-nav .nav-warning {
  color: #ffc107;
}

.desktop-nav .nav-warning:hover {
  color: #ffdd57;
  background: rgba(255, 193, 7, 0.1);
}

.desktop-nav .nav-danger {
  color: #dc3545;
}

.desktop-nav .nav-danger:hover {
  color: #ff6b6b;
  background: rgba(220, 53, 69, 0.1);
}

.desktop-nav .btn-auth {
  background: #42a5f5;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.desktop-nav .btn-auth:hover {
  background: #1e88e5;
  color: #ffffff;
}

.desktop-nav .btn-logout {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  border: 1px solid #dc3545;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.desktop-nav .btn-logout:hover {
  background: rgba(220, 53, 69, 0.3);
  color: #ff6b6b;
}

/* ────────────────────────────────────────────────────────────────
   📱 Hamburger Button - اصلاح شده
   ──────────────────────────────────────────────────────────────── */

.hamburger {
  background: none;
  border: 2px solid #42a5f5;
  color: #42a5f5;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 6px 10px;
  transition: all 0.3s ease;
  display: none;
  z-index: 1001;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  outline: none;
  border-radius: 4px;
}

.hamburger:hover {
  color: #90caf9;
  border-color: #90caf9;
  background: rgba(66, 165, 245, 0.1);
}

.hamburger:active {
  transform: scale(0.95);
}

.hamburger.active {
  color: #90caf9;
  border-color: #90caf9;
  background: rgba(66, 165, 245, 0.2);
  transform: rotate(90deg);
}

.hamburger i {
  pointer-events: none;
  display: block;
}

.hamburger:focus {
  outline: 2px solid #90caf9;
  outline-offset: 2px;
}

/* ────────────────────────────────────────────────────────────────
   📱 Mobile Menu - اصلاح شده
   ──────────────────────────────────────────────────────────────── */

.mobile-menu {
  position: fixed;
  top: 60px;
  right: -100%;
  width: 100%;
  max-height: calc(100vh - 60px);
  background: linear-gradient(180deg, #0b1b33 0%, #132c4c 100%);
  z-index: 1000;
  transition: right 0.3s ease-in-out;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 1rem;
  -webkit-overflow-scrolling: touch;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-menu.show {
  right: 0;
}

.mobile-menu .nav-link {
  display: block;
  padding: 1rem;
  margin: 0.5rem 0;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
  text-align: right;
  border-left: 3px solid transparent;
}

.mobile-menu .nav-link:hover {
  color: #90caf9;
  background: rgba(66, 165, 245, 0.15);
  border-left-color: #42a5f5;
  padding-right: calc(1rem + 8px);
}

.mobile-menu .nav-warning {
  color: #ffc107;
}

.mobile-menu .nav-warning:hover {
  background: rgba(255, 193, 7, 0.15);
  color: #ffdd57;
  border-left-color: #ffc107;
}

.mobile-menu .nav-danger {
  color: #dc3545;
}

.mobile-menu .nav-danger:hover {
  background: rgba(220, 53, 69, 0.15);
  color: #ff6b6b;
  border-left-color: #dc3545;
}

.mobile-menu .btn-auth {
  background: #42a5f5;
  color: #ffffff;
  font-weight: 600;
  border: none;
}

.mobile-menu .btn-auth:hover {
  background: #1e88e5;
  color: #ffffff;
  border-left-color: #1e88e5;
}

.mobile-menu .btn-logout {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  border-left: 3px solid #dc3545;
  font-weight: 600;
}

.mobile-menu .btn-logout:hover {
  background: rgba(220, 53, 69, 0.3);
  color: #ff6b6b;
  border-left-color: #ff6b6b;
}

/* ────────────────────────────────────────────────────────────────
   📱 Overlay - اصلاح شده
   ──────────────────────────────────────────────────────────────── */

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
  transition: all 0.3s ease;
  pointer-events: none;
}

.menu-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ════════════════════════════════════════════════════════════════
   📱 Responsive Breakpoints
   ════════════════════════════════════════════════════════════════ */

/* موبایل تا 767px */
@media (max-width: 767px) {
  .desktop-nav {
    display: none !important;
  }

  .hamburger {
    display: flex !important;
  }

  .header-section {
    min-height: 50px;
    padding: 0.5rem 0.5rem;
  }

  .logo-text {
    display: none;
  }

  .logo-img {
    height: 35px;
  }

  .mobile-menu {
    max-height: calc(100vh - 50px);
  }
}

/* تبلت و بالاتر */
@media (min-width: 768px) {
  .mobile-menu {
    display: none !important;
  }

  .hamburger {
    display: none !important;
  }

  .menu-overlay {
    display: none !important;
  }

  .desktop-nav {
    display: flex !important;
  }

  .logo-text {
    display: inline;
  }

  .logo-img {
    height: 40px;
  }
}

/* بزرگتر از 1200px */
@media (min-width: 1200px) {
  .desktop-nav {
    gap: 2rem;
  }

  .header-section {
    padding: 0.75rem 2rem;
  }

  .header-content {
    padding: 0;
  }
}