/**
 * FictionFlock Quiz Styles
 */

/* ================================
   Quiz Container
   ================================ */
.ff-quiz-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ================================
   Quiz Start Screen
   ================================ */
.ff-quiz-start {
    text-align: center;
}

.ff-quiz-cover {
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(30, 58, 95, 0.15);
}

.ff-quiz-cover img {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.ff-quiz-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 32px;
    font-weight: 700;
    color: #1E3A5F;
    margin: 0 0 16px;
    line-height: 1.2;
}

.ff-quiz-description {
    font-size: 18px;
    color: #4A4A4A;
    margin: 0 0 24px;
    line-height: 1.6;
}

.ff-quiz-reward {
    margin-bottom: 24px;
}

.ff-feathers-badge {
    display: inline-block;
    background: linear-gradient(135deg, #F4A259, #E85D4C);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
}

.ff-quiz-start-btn {
    font-size: 18px;
    padding: 16px 48px;
}

.ff-quiz-login-prompt {
    margin-bottom: 12px;
}

.ff-quiz-login-note {
    font-size: 14px;
    color: #717171;
}

/* ================================
   Quiz Progress Bar
   ================================ */
.ff-quiz-progress {
    margin-bottom: 32px;
}

.ff-quiz-progress-bar {
    height: 8px;
    background: #E8E8E8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ff-quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2D6A6A, #E85D4C);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

.ff-quiz-progress-text {
    font-size: 14px;
    color: #717171;
    text-align: center;
    display: block;
}

/* ================================
   Quiz Questions
   ================================ */
.ff-quiz-question {
    text-align: center;
}

.ff-quiz-question-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    color: #1E3A5F;
    margin: 0 0 32px;
    line-height: 1.3;
}

.ff-quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ff-quiz-answer {
    background: white;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #4A4A4A;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.ff-quiz-answer:hover {
    border-color: #2D6A6A;
    background: #F8F9FA;
    transform: translateY(-2px);
}

.ff-quiz-answer.selected {
    border-color: #E85D4C;
    background: #FFF5F4;
    color: #1E3A5F;
}

.ff-quiz-answer:focus {
    outline: none;
    border-color: #2D6A6A;
    box-shadow: 0 0 0 3px rgba(45, 106, 106, 0.2);
}

/* ================================
   Quiz Complete / See Result
   ================================ */
.ff-quiz-complete {
    text-align: center;
    padding: 40px 20px;
}

.ff-quiz-complete h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    color: #1E3A5F;
    margin: 0 0 12px;
}

.ff-quiz-complete p {
    font-size: 18px;
    color: #717171;
    margin: 0 0 24px;
}

.ff-see-result-btn {
    font-size: 18px;
    padding: 16px 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(232, 93, 76, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(232, 93, 76, 0);
    }
}

/* ================================
   Quiz Result Screen
   ================================ */
.ff-quiz-result {
    text-align: center;
}

.ff-result-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 32px;
    font-weight: 700;
    color: #1E3A5F;
    margin: 0 0 24px;
}

.ff-result-image {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(30, 58, 95, 0.15);
    margin-bottom: 24px;
}

.ff-result-book-cover {
    max-width: 200px;
}

.ff-result-description {
    font-size: 18px;
    color: #4A4A4A;
    line-height: 1.6;
    margin: 0 0 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.ff-result-book-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    color: #1E3A5F;
    margin: 0 0 8px;
}

.ff-result-book-author {
    font-size: 16px;
    color: #717171;
    margin: 0 0 16px;
}

.ff-result-book-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #E8E8E8;
}

.ff-result-book-from {
    font-size: 16px;
    color: #4A4A4A;
    margin: 0 0 16px;
}

.ff-result-book-recommendation {
    margin-top: 24px;
    padding: 20px;
    background: #F8F5F1;
    border-radius: 12px;
}

.ff-result-book-recommendation p {
    margin: 0 0 12px;
    font-size: 14px;
    color: #717171;
}

.ff-result-book-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1E3A5F;
    font-weight: 600;
}

.ff-result-book-link img {
    width: 50px;
    height: auto;
    border-radius: 4px;
}

/* ================================
   Feathers Earned
   ================================ */
.ff-quiz-feathers-earned {
    margin: 32px 0;
    padding: 20px;
    background: linear-gradient(135deg, #FFF9F0, #FFF5F4);
    border-radius: 12px;
}

.ff-feathers-earned-badge {
    font-size: 20px;
    padding: 12px 28px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.ff-quiz-already-completed {
    margin: 24px 0;
    padding: 16px;
    background: #F8F9FA;
    border-radius: 8px;
}

.ff-quiz-already-completed p {
    margin: 0;
    font-size: 14px;
    color: #717171;
}

/* ================================
   Result Actions
   ================================ */
.ff-quiz-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* ================================
   Quiz Listing / Grid
   ================================ */
.ff-quiz-listing {
    padding: 20px 0;
}

.ff-quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.ff-quiz-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ff-quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.12);
}

