/* ========================================
   HEADER & NAVIGATION - LIGHT THEME
   ======================================== */

@font-face {
  font-family: 'Logo Display';
  src: url('../fonts/font.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* === HEADER === */
.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(36, 58, 84, 0.34) 0%, rgba(28, 48, 72, 0.22) 100%);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
  transition: all var(--timing-base) var(--ease-in-out);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.header.scrolled {
  background: linear-gradient(180deg, rgba(32, 52, 78, 0.52) 0%, rgba(24, 42, 66, 0.42) 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  border-bottom-color: rgba(255, 255, 255, 0.24);
}

.header-container {
  max-width: 1536px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  position: relative;
}

/* === LOGO === */
.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  position: relative;
  z-index: 1001;
}

.logo-icon {
  width: 42px;
  height: 42px;
  position: relative;
}

.header .logo-icon img,
.footer-logo .logo-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(230, 126, 34, 0.3));
}

/* Keep logo image consistent in header and footer */
.header .logo-icon img,
.footer-logo .logo-icon img {
  border-radius: 10px;
}

.logo-text {
  width: 11.2ch;
  display: grid;
  grid-template-rows: auto auto;
  gap: 0.1rem;
  align-items: start;
}

.logo-title {
  display: block;
  width: 100%;
  font-family: 'Logo Display', 'Glacial Indifference', sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 0.95;
}

.logo-subtitle {
  display: block;
  width: 100%;
  font-size: 0.86rem;
  color: #ffd199;
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

/* === NAVIGATION === */
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  transition: all var(--timing-base) var(--ease-in-out);
  position: relative;
  border-radius: var(--radius-sm);
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--gradient-accent);
  transform: translateX(-50%);
  transition: width var(--timing-base) var(--ease-in-out);
  border-radius: var(--radius-full);
}

.nav-link:hover {
  color: #ffd8ac;
  background: rgba(255, 255, 255, 0.12);
}

.nav-link:hover::before,
.nav-link.active::before {
  width: 60%;
}

.nav-link.active {
  color: #ffd39b;
  font-weight: var(--font-weight-bold);
}

/* === DROPDOWN === */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 1rem);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 17, 30, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-sm);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-10px);
  transition: all var(--timing-base) var(--ease-in-out);
  z-index: 1000;
}

.nav-item.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(8, 17, 30, 0.84);
}

.dropdown-item {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-sm);
  transition: all var(--timing-fast) var(--ease-in-out);
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffd39b;
  padding-left: calc(var(--space-md) + 6px);
}

/* === HEADER ACTIONS === */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-signal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 221, 179, 0.4);
  background: linear-gradient(135deg, rgba(230, 126, 34, 0.24), rgba(39, 174, 96, 0.18));
}

.header-signal-label {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: var(--font-weight-bold);
}

.header-signal-value {
  font-size: var(--font-size-sm);
  color: #ffffff;
  font-weight: var(--font-weight-bold);
}

.header-signal-change {
  font-size: var(--font-size-xs);
  color: var(--color-success);
  font-weight: var(--font-weight-bold);
}

.market-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: rgba(39, 174, 96, 0.18);
  border-radius: var(--radius-full);
  border: 1px solid rgba(142, 246, 186, 0.45);
}

.market-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse 2s var(--ease-in-out) infinite;
  box-shadow: 0 0 8px var(--color-success);
}

.market-status-text {
  font-size: var(--font-size-xs);
  color: var(--color-success);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* === MOBILE MENU === */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: #ffffff;
  border-radius: 3px;
  transition: all var(--timing-base) var(--ease-in-out);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 18, 0.72);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s var(--ease-out), visibility 0.24s var(--ease-out);
  z-index: 900;
  display: none !important;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* === FOOTER === */
.footer {
  --footer-mx: 50%;
  --footer-my: 50%;
  background: linear-gradient(180deg, rgba(21, 39, 62, 0.72) 0%, rgba(16, 32, 53, 0.8) 100%);
  color: #ffffff;
  border-top: 1px solid rgba(255, 198, 141, 0.48);
  margin-top: 0;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 8% 14%, rgba(255, 186, 110, 0.16), transparent 38%),
    radial-gradient(circle at 92% 86%, rgba(117, 214, 255, 0.13), transparent 36%);
  pointer-events: none;
  z-index: 0;
}

