/* ================================
   ZAYNE GROUP — PREMIUM UI SYSTEM
================================ */

/* ---------- Root Variables ---------- */
:root {
  --primary: #0b1f3a;
  --secondary: #004080;
  --accent: #e10600;
  --light: #f5f7fa;
  --dark: #111827;
  --text: #333;
  --white: #ffffff;

  --radius: 10px;
  --transition: all 0.35s ease;
}

/* ---------- Global Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.6;
}

/* ---------- Containers ---------- */
.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(11, 31, 58, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1000;
  padding: 15px 0;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  color: var(--white);
  font-weight: 700;
  font-size: 1.4rem;
}

nav {
  position: relative;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: var(--transition);
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

nav a:hover {
  color: var(--accent);
}

nav a.active {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Hero Sections ---------- */
.hero, .sub-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero h1,
.sub-hero h1 {
  font-weight: 700;
  letter-spacing: -0.5px;
}

.hero-overlay {
  text-align: center;
  padding: 120px 0;
  background: linear-gradient(to right, rgba(0,0,0,0.6), rgba(0,0,0,0.4));
  color: white;
}

/* ---------- Sections ---------- */
.section {
  padding: 90px 0;
  opacity: 0;
  transform: translateY(40px);
  transition: 1s ease;
}

.section.active {
  opacity: 1;
  transform: translateY(0);
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 25px;
  color: var(--primary);
  position: relative;
}

.section h2::after {
  content: "";
  width: 60px;
  height: 4px;
  background: var(--accent);
  position: absolute;
  left: 0;
  bottom: -10px;
  border-radius: 4px;
}

.section.alt {
  background: var(--light);
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-nav {
  display: inline-block;
  padding: 12px 25px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.btn-primary {
  background: var(--secondary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* ---------- Grid Systems ---------- */
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: 30px;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Hover effects for grids */
.grid-2 div, .grid-3 div, .grid-4 div {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  border-radius: var(--radius);
}
/* ---------- Responsive Design ---------- */

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  padding: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 5px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--white);
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

nav ul {
  list-style: none;
  display: flex;
  flex-direction: row;           /* horizontal links */
  align-items: center;          /* vertically center within navbar */
  gap: 25px;                    /* space between links */
  transition: var(--transition);
}

/* reset list-item spacing */
nav li {
  margin: 0;
  padding: 0;
}


/* Mobile Styles */
@media (max-width: 1024px) {
  .hamburger {
    display: flex;
    z-index: 1002; /* keep above dropdown so it's always clickable */
  }

  /* mobile dropdown container */
  nav ul {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100vw;
    background: rgba(11, 31, 58, 0.98);
    display: flex;
    flex-direction: column;
    gap: 0;                      /* remove gap for tighter list */
    padding: 20px 0;             /* more vertical padding */
    transform: translate(-50%, -100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;          /* prevent horizontal scrolling */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 1001;
    pointer-events: none;
  }

  nav ul.active {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;        /* enable when visible */
  }

  nav li {
    width: 100%;
    text-align: center;
    padding: 0;                  /* remove padding from li */
    margin: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  nav li:last-child {
    border-bottom: none;         /* no border on last item */
  }

  nav a {
    display: block;
    padding: 15px 15px;          /* reduced horizontal padding for more text space */
    font-size: 1rem;
    border-radius: 0;
    transition: background 0.2s ease, color 0.2s ease;
    text-align: center;
  }

  nav a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--accent);
  }

  .section {
    padding: 60px 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .sub-hero h1 {
    font-size: 1.8rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Loader */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255,255,255,0.3);
  border-top: 5px solid var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: 0 5px 25px rgba(0,0,0,0.05);
  transition: var(--transition);
  text-align: center;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

/* ---------- Forms ---------- */
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

form input,
form textarea {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid #ddd;
  font-family: inherit;
  transition: var(--transition);
}

form input:focus,
form textarea:focus {
  border-color: var(--secondary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,64,128,0.1);
}

/* ---------- Footer ---------- */
footer {
  background: var(--primary);
  color: var(--white);
  text-align: center;
  padding: 30px 0;
  font-size: 0.9rem;
}

/* ---------- Scroll Reveal Animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: 1s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Modal Popup ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  animation: popup 0.4s ease;
}

@keyframes popup {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  float: right;
  cursor: pointer;
  font-weight: bold;
  color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  nav ul {
    gap: 15px;
  }

  .section {
    padding: 60px 0;
  }

  .hero h1,
  .sub-hero h1 {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .sub-hero h1 {
    font-size: 1.5rem;
  }
}