/* === Global Variables === */
:root {
    --bg: #FFFFFF;
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --border-color: #D2D2D7;
    --input-bg: #F5F5F7;
    --input-focus: #0071E3;
    --button-bg: #0071E3;
    --button-bg-hover: #005BBB;
    --button-disabled-bg: #D1D1D6;
    --button-disabled-text: #8E8E93;
    --radius: 14px;
    --shadow: rgba(0, 0, 0, 0.08);
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* === Base Styles === */
body {
    font-family: var(--font-primary);
    background-color: var(--bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 3.5rem auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* === Typography === */
h1 {
    font-size: 2.6rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
    letter-spacing: -0.015em;
    user-select: none;
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #444;
}

p.subtitle {
    font-size: 1.1rem;
    color: #6e6e73;
    text-align: center;
}
/* === Navbar === */
.navbar {
    width: 100%;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    text-align: center;
    min-width: 80px; /* Ensure all links are at least this wide */
    padding: 0.5rem 1rem;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: #f9f9f9;
    color: #000;
}

/* === Hamburger Menu === */
.menu-toggle {
    background: none;
    border: none;
    font-size: 1.8rem;
    display: none;
    color: var(--text-primary);
    cursor: pointer;
}

@media (max-width: 720px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        background-color: var(--bg);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        border-top: 1px solid #e5e5ea;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
        border-radius: 12px;
        overflow: hidden;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        width: 100%; /* Each link takes full width */
        padding: 1rem 2rem;
        font-size: 1.1rem;
        border-bottom: 1px solid #f0f0f0;
        box-sizing: border-box;
    }
}

/* === Footer === */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1.8rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg);
    border-top: 1px solid #e5e5ea;
    user-select: none;
    margin-top: auto;
}

/* === Form Styles === */
.form-row {
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr) auto;
    gap: 1.75rem;
    align-items: end;
    transition: box-shadow 0.3s ease;
}

.form-row:hover,
.form-row:focus-within {
    box-shadow: 0 6px 20px var(--shadow);
}

.label-only {
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--text-primary);
    user-select: none;
    padding-left: 0.4rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 7px;
    color: var(--text-secondary);
}

.form-group input[type="number"] {
    padding: 12px 16px;
    font-size: 1.2rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--input-bg);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-primary);
    font-weight: 500;
    outline-offset: 3px;
}

.form-group input[type="number"]:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 8px rgba(0, 113, 227, 0.6);
    background-color: #fff;
}

.form-group input[type="number"]:invalid {
    border-color: #e04848;
    background-color: #fdecea;
}

/* Style for the select dropdown */
.form-group select {
  padding: 12px 16px;
  font-size: 1.2rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--input-bg);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  color: var(--text-primary);
  font-weight: 500;
  outline-offset: 3px;
  appearance: none; /* Remove default dropdown arrow */
}

/* Focus state for select dropdown */
.form-group select:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 8px rgba(0, 113, 227, 0.6);
  background-color: #fff;
  outline: none; /* Remove default outline */
}

/* Invalid state for select dropdown */
.form-group select:invalid {
  border-color: #e04848;
  background-color: #fdecea;
}

/* Optional: Custom dropdown arrow for appearance */
.form-group select::-ms-expand {
  display: none; /* Remove default arrow in IE */
}

.form-group select {
  -webkit-appearance: none; /* Remove default dropdown arrow in Safari */
  -moz-appearance: none; /* Remove default dropdown arrow in Firefox */
  appearance: none; /* Remove default dropdown arrow in modern browsers */
  position: relative;
}

.form-group select::after {
  content: "▼"; /* Custom dropdown arrow */
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* === Download Button === */
.download-button {
    background-color: var(--button-bg);
    color: white;
    font-weight: 600;
    font-size: 1.6rem;
    border: none;
    border-radius: 16px;
    padding: 15px 24px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: background-color 0.35s ease, box-shadow 0.35s ease, transform 0.15s ease;
    height: 56px;
}

.download-button:hover:not(:disabled),
.download-button:focus:not(:disabled) {
    background-color: var(--button-bg-hover);
    box-shadow: 0 8px 26px rgba(0, 91, 181, 0.7);
    outline: none;
    transform: translateY(-2px);
}

.download-button:disabled {
    background-color: var(--button-disabled-bg);
    color: var(--button-disabled-text);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.75;
}

/* === Responsive === */
@media (max-width: 720px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }

    .label-only {
        font-size: 1.15rem;
        padding-left: 0;
    }

    .download-button {
        width: 100%;
        font-size: 1.35rem;
        padding: 14px 0;
        height: 48px;
        border-radius: 14px;
    }
}

/* Hamburger Icon */
.menu-toggle {
    position: relative;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    display: none;
    z-index: 1100;
}

.menu-toggle span {
    position: absolute;
    height: 2px;
    width: 100%;
    background-color: #1D1D1F;
    left: 0;
    transition: all 0.3s ease-in-out;
    border-radius: 1px;
}

.menu-toggle span:nth-child(1) {
    top: 0;
}

.menu-toggle span:nth-child(2) {
    top: 9px;
}

.menu-toggle span:nth-child(3) {
    top: 18px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 9px;
}

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

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 9px;
}

/* Mobile Nav */
@media (max-width: 720px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        background-color: white;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        border-top: 1px solid #e5e5ea;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
        border-radius: 12px;
        overflow: hidden;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 1.2rem 2rem; /* Consistent vertical padding */
        font-size: 1.1rem;
        font-weight: 500;
        color: var(--text-primary);
        text-decoration: none;
        border-bottom: 1px solid #f0f0f0;
        box-sizing: border-box; /* Makes padding and borders included in height */
        text-align: left;
        line-height: 1.4;
    }
}
/* === Section for About Page === */
#about {
    padding: 4rem 0;
    background-color: var(--bg);
}

/* === About Title === */
.about-title {
    font-size: 2.8rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

/* === About Descriptions === */
.about-description {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* === Why Countopia Section Title === */
.why-countopia-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 3rem;
}

/* === Why Countopia Items === */
.why-countopia-item {
    background-color: var(--bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    transition: box-shadow 0.3s ease;
}

.why-countopia-item h4 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    text-align: center;
}

.why-countopia-item p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
}

/* === Hover Effect for Why Countopia Items === */
.why-countopia-item:hover {
    box-shadow: 0 6px 20px var(--shadow);
}

/* === Mobile Styling === */
@media (max-width: 720px) {
    .about-title {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }

    .about-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .why-countopia-title {
        font-size: 1.7rem;
    }

    .why-countopia-item {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .why-countopia-item h4 {
        font-size: 1.5rem;
    }
}

/* === Scoped Styles for Fun Facts Page === */
  .fun-facts-page {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    color: #1d1d1f;
    text-align: center;
    padding: 80px 20px;
    max-width: 900px;
    margin: 0 auto;
  }

  .fun-facts-page h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
  }

  .fun-facts-page p.subtitle {
    font-size: 1.2rem;
    color: #6e6e73;
    margin-bottom: 60px;
  }

  .fun-facts-page .stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
  }

  .fun-facts-page .stat-box {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    width: 260px;
    padding: 40px 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

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

  .fun-facts-page .stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: #0071e3;
  }

  .fun-facts-page .stat-label {
    font-size: 1.1rem;
    color: #6e6e73;
    margin-top: 10px;
  }

  .fun-facts-page .footer-note {
    margin-top: 70px;
    font-size: 1rem;
    color: #86868b;
  }

  @media (max-width: 600px) {
    .fun-facts-page h1 {
      font-size: 2rem;
    }
    .fun-facts-page .stat-box {
      width: 100%;
    }
  }