.footer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(430px circle at var(--footer-mx) var(--footer-my), rgba(255, 209, 154, 0.14) 0%, rgba(121, 220, 255, 0.08) 32%, transparent 66%);
  opacity: 0.9;
  transition: background-position 0.12s linear;
  pointer-events: none;
  z-index: 0;
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(1.4rem, 2.3vw, 2.5rem) var(--space-lg) clamp(0.9rem, 1.6vw, 1.35rem);
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(380px, 1.38fr) minmax(280px, 0.95fr);
  gap: clamp(0.9rem, 1.8vw, 2rem);
  margin-bottom: clamp(0.9rem, 1.4vw, 1.45rem);
  align-items: start;
}

.footer-brand {
  max-width: 340px;
}

.footer-logo .logo-title {
  color: #ffffff;
}

.footer-logo .logo-subtitle {
  color: #ffd199;
}

.footer-logo {
  margin-bottom: 0.85rem;
}

.footer-description {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  margin-top: 0.25rem;
  margin-bottom: var(--space-md);
  line-height: 1.55;
}

.footer-social {
  display: flex;
  gap: 0.6rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-md);
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.24s var(--ease-out), border-color 0.24s var(--ease-out), background 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out);
}

.social-link:hover {
  background: linear-gradient(145deg, rgba(255, 193, 124, 0.35), rgba(112, 219, 255, 0.2));
  border-color: rgba(255, 213, 171, 0.65);
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
}

.social-link.is-float {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.footer-links-shell,
.footer-contact-card {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.footer-links-shell {
  padding: 0;
}

.footer-shell-title {
  margin: 0 0 0.7rem;
  color: #ffd5a5;
  font-size: 0.78rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-links-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.footer-section-title {
  font-size: 0.95rem;
  font-weight: var(--font-weight-bold);
  color: rgba(255, 255, 255, 0.96);
  margin-bottom: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-link {
  margin-bottom: 0.45rem;
}

.footer-link a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.88rem;
  transition: transform 0.24s var(--ease-out), color 0.24s var(--ease-out), text-shadow 0.24s var(--ease-out);
  display: flex;
  align-items: center;
  gap: 0.42rem;
  border: 0;
  border-radius: 0;
  padding: 0.14rem 0;
  background: transparent;
  position: relative;
  overflow: hidden;
}

.footer-link a::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7fe8ff;
  box-shadow: 0 0 8px rgba(127, 232, 255, 0.7);
  flex-shrink: 0;
}

.footer-link a:hover {
  color: #ffffff;
  transform: translateX(3px);
  text-shadow: 0 0 10px rgba(126, 229, 255, 0.34);
}

.footer-contact-card {
  padding: 0.15rem 0;
  display: grid;
  gap: 0.52rem;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  text-decoration: none;
  border: 1px solid rgba(255, 228, 196, 0.26);
  border-radius: 12px;
  padding: 0.56rem 0.62rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  transition: transform 0.24s var(--ease-out), color 0.24s var(--ease-out), text-shadow 0.24s var(--ease-out), border-color 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out), background 0.24s var(--ease-out);
}

.footer-contact-item:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 220, 181, 0.58);
  background: linear-gradient(145deg, rgba(255, 199, 132, 0.2), rgba(115, 215, 255, 0.14));
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
}

.footer-contact-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.09);
  color: #7fe8ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-contact-icon svg {
  width: 16px;
  height: 16px;
}

.footer-contact-text {
  display: grid;
  gap: 1px;
}

.footer-contact-text strong {
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: var(--font-weight-semibold);
}

.footer-contact-text small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
}

.footer-contact-item.is-float {
  transform: translateY(-2px);
}

.footer-bottom {
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.84rem;
}

.footer-legal {
  display: flex;
  gap: 1rem;
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  font-size: 0.86rem;
  transition: color var(--timing-base) var(--ease-in-out), text-shadow var(--timing-base) var(--ease-in-out);
}

