/* =========================================================
   COVESCREEN VIP COMPONENTS & LAYOUT
   - Navigation, hero, cards, grid, dropdowns, footer
   - Premium micro-interactions + responsive fixes
   ========================================================= */

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  width: 100%;
  backdrop-filter: var(--blur-sm);
  background: linear-gradient(to bottom, rgba(11,14,25,0.65), rgba(11,14,25,0.35));
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.navbar .container {
  height: 70px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-weight: var(--font-weight-bold);
  font-size: var(--fs-xl);
  color: var(--text-color-on-dark);
}

/* NAV LINKS */
.nav-links {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; align-items: center; gap: 28px;
}
.nav-links > li { position: relative; }
.nav-links a {
  color: var(--text-color-on-dark);
  font-weight: var(--font-weight-semibold);
  padding: 10px 12px;
  border-radius: var(--radius-round);
  transition: background var(--duration-quick) var(--ease-out), color var(--duration-quick) var(--ease-out);
}
.nav-links a:hover { background: rgba(255,255,255,0.08); }

/* DROPDOWN (desktop) */
.dropdown {
  position: absolute;
  left: 0; top: calc(100% + 12px);
  min-width: 280px;
  padding: var(--space-12);
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  border: 1px solid rgba(99,102,241,0.22);
  box-shadow: var(--shadow-medium);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--blur-md);
  display: none;
}
.nav-links li:hover .dropdown,
.nav-links li:focus-within .dropdown { display: block; }
.dropdown a {
  display: flex; align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-color);
  transition: background var(--duration-quick) var(--ease-out), transform var(--duration-quick) var(--ease-out);
}
.dropdown a:hover { background: rgba(108,51,255,0.10); transform: translateX(2px); }

/* HERO */
.hero {
  background: var(--gradient-hero);
  color: var(--text-color-on-dark);
  padding: var(--space-40) 0 var(--space-32);
  text-align: center;
}
.hero h1 { color: var(--text-color-on-dark); }
.hero-services {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin-top: var(--space-16);
}
.hero-services a {
  position: relative;
  color: var(--text-color-on-dark);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: color var(--duration-quick) var(--ease-out), transform var(--duration-quick) var(--ease-out);
}
.hero-services a::before {
  content: "";
  position: absolute;
  bottom: -4px; left: 50%;
  width: 0%; height: 2px;
  background: var(--gradient-brand);
  transition: width var(--duration-base) var(--ease-out), left var(--duration-base) var(--ease-out);
}
.hero-services a:hover { color: var(--brand-blue-500); transform: translateY(-2px); }
.hero-services a:hover::before { width: 100%; left: 0; }
.hero-services a:not(:last-child)::after {
  content: "|"; margin-left: 12px; color: rgba(255,255,255,0.5);
}
@media (max-width:720px){
  .hero-services { gap: 8px; }
  .hero-services a:not(:last-child)::after { margin-left: 8px; }
}

/* SERVICES GRID */
.services { padding: var(--space-56) 0 var(--space-72); }
.services h2 { text-align: center; margin-bottom: var(--space-32); }
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.service-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.service-card img {
  max-width: 80px;
  margin: 0 auto 15px;
}

.service-card h3 {
  margin: 10px 0;
  font-size: 1.2rem;
  color: #333;
}

.service-card p {
  flex-grow: 1;
  color: #666;
  font-size: 0.95rem;
}

.card-link {
  text-decoration: none;
  color: inherit;
}

.card-link:hover .service-card {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* FOOTER */
.footer {
  background: linear-gradient(180deg,#0d1226,#0a0f21);
  color: var(--text-color-on-dark);
  padding: var(--space-40) 0;
}
.footer .footer-content {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-24);
}
.footer p { margin:0; color:#bcd0ff; }

/* HAMBURGER (mobile) */
.hamburger {
  display:none; flex-direction:column; gap:6px; width:32px; height:32px; cursor:pointer;
}
.hamburger span {
  height:3px; width:100%; background:var(--text-color-on-dark);
  border-radius:var(--radius-round);
  transition:all var(--duration-quick) var(--ease-out);
}
.hamburger.active span:nth-child(1){ transform:rotate(45deg) translateY(8px); }
.hamburger.active span:nth-child(2){ opacity:0; }
.hamburger.active span:nth-child(3){ transform:rotate(-45deg) translateY(-8px); }

/* MOBILE MENU */
.menu-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.6);
  z-index:var(--z-overlay); opacity:0; pointer-events:none;
  transition:opacity var(--duration-base) var(--ease-out);
}
.menu-overlay.active { opacity:1; pointer-events:all; }

