/* ============================================
   ASVAB PAGE (Firestore) - Study Resources
   ============================================ */

:root {
    --black: #000000;
    --dark: #0a0a0a;
    --dark-gray: #1a1a1a;
    --mid-gray: #2a2a2a;
    --light-gray: #888888;
    --white: #ffffff;
    --gold: #c9a962;
}

/* ---------- Space background ----------
   A Space-Force-style deep-field backdrop for the whole page: a near-black
   navy base, two soft nebula glows in gold/steel-blue, and a few layers of
   pure-CSS stars (no images, so nothing to host or load). Fixed so it holds
   still behind all the content as visitors scroll. */
body {
    background-color: #030309;
    background-image:
        radial-gradient(ellipse 900px 600px at 15% 8%, rgba(201, 169, 98, 0.10), transparent 60%),
        radial-gradient(ellipse 800px 700px at 85% 30%, rgba(70, 100, 160, 0.14), transparent 60%),
        radial-gradient(ellipse 700px 500px at 50% 90%, rgba(201, 169, 98, 0.06), transparent 65%),
        linear-gradient(180deg, #030309 0%, #05050d 45%, #030309 100%);
    background-attachment: fixed;
    background-size: cover;
    position: relative;
}

/* Three star layers at different densities/sizes for parallax depth,
   drawn with radial-gradient dots tiled across the viewport. */
body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background-image:
        radial-gradient(1.5px 1.5px at 20px 30px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 90px 80px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 160px 150px, rgba(201,169,98,0.8), transparent),
        radial-gradient(1px 1px at 230px 40px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 300px 200px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 50px 220px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1.5px 1.5px at 340px 60px, rgba(255,255,255,0.7), transparent);
    background-repeat: repeat;
    background-size: 380px 380px;
    animation: twinkle 6s ease-in-out infinite alternate, drift-a 110s linear infinite alternate;
}

body::after {
    background-image:
        radial-gradient(1px 1px at 60px 60px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 190px 120px, rgba(255,255,255,0.35), transparent),
        radial-gradient(1px 1px at 280px 260px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 340px 180px, rgba(201,169,98,0.4), transparent),
        radial-gradient(1px 1px at 110px 300px, rgba(255,255,255,0.3), transparent);
    background-repeat: repeat;
    background-size: 420px 420px;
    animation: twinkle 8s ease-in-out infinite alternate-reverse, drift-b 150s linear infinite alternate;
}

@keyframes twinkle {
    0%   { opacity: 0.5; }
    50%  { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Very slow star drift so the field feels alive without being distracting */
@keyframes drift-a {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-70px, -50px); }
}
@keyframes drift-b {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(50px, 70px); }
}

/* A slow radar-style sweep line across the hero, like a HUD scanning
   the horizon. Purely decorative, sits above the stars, below the text. */
.asvab-hero,
.portal-hero {
    position: relative;
    overflow: hidden;
}

.asvab-hero::before,
.portal-hero::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(201, 169, 98, 0.7), transparent);
    box-shadow: 0 0 14px 1px rgba(201, 169, 98, 0.5);
    animation: scan-sweep 7s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}

@keyframes scan-sweep {
    0%   { top: 0%; opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Faint dashed orbit rings drifting in the hero corners */
.orbit-ring {
    position: absolute;
    border: 1px dashed rgba(201, 169, 98, 0.22);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.orbit-ring-1 {
    width: 380px;
    height: 380px;
    top: -90px;
    right: -110px;
    animation: spin-slow 70s linear infinite;
}

.orbit-ring-2 {
    width: 240px;
    height: 240px;
    bottom: -60px;
    left: -70px;
    animation: spin-slow-rev 90s linear infinite;
    border-color: rgba(120, 150, 210, 0.2);
}

.orbit-ring-1::after,
.orbit-ring-2::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px 2px rgba(201, 169, 98, 0.7);
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes spin-slow-rev {
    from { transform: rotate(360deg); }
    to   { transform: rotate(0deg); }
}

/* Everything else needs to render above the star layers */
.nav, .noise, .asvab-hero, .asvab-main, .study-materials-section,
.modal, .footer {
    position: relative;
    z-index: 1;
}

.hero-content, .portal-hero > * {
    position: relative;
    z-index: 1;
}

/* Blinking status eyebrow tag - "MISSION: ..." style label used above
   headlines throughout the ASVAB page and portal. */
.mission-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.28rem;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 18px;
}

.mission-eyebrow::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px 2px rgba(201, 169, 98, 0.7);
    animation: pulse-dot 1.6s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50%      { opacity: 1; transform: scale(1.2); }
}

/* Word-by-word reveal animation for headlines, driven by a small JS
   helper that wraps each word in a span with a staggered delay. */
.reveal-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(26px);
    filter: blur(4px);
    animation: word-reveal 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes word-reveal {
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hero-subtitle {
    opacity: 0;
    animation: fade-up 0.8s ease forwards;
    animation-delay: 0.65s;
}

.hero-description {
    opacity: 0;
    animation: fade-up 0.8s ease forwards;
    animation-delay: 0.9s;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    body::before, body::after,
    .asvab-hero::before, .portal-hero::before,
    .orbit-ring, .orbit-ring-1, .orbit-ring-2,
    .reveal-word, .hero-subtitle, .hero-description {
        animation: none !important;
        opacity: 1 !important;
        filter: none !important;
        transform: none !important;
    }
}

/* Hero Section */
.asvab-hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 40px 80px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 300;
    letter-spacing: 0.3rem;
    margin-bottom: 20px;
    color: var(--white);
}

.hero-subtitle {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.3rem;
    color: var(--gold);
    margin-bottom: 30px;
}

.hero-description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--light-gray);
}

