/* Quiz Specific Styles */

/* Inherits variables from style.css */

.quiz-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    text-align: center;
    z-index: 1;
    position: relative;

    /* Centering Logic */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* Safety Zone for Back Button */
    padding-top: 100px;
    padding-bottom: 4rem;
    margin: 0 auto;
    /* Horizontal centering of the container itself */
}

/* Back Button */
.back-btn {
    position: fixed;
    top: 1.5rem;
    /* Consistent with Contact page */
    left: 1.5rem;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    z-index: 1000;
    /* High z-index to stay on top */
    font-size: 1.2rem;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Sections */
.quiz-section {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.quiz-section.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Intro Content */
.intro-content {
    max-width: 600px;
    margin: 0 auto;
}

/* ... existing styles ... */

/* Results */
.loading-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem 0;
    width: 100%;
}

.intro-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

/* Buttons */
.primary-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    backdrop-filter: blur(5px);
    margin-top: 1rem;
}

.primary-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.secondary-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.secondary-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

.text-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 2rem;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.text-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.full-width {
    width: 100%;
    text-align: center;
}

/* Progress Bar - Monochromatic */
.progress-container {
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
    width: 100%;
    /* Ensure full width in flex container */
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    /* Monochromatic white/grey */
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.step-counter {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-recommendation h2 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: white;
    text-align: center;
    margin-top: 1rem;
}

/* Results Header specific fix */
#quiz-results header {
    margin-top: 6rem;
    /* Safely clear back button */
}

/* Questions */
.question-container h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 400;
    font-family: var(--font-serif);
}

.question-explanation {
    margin-bottom: 3rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.option-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
}

.option-card:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.option-card.selected {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.option-text {
    font-size: 1.05rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
}

/* Results */
.loading-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem 0;
    width: 100%;
}

/* Results Accordion */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.result-card {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    text-align: left;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.result-card:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.result-card.static-card {
    cursor: default;
    background-color: rgba(255, 255, 255, 0.08);
    /* Always looks active/expanded */
}

.result-card.static-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    /* Reset hover border for static */
}

/* Expanded State */
.result-card.expanded {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: default;
}

/* Header Section of Card */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    transition: margin-bottom 0.3s ease;
}

.result-card.expanded .card-header {
    margin-bottom: 1.5rem;
    flex-direction: column;
    text-align: center;
}

.card-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    display: block;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 400;
    color: white;
    font-family: var(--font-serif);
    transition: font-size 0.3s ease;
}

.result-card.expanded .card-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.expand-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.result-card.expanded .expand-icon {
    display: none;
}

/* Content Section (Hidden when collapsed) */
.card-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.result-card.expanded .card-content {
    max-height: 1000px;
    /* Arbitrary large height */
    opacity: 1;
}

.telescope-description {
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-weight: 300;
}

.telescope-description p {
    margin-bottom: 1rem;
}

/* Email Capture */
.email-capture {
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.email-capture h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.email-capture p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
}

.email-capture form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.email-capture .form-group {
    flex: 1;
}

/* Match Contact Page Input Style */
.email-capture .form-input {
    width: 100%;
    padding: 1rem 1.2rem;
    background-color: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.email-capture .form-input:focus {
    outline: none;
    background-color: var(--btn-hover-bg);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Match Contact Page Button Style */
.email-capture .submit-btn {
    padding: 1rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    margin-top: 0;
    white-space: nowrap;
}

.email-capture .submit-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

#restart-quiz-btn {
    margin-bottom: 4rem;
    /* Add space for footer */
}

/* Responsive */
@media (max-width: 768px) {
    .alternatives-grid {
        grid-template-columns: 1fr;
    }

    .email-capture form {
        flex-direction: column;
    }

    .quiz-container {
        padding: 1.5rem;
        margin-top: -5vh;
    }

    .question-container h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .main-recommendation {
        padding: 1.5rem;
    }

    .main-recommendation h2 {
        font-size: 1.8rem;
    }

    .primary-btn {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }
}