/**
 * Fresh Quiz Filter - Frontend Quiz CSS
 * Stitch Design - Blauberg Inspired
 */

:root {
    /* Blauberg Brand Colors */
    --fqf-primary: #E30613;
    /* Blauberg Red */
    --fqf-primary-hover: #c70510;
    --fqf-navy: #004A99;
    /* Blauberg Navy Blue */
    --fqf-navy-light: #0066cc;
    --fqf-success: #10b981;
    --fqf-text: #1e293b;
    --fqf-text-muted: #64748b;
    --fqf-bg: #ffffff;
    --fqf-bg-light: #F4F7FA;
    --fqf-border: #e2e8f0;
    --fqf-radius: 12px;
    --fqf-radius-sm: 8px;
    --fqf-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Modal */
.fqf-quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

.fqf-quiz-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.fqf-quiz-container {
    position: relative;
    width: 100%;
    max-width: 672px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--fqf-bg);
    border-radius: var(--fqf-radius);
    box-shadow: var(--fqf-shadow);
    animation: fqf-modal-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fqf-modal-in {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

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

/* Progress Bar */
.fqf-quiz-progress {
    position: relative;
    margin-bottom: 0;
}

.fqf-progress-bar {
    height: 6px;
    background: #f1f5f9;
    overflow: hidden;
    margin-bottom: 0;
    border-radius: var(--fqf-radius) var(--fqf-radius) 0 0;
}

.fqf-progress-fill {
    height: 100%;
    background: var(--fqf-navy);
    transition: width 0.5s ease;
}

.fqf-progress-steps {
    display: none;
}

/* Close button */
.fqf-quiz-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: all 0.2s ease;
    z-index: 10;
}

.fqf-quiz-close:hover {
    color: #4b5563;
}

/* Content */
.fqf-quiz-content {
    padding: 48px;
}

/* Header */
.fqf-quiz-header {
    text-align: center;
    margin-bottom: 40px;
}

.fqf-quiz-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(227, 6, 19, 0.08);
    border-radius: 50%;
    margin-bottom: 16px;
    font-size: 36px;
}

.fqf-quiz-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--fqf-navy);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin: 0 0 8px 0;
}

.fqf-quiz-subtitle {
    font-size: 16px;
    color: var(--fqf-text-muted);
    margin: 0;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Question */
.fqf-quiz-step {
    display: none;
    animation: fqf-step-in 0.4s ease;
}

.fqf-quiz-step.active {
    display: block;
}

@keyframes fqf-step-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

.fqf-question-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fqf-navy);
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fqf-question-icon {
    font-size: 24px;
    color: var(--fqf-navy);
}

/* Answers Grid - PC (2 columns) */
.fqf-quiz-step .fqf-answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

/* Answer Option Card */
.fqf-answer-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 24px;
    background: rgba(248, 250, 252, 0.5);
    border: 2px solid #f1f5f9;
    border-radius: var(--fqf-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.fqf-answer-option:hover {
    border-color: var(--fqf-navy);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 74, 153, 0.1);
}

.fqf-answer-option.selected {
    border-color: var(--fqf-primary);
    background: rgba(227, 6, 19, 0.04);
}