/* Main CTA Section */
.asvab-main {
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.cta-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.cta-card {
    position: relative;
    background: rgba(26, 26, 26, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--mid-gray);
    padding: 50px 40px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(201, 169, 98, 0.04);
}

.cta-card:hover {
    border-color: var(--gold);
    transform: translateY(-5px);
    box-shadow: 0 0 50px rgba(201, 169, 98, 0.12);
}

/* HUD-style targeting-reticle corners on the two main cards + each
   material card - subtle at rest, brighten on hover. */
.cta-card::before, .cta-card::after,
.material-card::before, .material-card::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--gold);
    opacity: 0.5;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.cta-card::before, .material-card::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}
.cta-card::after, .material-card::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}
.cta-card:hover::before, .cta-card:hover::after,
.material-card:hover::before, .material-card:hover::after {
    opacity: 1;
}

.cta-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.cta-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 0.2rem;
    color: var(--white);
    margin-bottom: 15px;
}

.cta-description {
    font-size: 1rem;
    color: var(--light-gray);
    margin-bottom: 30px;
    line-height: 1.6;
}

.resource-preview {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--mid-gray);
    padding: 25px;
    margin-bottom: 30px;
    flex-grow: 1;
    text-align: left;
}

.resource-preview h4 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.15rem;
    color: var(--gold);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.resource-list {
    list-style: none;
}

.resource-list li {
    font-size: 0.85rem;
    color: var(--light-gray);
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
}

.resource-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--gold);
}

.cta-btn {
    position: relative;
    overflow: hidden;
    padding: 18px 30px;
    background: var(--gold);
    color: var(--black);
    border: 1px solid var(--gold);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.cta-btn:hover {
    background: transparent;
    color: var(--gold);
}

.cta-btn::after, .submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
}
.cta-btn:hover::after, .submit-btn:hover::after {
    left: 130%;
}

.cta-note {
    font-size: 0.75rem;
    color: var(--light-gray);
    letter-spacing: 0.1rem;
}

/* Study Materials Section */
.study-materials-section {
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 0.2rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 40px;
    text-transform: uppercase;
}

/* Material Filters */
.materials-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.material-filter {
    padding: 10px 25px;
    background: transparent;
    border: 1px solid var(--mid-gray);
    color: var(--light-gray);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.material-filter:hover,
.material-filter.active {
    border-color: var(--gold);
    color: var(--gold);
}

/* Materials Grid */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.material-card {
    position: relative;
    background: var(--dark-gray);
    border: 1px solid var(--mid-gray);
    padding: 30px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.material-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
}

.material-header {
    margin-bottom: 20px;
}

.material-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.15rem;
    color: var(--white);
    margin-bottom: 10px;
}

.material-category {
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
    color: var(--gold);
    text-transform: uppercase;
}

.material-content {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--light-gray);
    margin-bottom: 20px;
    flex-grow: 1;
}

.material-link {
    display: inline-block;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.material-link:hover {
    background: var(--gold);
    color: var(--black);
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--light-gray);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--mid-gray);
    padding: 50px;
    max-width: 500px;
    width: 100%;
    position: relative;
    max-height: 88vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--mid-gray);
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 30px;
    color: var(--white);
}

/* Form */
.signup-form {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.1rem;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background: var(--black);
    border: 1px solid var(--mid-gray);
    color: var(--white);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
}

.subject-check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.subject-check-grid.all-selected label:not(.subject-check-all) {
    opacity: 0.35;
    pointer-events: none;
}

.subject-check {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--mid-gray);
    padding: 10px 12px;
    font-size: 0.78rem;
    color: var(--light-gray);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.subject-check:has(input:checked) {
    border-color: var(--gold);
    color: var(--gold);
}

.subject-check input {
    width: auto;
    accent-color: var(--gold);
}

.subject-check-all {
    grid-column: 1 / -1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    font-size: 0.7rem;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--gold);
    color: var(--black);
    border: 1px solid var(--gold);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background: transparent;
    color: var(--gold);
}

/* Success State */
.success-state {
    display: none;
    text-align: center;
    padding: 30px 0;
}

.success-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: var(--gold);
    color: var(--black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
}

.success-state h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.2rem;
    color: var(--white);
    margin-bottom: 12px;
}

.success-state p {
    font-size: 0.9rem;
    color: var(--light-gray);
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
    .cta-container {
        gap: 30px;
    }

    .cta-card {
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    .asvab-hero {
        padding: 100px 20px 60px;
        min-height: 50vh;
    }

    .hero-title {
        font-size: 2.5rem;
        letter-spacing: 0.2rem;
    }

    .asvab-main {
        padding: 60px 20px;
    }

    .cta-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .cta-card {
        padding: 30px 20px;
    }

    .cta-icon {
        font-size: 3rem;
    }

    .cta-title {
        font-size: 1.1rem;
    }

    .study-materials-section {
        padding: 60px 20px;
    }

    .materials-grid {
        grid-template-columns: 1fr;
    }

    .material-filter {
        padding: 8px 15px;
        font-size: 0.65rem;
    }

    .modal-content {
        padding: 40px 25px;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .subject-check-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .cta-title {
        font-size: 1rem;
    }

    .resource-preview h4 {
        font-size: 0.8rem;
    }

    .resource-list li {
        font-size: 0.8rem;
    }
}
