﻿/* shared-nav.css v8.3 — Desktop mega-dropdown expansion animation */
@import url('https://fonts.googleapis.com/css2?family=Russo+One&display=swap');

:root {
    --navbar-height: 64px;
}

.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9000;
    background: rgba(15,23,42,0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    width: 100%; height: var(--navbar-height); margin: 0; padding: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body { 
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin-top: var(--navbar-height) !important;
}
.nav-container { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 100%; }
.nav-content { display: flex; align-items: center; height: 100%; gap: 20px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.logo-text { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    line-height: 1.1;
}
.logo-text { font-family: 'Russo One', sans-serif; font-size: 22px; font-weight: 400; color: #ffffff; white-space: nowrap; letter-spacing: 0px; }
.logo-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.85);
    letter-spacing: 0.3px;
    margin-top: 2px;
    text-align: center;
}
.nav-links { display: none; align-items: center; justify-content: center; gap: 4px; flex: 1; margin: 0 auto; }
.nav-item { position: relative; }
.nav-btn {
    background: none; border: none; color: #e2e8f0; font-size: 14px; font-weight: 600;
    padding: 8px 14px; border-radius: 10px; cursor: pointer;
    transition: color 0.2s, background 0.2s;
    display: flex; align-items: center; gap: 5px; white-space: nowrap; text-decoration: none;
}
.nav-btn:hover { color: #f1f5f9; background: rgba(255,255,255,0.06); }
.nav-item.open .nav-btn { color: #06b6d4; background: rgba(6,182,212,0.08); }
a.nav-btn { color: #94a3b8; }
a.nav-btn:hover { color: #f1f5f9; background: rgba(255,255,255,0.06); }
a.nav-btn.active { color: #06b6d4; background: none; }
.arrow { font-size: 10px; transition: transform 0.2s; }
.nav-item.open .arrow { transform: rotate(180deg); }
.dropdown {
    display: none; position: fixed; min-width: 220px;
    background: rgba(15,23,42,0.98); backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 8px;
    z-index: 9100; box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.nav-item.open .dropdown { display: block; }
.dropdown a { display: block; padding: 10px 14px; color: #e2e8f0; text-decoration: none; font-size: 14px; font-weight: 500; border-radius: 8px; transition: background 0.15s, color 0.15s; white-space: nowrap; }
.dropdown a:hover { background: rgba(6,182,212,0.1); color: #f1f5f9; }
.nav-actions { display: none; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-stats-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(102,126,234,.1); border: 1px solid rgba(102,126,234,.25); display: flex; align-items: center; justify-content: center; font-size: 16px; text-decoration: none; transition: all 0.2s; flex-shrink: 0; cursor: pointer; }
.nav-stats-icon:hover { background: rgba(102,126,234,.2); border-color: rgba(102,126,234,.4); transform: translateY(-1px); }
.btn-login { padding: 7px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: #e2e8f0; font-size: 13px; font-weight: 600; text-decoration: none; transition: all 0.2s; white-space: nowrap; }
.btn-login:hover { background: rgba(255,255,255,0.12); color: #fff; }
.btn-signup { padding: 7px 16px; border-radius: 10px; border: none; background: linear-gradient(135deg,#06b6d4,#0ea5e9); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; transition: all 0.2s; white-space: nowrap; }
.btn-signup:hover { opacity: 0.9; transform: translateY(-1px); }
.mob-xp-wrap { display: none; margin-left: auto; margin-right: 8px; }
.mob-xp-badge { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: linear-gradient(135deg,rgba(99,102,241,0.15),rgba(139,92,246,0.15)); border: 1px solid rgba(139,92,246,0.3); border-radius: 12px; text-decoration: none; transition: all 0.2s; }
.mob-xp-badge:hover { background: linear-gradient(135deg,rgba(99,102,241,0.25),rgba(139,92,246,0.25)); transform: translateY(-1px); }
.mob-xp-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#6366f1,#8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.mob-xp-val { font-size: 16px; font-weight: 700; color: #fbbf24; white-space: nowrap; }
.burger { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 40px; height: 40px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; cursor: pointer; padding: 0; margin-left: auto; flex-shrink: 0; }
.burger span { display: block; width: 18px; height: 2px; background: #94a3b8; border-radius: 2px; transition: all 0.2s; }
.burger:hover span { background: #f1f5f9; }
.mob-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); z-index: 9200; }
.mob-overlay.active { display: block; }
.mob-menu { position: fixed; top: 0; right: -100%; width: min(340px,88vw); height: 100vh; height: 100dvh; background: rgba(10,14,26,0.97); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border-left: 1px solid rgba(255,255,255,0.08); z-index: 9300; overflow: hidden; transition: right 0.3s cubic-bezier(0.4,0,0.2,1); }
.mob-menu.active { right: 0; }
.mob-header { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.07); font-size: 15px; font-weight: 700; color: #f1f5f9; background: rgba(10,14,26,0.97); z-index: 1; }
.mob-header button { width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: #94a3b8; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.mob-header button:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
.mob-body { position: absolute; top: 57px; left: 0; right: 0; bottom: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 14px 32px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(6,182,212,0.2) transparent; }
.mob-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.mob-actions .btn-login, .mob-actions .btn-signup { flex: 1; text-align: center; padding: 12px 16px; font-size: 14px; border-radius: 14px; }
.mob-actions .btn-login { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); color: #e2e8f0; }
.mob-actions .btn-signup { background: linear-gradient(135deg,#06b6d4,#0ea5e9); border: none; color: #fff; font-weight: 700; }
.mob-acc { border-radius: 12px; overflow: hidden; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); margin-bottom: 4px; }
.mob-acc-title { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; font-size: 14px; font-weight: 600; color: #e2e8f0; cursor: pointer; user-select: none; transition: color 0.15s, background 0.15s; }
.mob-acc-title:hover { color: #f1f5f9; background: rgba(255,255,255,0.04); }
.mob-acc.open .mob-acc-title { color: #38bdf8; }
.mob-arr { font-size: 14px; color: #ffffff; transition: transform 0.25s; }
.mob-acc.open .mob-arr { transform: rotate(180deg); }
.mob-acc-body { display: none; padding: 6px 8px 10px; border-top: 1px solid rgba(255,255,255,0.05); }
.mob-acc.open .mob-acc-body { display: block; }
.mob-sub { display: flex; align-items: center; gap: 10px; padding: 11px 14px; color: #e2e8f0; text-decoration: none; font-size: 14px; border-radius: 10px; transition: all 0.18s; margin-bottom: 2px; }
.mob-sub:hover { background: rgba(6,182,212,0.1); color: #e2e8f0; transform: translateX(3px); }

/* Полный и короткий логотип */
.logo-short { display: none; }
.logo-full { display: inline; }

@media (min-width: 768px) {
    .nav-links { display: flex; }
    .nav-actions { display: flex; }
    .burger { display: none; }
    .mob-menu { display: none !important; }
    .mob-overlay { display: none !important; }
    .mob-xp-wrap { display: none !important; }
}
@media (max-width: 767px) {
    .nav-links { display: none; }
    .nav-actions { display: none; }
    .burger { display: flex; }
    .mob-menu { display: flex; }
    .navbar { position: fixed; top: 0; left: 0; right: 0; }
    .nav-container { padding: 0 12px; }
    .logo-text { font-size: 18px; }
    .logo-subtitle { font-size: 9px; }
    .mob-menu { width: 92vw; }
    .nav-content { gap: 8px; }
    .mob-xp-badge { padding: 6px 10px; gap: 8px; }
    .mob-xp-avatar { width: 28px; height: 28px; font-size: 13px; }
    .mob-xp-val { font-size: 13px; }
    .mob-xp-wrap { margin-right: 4px; }
    .burger { width: 36px; height: 36px; }
    .burger span { width: 16px; }
    
    /* Короткий логотип на мобильных */
    .logo-text .logo-full { display: none !important; }
    .logo-text .logo-short { display: inline !important; }
}

/* ========================================
   NESTED SUBMENU STYLES
   ======================================== */

.mob-sub-main-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  margin-top: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(6, 182, 212, 0.25);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.1);
}

.mob-sub-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 12px;
  transition: all 0.2s;
  flex: 1;
  padding-right: 10px;
  background: transparent;
  border: none;
}

.mob-sub-main:hover {
  color: #06b6d4;
}

.mob-sub-main-wrapper:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(14, 165, 233, 0.12));
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.4);
}

.mob-sub-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 100%;
  font-size: 14px;
  color: #ffffff;
  transition: transform 0.3s ease, color 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.mob-sub-arrow:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.mob-sub-arrow.expanded {
  transform: rotate(180deg);
  color: #ffffff;
}

.mob-sub-nested {
  margin: 0 0 10px 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.mob-sub-nested.show {
  max-height: 1200px;
  opacity: 1;
  margin: 10px 0 10px 0;
  padding: 10px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(6, 182, 212, 0.05));
  border-radius: 12px;
  border: 1px solid rgba(6, 182, 212, 0.15);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mob-sub-nested-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(6, 182, 212, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding-left: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

.mob-sub-nested-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: rgba(226, 232, 240, 0.95) !important;
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: 4px;
  transition: all 0.25s ease;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(14, 165, 233, 0.06));
  border: 1px solid rgba(6, 182, 212, 0.15);
  position: relative;
  overflow: hidden;
}

.mob-sub-nested-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.2), transparent);
  transition: left 0.5s ease;
}

.mob-sub-nested-item:hover::before {
  left: 100%;
}

.mob-sub-nested-item:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(14, 165, 233, 0.12));
  color: #06b6d4 !important;
  transform: translateX(6px) scale(1.02);
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25), 0 0 20px rgba(6, 182, 212, 0.1);
}

.mob-sub-nested-item:active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(14, 165, 233, 0.18));
  transform: translateX(4px) scale(0.98);
}


/* ========================================
   DESKTOP MEGA DROPDOWN STYLES
   ======================================== */

@media (min-width: 768px) {
  .mega-dropdown {
    min-width: 280px;
    max-width: 280px;
    width: 280px;
    padding: 12px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                min-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s ease;
  }

  .mega-dropdown.expanded {
    min-width: 600px;
    max-width: 700px;
    width: 650px;
    padding: 16px;
  }

  .dropdown-expandable {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 4px;
  }

  .dropdown-main {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(6, 182, 212, 0.25);
    transition: all 0.2s ease;
    flex: 1;
    padding-right: 40px;
  }

  .dropdown-main:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(14, 165, 233, 0.12));
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.4);
    color: #06b6d4;
  }

  .dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.3s ease, color 0.2s ease;
    z-index: 10;
  }

  .dropdown-arrow:hover {
    color: #06b6d4;
  }

  .dropdown-arrow.expanded {
    transform: translateY(-50%) rotate(180deg);
  }

  .dropdown-nested {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
    padding: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.4s ease 0.1s, 
                margin 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .dropdown-nested.show {
    max-height: 800px;
    opacity: 1;
    margin: 8px 0 12px 0;
    padding: 12px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(6, 182, 212, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(6, 182, 212, 0.15);
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s ease, 
                margin 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .dropdown-nested-title {
    font-size: 11px;
    font-weight: 700;
    color: rgba(6, 182, 212, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
  }

  .dropdown-nested-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .dropdown-nested-item {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.95);
    text-decoration: none;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.06), rgba(14, 165, 233, 0.04));
    border: 1px solid rgba(6, 182, 212, 0.12);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
  }

  .dropdown-nested-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.15), transparent);
    transition: left 0.4s ease;
  }

  .dropdown-nested-item:hover::before {
    left: 100%;
  }

  .dropdown-nested-item:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(14, 165, 233, 0.1));
    color: #06b6d4;
    transform: translateX(4px) scale(1.02);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 3px 10px rgba(6, 182, 212, 0.2);
  }
}
