/* Archetype Quiz - App-Specific Styles
   Base styles (buttons, cards, spinner, form-status) are in styles.css
   This file contains only quiz-specific layouts and components */

/* ============================================================================
   Page Sections - Quiz-specific containers
   ============================================================================ */

.quiz-landing,
.quiz-results {
    padding: 4rem 2rem;
    min-height: 70vh;
}

.quiz-interface {
    padding: 2rem 1rem;
    min-height: 80vh;
}

.quiz-interface .container {
    max-width: 1100px;
}

.auth-verify {
    padding: 4rem 2rem;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Override section background - quiz pages use light theme */
.quiz-landing,
.quiz-interface,
.quiz-results,
.auth-verify {
    background-color: var(--background-color) !important;
    color: var(--text-color) !important;
}

/* Make nav non-fixed on quiz interface page */
body:has(.quiz-interface) nav {
    position: static;
}

body:has(.quiz-interface) .quiz-interface {
    padding-top: 2rem;
}

/* Light footer on quiz pages */
body:has(.quiz-landing) footer,
body:has(.quiz-interface) footer,
body:has(.quiz-results) footer,
body:has(.auth-verify) footer {
    background-color: var(--background-color);
    color: var(--text-color);
}

body:has(.quiz-landing) footer .copyright,
body:has(.quiz-interface) footer .copyright,
body:has(.quiz-results) footer .copyright,
body:has(.auth-verify) footer .copyright {
    color: #666;
}

/* ============================================================================
   Landing Page
   ============================================================================ */

.quiz-landing h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.quiz-intro > p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 2rem;
}

.quiz-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.detail-item {
    text-align: center;
}

.detail-item strong {
    display: block;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.detail-item span {
    color: #666;
    font-size: 0.9rem;
}

/* Auth Section Card */
.auth-section {
    background: var(--card-background);
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.auth-section > p {
    color: #666;
    margin-bottom: 2rem;
}

/* Page Loading State */
.page-loading {
    text-align: center;
    padding: 4rem 0;
}

.page-loading p {
    margin-top: 1rem;
    color: #666;
}

/* Email Form */
.email-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.email-form input[type="email"] {
    padding: 1rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
}

.email-form input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================================================
   Auth Verification Page
   ============================================================================ */

.auth-status {
    text-align: center;
    max-width: 400px;
}

.auth-status p {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: #555;
}

/* ============================================================================
   Quiz Interface - Progress Bar
   ============================================================================ */

.quiz-progress {
    margin-top: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* ============================================================================
   Quiz Interface - Question Display
   ============================================================================ */

.quiz-question {
    text-align: center;
}

.question-prompt {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: #333;
}

/* Instructions View */
.instructions {
    text-align: center;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.instructions h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.instructions p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 1.5rem;
    text-align: left;
}

/* Image Pair Display */
.image-pair-container {
    margin: 2rem 0;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
}

.image-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: #f5f5f5;
    border-radius: 8px;
}

.image-wrapper {
    position: relative;
    min-height: 300px;
}

.image-wrapper .image-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.image-wrapper .image-loading.hidden {
    display: none;
}

.image-wrapper .quiz-image {
    display: block;
}

.image-wrapper .quiz-image.hidden {
    display: none;
}

.quiz-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.quiz-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.quiz-image:active {
    transform: scale(0.98);
}

.quiz-image.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Loading Spinner Container */
.loading-spinner {
    text-align: center;
}

.loading-spinner p {
    margin-top: 1rem;
    color: #666;
}

/* ============================================================================
   Results Page
   ============================================================================ */

.quiz-results h1 {
    text-align: center;
    margin-bottom: 3rem;
}

.results-loading {
    text-align: center;
    padding: 3rem 0;
}

.results-loading p {
    margin-top: 1.5rem;
    color: #666;
}

.results-content {
    margin-bottom: 3rem;
}

.results-content h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.75rem;
    font-weight: normal;
    color: #555;
}

/* Layer Result Cards */
.layer-result {
    background: var(--card-background);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.layer-result h3 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.archetype-item {
    margin-bottom: 1.5rem;
}

.archetype-item:last-child {
    margin-bottom: 0;
}

.archetype-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.archetype-description {
    color: #555;
    line-height: 1.6;
}

.no-preference {
    color: #666;
    font-style: italic;
    line-height: 1.6;
}

/* Channel Promotion Card */
.channel-promotion {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-color);
}

.channel-promotion p {
    color: #333;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.channel-promotion .cta-button {
    display: inline-block;
    margin-top: 0.5rem;
}

.results-actions {
    text-align: center;
    margin-top: 3rem;
}

/* Error text */
.error {
    color: #721c24;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    .quiz-landing,
    .quiz-results {
        padding: 2rem 1rem;
    }

    .quiz-details {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .image-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .image-pair-container {
        min-height: auto;
    }

    .layer-result {
        padding: 1.5rem;
    }
}

/* Hide nav bar on touch devices in landscape (phones/tablets) for quiz interface */
@media (orientation: landscape) and (pointer: coarse) and (hover: none) {
    body:has(.quiz-interface) nav {
        display: none;
    }

    body:has(.quiz-interface) .quiz-interface {
        padding-top: 1rem;
    }
}