.fqf-answer-icon-wrapper {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: var(--fqf-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.fqf-answer-option:hover .fqf-answer-icon-wrapper {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.fqf-answer-icon {
    font-size: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fqf-answer-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.fqf-answer-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--fqf-navy);
    transition: color 0.2s ease;
}

.fqf-answer-option:hover .fqf-answer-text {
    color: var(--fqf-primary);
}

.fqf-answer-desc {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Navigation */
.fqf-quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

.fqf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fqf-btn-primary {
    background: var(--fqf-primary);
    color: white;
    box-shadow: 0 8px 16px rgba(227, 6, 19, 0.2);
}

.fqf-btn-primary:hover {
    background: var(--fqf-primary-hover);
    transform: translateY(-1px);
}

.fqf-btn-outline,
.fqf-skip-btn {
    background: transparent;
    color: var(--fqf-text-muted);
    border: 1px solid transparent;
    padding: 12px 24px;
    font-weight: 500;
    text-transform: none;
}

.fqf-btn-outline:hover,
.fqf-skip-btn:hover {
    color: var(--fqf-navy);
    border-color: #e5e7eb;
}

/* Results */
.fqf-results-loading {
    text-align: center;
    padding: 48px 0;
}

.fqf-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f1f5f9;
    border-top-color: var(--fqf-navy);
    border-radius: 50%;
    animation: fqf-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes fqf-spin {
    to {
        transform: rotate(360deg);
    }
}

.fqf-results-loading p {
    color: var(--fqf-text-muted);
    margin: 0;
}

.fqf-results-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fqf-navy);
    text-align: center;
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.fqf-results-icon {
    font-size: 28px;
}

.fqf-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.fqf-product-result {
    background: var(--fqf-bg-light);
    border-radius: var(--fqf-radius-sm);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.fqf-product-result:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.fqf-product-result img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.fqf-product-result .fqf-product-info {
    padding: 12px;
}

.fqf-product-result .fqf-product-name {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px 0;
    color: var(--fqf-navy);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fqf-product-result .fqf-product-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--fqf-primary);
}

.fqf-results-empty {
    text-align: center;
    padding: 48px 0;
}

.fqf-results-empty .fqf-empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}

.fqf-results-empty p {
    color: var(--fqf-text-muted);
    margin: 0 0 24px 0;
}

/* ============================================
   TABLET RESPONSIVE (768px - 1024px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .fqf-quiz-container {
        width: 90%;
        max-width: 820px;
    }

    .fqf-quiz-content {
        padding: 56px;
    }

    .fqf-quiz-icon {
        width: 80px;
        height: 80px;
        font-size: 48px;
    }

    .fqf-quiz-title {
        font-size: 32px;
        margin-bottom: 16px;
    }

    .fqf-quiz-subtitle {
        font-size: 18px;
        max-width: 500px;
    }

    .fqf-question-title {
        font-size: 24px;
        justify-content: center;
        text-align: center;
        margin-bottom: 40px;
    }

    .fqf-quiz-step .fqf-answers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        margin-bottom: 48px;
    }

    .fqf-answer-option {
        padding: 32px;
    }

    .fqf-answer-icon-wrapper {
        width: 128px;
        height: 128px;
        margin-bottom: 8px;
    }

    .fqf-answer-icon {
        font-size: 64px;
    }

    .fqf-answer-icon img {
        width: 96px;
        height: 96px;
    }

    .fqf-answer-text {
        font-size: 18px;
        font-weight: 700;
    }

    .fqf-answer-desc {
        font-size: 14px;
    }

    .fqf-quiz-nav {
        justify-content: flex-end;
        gap: 16px;
        padding-top: 32px;
    }

    .fqf-btn {
        padding: 14px 32px;
        font-size: 16px;
    }
}

/* ============================================
   MOBILE RESPONSIVE (< 768px)
   ============================================ */
@media (max-width: 767px) {
    .fqf-quiz-modal {
        padding: 0;
        align-items: flex-end;
    }

    .fqf-quiz-container {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
    }

    .fqf-progress-bar {
        height: 4px;
        border-radius: 16px 16px 0 0;
    }

    .fqf-quiz-content {
        padding: 24px;
        display: flex;
        flex-direction: column;
        min-height: calc(92vh - 4px);
    }

    .fqf-quiz-header {
        margin-bottom: 24px;
        padding-top: 8px;
    }

    .fqf-quiz-icon {
        width: 48px;
        height: 48px;
        font-size: 28px;
        margin-bottom: 12px;
    }

    .fqf-quiz-title {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .fqf-quiz-subtitle {
        font-size: 14px;
    }

    .fqf-question-title {
        font-size: 16px;
        margin-bottom: 16px;
    }

    /* Mobile: Single column list style */
    .fqf-quiz-step .fqf-answers-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        flex: 1;
        margin-bottom: 0;
    }

    .fqf-answer-option {
        flex-direction: row;
        text-align: left;
        padding: 16px;
        gap: 16px;
        align-items: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    }

    .fqf-answer-option.selected {
        border-color: var(--fqf-navy);
        background: rgba(0, 74, 153, 0.04);
        box-shadow: 0 0 0 1px var(--fqf-navy);
    }

    .fqf-answer-icon-wrapper {
        width: 64px;
        height: 64px;
        flex-shrink: 0;
        background: #f9fafb;
    }

    .fqf-answer-icon {
        font-size: 32px;
    }

    .fqf-answer-icon img {
        width: 48px;
        height: 48px;
    }

    .fqf-answer-content {
        flex: 1;
    }

    .fqf-answer-text {
        font-size: 15px;
        display: block;
    }

    .fqf-answer-desc {
        margin-top: 4px;
    }

    /* Mobile Navigation - Stacked buttons */
    .fqf-quiz-nav {
        flex-direction: column;
        gap: 12px;
        padding-top: 24px;
        margin-top: auto;
        border-top: none;
        background: #fff;
    }

    .fqf-btn-primary {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
        border-radius: var(--fqf-radius);
        font-size: 14px;
        order: 1;
    }

    .fqf-skip-btn,
    .fqf-prev-btn {
        width: 100%;
        justify-content: center;
        order: 2;
        padding: 8px;
    }

    .fqf-prev-btn {
        display: none !important;
    }
}