@media (max-width:720px){
  .hamburger{display:flex;}
  .nav-links {
    position:fixed; top:0; left:50%;
    transform:translateX(-50%) translateY(-120%);
    flex-direction:column;
    background:var(--gradient-hero);
    width:100%; max-width:360px;
    padding:var(--space-32); gap:var(--space-16);
    border-radius:var(--radius-lg);
    box-shadow:var(--shadow-strong);
    transition:transform 0.4s var(--ease-out);
    z-index:var(--z-dropdown);
    text-align:center;
  }
  .nav-links.open { transform:translateX(-50%) translateY(0); }
  .nav-links a { font-size:var(--fs-lg); padding:12px 0; border-bottom:1px solid rgba(255,255,255,0.08); }
  .nav-links a:last-child { border-bottom:none; }

  /* Services dropdown modal */
  .dropdown {
    position:fixed; top:12%; left:50%; transform:translateX(-50%);
    min-width:280px; background:var(--surface-0);
    border-radius:var(--radius-lg); box-shadow:var(--shadow-strong);
    padding:var(--space-16); display:none;
    z-index:var(--z-dropdown); text-align:center;
    animation:slideDown 0.4s var(--ease-out);
  }
  .dropdown.open { display:block; }
}
@keyframes slideDown {
  from{transform:translateX(-50%) translateY(-20px);opacity:0;}
  to{transform:translateX(-50%) translateY(0);opacity:1;}
}

/* PAGE TRANSITIONS + SPINNER */
.page-transition {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.page-transition.active {
  opacity: 1;
  transform: translateY(0);
}

.fade-overlay {
  position: fixed;
  inset: 0;
  background: var(--gradient-brand);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-in-out);
  z-index: var(--z-overlay);
}
.fade-overlay.active {
  opacity: 0.25;
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  background: var(--gradient-brand);
  display: grid;
  place-items: center;
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-in-out);
}
.spinner-overlay.active {
  opacity: 0.25;
  pointer-events: all;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255,255,255,0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* RESPONSIVE GRID FIXES */
@media (max-width: 1024px) {
  .service-card { grid-column: span 6; }
}
@media (max-width: 720px) {
  .nav-links.open { transform: translateX(-50%) translateY(0); }
  .dropdown {
    position: fixed;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 280px;
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-strong);
    padding: var(--space-16);
    display: none;
    z-index: var(--z-dropdown);
    text-align: center;
    animation: slideDown 0.4s var(--ease-out);
  }
  .dropdown.open { display: block; }

  .service-card { grid-column: span 12; }
  .footer .footer-content { flex-direction: column; text-align: center; }
}


/* DARK MODE OVERRIDES */
body.dark {
  background: #0f1420;
  color: var(--text-color-on-dark);
}
body.dark .navbar {
  background: linear-gradient(to bottom, rgba(20,20,40,0.85), rgba(20,20,40,0.55));
}
body.dark .hero {
  background: linear-gradient(135deg, #1b1140, #0d1b3d);
}
body.dark .service-card {
  background: #1c2230;
  color: var(--text-color-on-dark);
}
body.dark .footer {
  background: #0a0f21;
  color: #cfe1ff;
}

.footer .social-links {
  display: flex;
  gap: 12px;
}

.footer .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.06);
  transition: background var(--duration-quick) var(--ease-out), transform var(--duration-quick) var(--ease-out);
}

.footer .social-links a:hover {
  background: rgba(108, 51, 255, 0.18);
  transform: translateY(-2px);
}

.footer .social-links img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(1.2);
}