.footer-legal a:hover {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(126, 229, 255, 0.35);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .mobile-menu-toggle { display: flex; }
  .mobile-menu-toggle { z-index: 1301; }
  
  .nav {
    position: fixed;
    top: 86px;
    left: auto !important;
    right: 10px !important;
    width: min(88vw, 380px);
    height: auto;
    max-height: calc(100svh - 98px);
    background: #071220 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    flex-direction: column;
    gap: var(--space-md);
    padding: 12px;
    transform: translate3d(calc(100% + 14px), 0, 0) !important;
    transition: transform var(--timing-slow) var(--ease-in-out);
    overflow-y: auto;
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.45);
    z-index: 1600 !important;
    opacity: 1 !important;
    border-right: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    overflow-x: hidden;
  }

  body.mobile-nav-open .header {
    z-index: 1590 !important;
    background: transparent !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    display: none !important;
  }

  body.mobile-nav-open .nav,
  body.mobile-nav-open .nav * {
    filter: none !important;
    -webkit-filter: none !important;
  }

  body.mobile-nav-open::before {
    content: none !important;
  }

  body.mobile-nav-open .main-content::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(3, 10, 18, 0.68);
    z-index: 1580;
    pointer-events: none;
  }

  .nav::before {
    content: none;
  }
  
  .nav.active {
    transform: translate3d(0, 0, 0) !important;
  }
  
  .nav-menu {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    position: relative;
    z-index: 1;
  }
  
  .nav-item {
    width: 100%;
    border: 0;
  }
  
  .nav-link {
    width: 100%;
    padding: 12px 14px;
    font-size: var(--font-size-base);
    color: #ffffff !important;
    border: 1px solid rgba(164, 213, 248, 0.22);
    border-radius: 12px;
    background: #0a1b2e !important;
  }
  
  .nav-link:hover {
    background: linear-gradient(145deg, rgba(35, 58, 86, 0.95), rgba(19, 39, 63, 0.95));
    border-color: rgba(191, 228, 253, 0.42);
  }

  .nav-item,
  .header-actions > * {
    opacity: 1 !important;
    transform: none !important;
    transition: transform 0.24s var(--ease-out);
  }
  
  .nav-link::before { display: none; }
  
  .dropdown-menu {
    position: static;
    transform: none;
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    border: 1px solid rgba(164, 213, 248, 0.2);
    box-shadow: none;
    background: #10233a !important;
    border-radius: 12px;
    margin-top: 0;
    padding: 0;
  }
  
  .dropdown-menu::before { display: none; }
  
  .nav-item.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    height: auto;
    padding: var(--space-sm);
    margin-top: var(--space-sm);
  }

  /* Mobile menu: no dropdown, show all links directly */
  .nav-item.dropdown {
    border: 0;
  }

  .nav-item.dropdown > .nav-link {
    display: none;
  }

  .nav-item.dropdown .dropdown-menu {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    display: grid;
    gap: 8px;
  }

  .nav-item.dropdown .dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 14px;
    font-size: var(--font-size-base);
    color: #ffffff;
    border: 1px solid rgba(164, 213, 248, 0.22);
    border-radius: 12px;
    background: #0a1b2e;
  }

  .nav-item.dropdown .dropdown-item:hover {
    color: #ffffff;
    padding-left: 14px;
    background: linear-gradient(145deg, rgba(35, 58, 86, 0.95), rgba(19, 39, 63, 0.95));
    border-color: rgba(191, 228, 253, 0.42);
  }
  
  .header-actions {
    flex-direction: column;
    width: 100%;
    gap: var(--space-sm);
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    position: relative;
    z-index: 1;
  }
  
  .header-actions .btn { width: 100%; }
  .header-actions .btn {
    color: #ffffff !important;
    opacity: 1 !important;
  }
  .header-actions .market-status,
  .header-actions .header-signal {
    opacity: 1 !important;
  }
  .header-signal { width: 100%; justify-content: center; }
  .market-status {
    width: 100%;
    justify-content: center;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .footer-brand {
    grid-column: 1 / -1;
    max-width: 100%;
  }

  .footer-contact-card {
    grid-column: 1 / -1;
  }
}

.header .btn-ghost {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
}

.header .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.7);
  color: #ffffff;
}

.header .btn-primary {
  border: 1px solid rgba(255, 220, 176, 0.38);
  box-shadow: 0 10px 20px rgba(230, 126, 34, 0.28);
}

@media (max-width: 1280px) {
  .header-signal { display: none; }
}

@media (max-width: 768px) {
  .header-content { height: 70px; }
  .logo-icon {
    width: 38px;
    height: 38px;
  }
  .logo-text {
    width: 10.2ch;
  }
  .logo-title {
    font-size: 1.05rem;
  }
  .logo-subtitle {
    font-size: 0.78rem;
  }
  .nav {
    top: 74px;
    height: auto;
    max-height: calc(100svh - 86px);
    left: auto !important;
    right: 8px !important;
    width: 90vw;
  }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links-columns { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-legal { flex-direction: column; gap: var(--space-sm); }
}