.ff-quiz-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ff-quiz-card-cover {
    aspect-ratio: 16/9;
    background: #F8F5F1;
    overflow: hidden;
}

.ff-quiz-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ff-quiz-card-no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #717171;
}

.ff-quiz-card-content {
    padding: 16px;
}

.ff-quiz-card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: #1E3A5F;
    margin: 0 0 12px;
    line-height: 1.3;
}

.ff-quiz-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ff-quiz-type-badge {
    display: inline-block;
    background: #E8E8E8;
    color: #4A4A4A;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ff-quiz-genre {
    font-size: 12px;
    color: #717171;
}

.ff-quiz-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #F0F0F0;
}

.ff-quiz-feathers {
    font-size: 14px;
    font-weight: 600;
    color: #F4A259;
}

.ff-quiz-completions {
    font-size: 12px;
    color: #717171;
}

.ff-no-quizzes {
    text-align: center;
    color: #717171;
    padding: 40px 20px;
}

/* ================================
   Loading State
   ================================ */
.ff-quiz-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ff-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E8E8E8;
    border-top-color: #E85D4C;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ff-quiz-loading p {
    margin-top: 16px;
    color: #717171;
}

/* ================================
   Buttons (matching brand)
   ================================ */
.ff-btn {
    display: inline-block;
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 600;
    font-size: 16px;
    padding: 12px 28px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
}

.ff-btn-primary {
    background: #E85D4C;
    color: white;
}

.ff-btn-primary:hover {
    background: #D64D3C;
    transform: translateY(-1px);
    color: white;
}

.ff-btn-secondary {
    background: transparent;
    color: #2D6A6A;
    border: 2px solid #2D6A6A;
}

.ff-btn-secondary:hover {
    background: #2D6A6A;
    color: white;
}

.ff-btn-ghost {
    background: transparent;
    color: #1E3A5F;
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: 12px 16px;
}

.ff-btn-ghost:hover {
    color: #E85D4C;
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 600px) {
    .ff-quiz-container {
        padding: 16px;
    }
    
    .ff-quiz-title {
        font-size: 26px;
    }
    
    .ff-quiz-question-text {
        font-size: 22px;
    }
    
    .ff-quiz-answer {
        padding: 16px 20px;
    }
    
    .ff-result-heading {
        font-size: 26px;
    }
    
    .ff-quiz-grid {
        grid-template-columns: 1fr;
    }
    
    .ff-quiz-result-actions {
        flex-direction: column;
    }
    
    .ff-quiz-result-actions .ff-btn {
        width: 100%;
    }
}

/* ================================
   Email Gate Styles
   ================================ */

.ff-quiz-email-gate {
    max-width: 500px;
    margin: 0 auto;
    padding: var(--ff-space-xl);
}

.ff-email-gate-content {
    background: var(--ff-white);
    border-radius: var(--ff-radius-lg);
    padding: var(--ff-space-2xl);
    text-align: center;
    box-shadow: var(--ff-shadow-md);
}

.ff-email-gate-content h2 {
    font-family: var(--ff-font-display);
    font-size: var(--ff-text-2xl);
    color: var(--ff-text-dark);
    margin: 0 0 var(--ff-space-sm);
}

.ff-email-gate-content > p {
    color: var(--ff-text-muted);
    margin: 0 0 var(--ff-space-xl);
}

.ff-email-gate-form {
    text-align: left;
}

.ff-email-gate-form .ff-form-group {
    margin-bottom: var(--ff-space-md);
}

.ff-email-gate-form .ff-input {
    width: 100%;
    padding: var(--ff-space-sm) var(--ff-space-md);
    border: 2px solid var(--ff-linen);
    border-radius: var(--ff-radius-md);
    font-size: var(--ff-text-base);
    transition: border-color var(--ff-transition-fast);
}

.ff-email-gate-form .ff-input:focus {
    outline: none;
    border-color: var(--ff-teal);
}

.ff-email-gate-form .ff-checkbox-group {
    margin-top: var(--ff-space-lg);
    margin-bottom: var(--ff-space-lg);
}

.ff-email-gate-form .ff-checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: var(--ff-space-sm);
    cursor: pointer;
    font-size: var(--ff-text-sm);
    color: var(--ff-text-medium);
}

.ff-email-gate-form .ff-checkbox-group input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.ff-btn-full {
    width: 100%;
}

.ff-email-gate-note {
    font-size: var(--ff-text-xs);
    color: var(--ff-text-muted);
    margin: var(--ff-space-md) 0 0;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .ff-quiz-email-gate {
        padding: var(--ff-space-md);
    }
    
    .ff-email-gate-content {
        padding: var(--ff-space-lg);
    }
    
    .ff-email-gate-content h2 {
        font-size: var(--ff-text-xl);
    }
}