/**
 * Flavor Finder Quiz Styles
 *
 * Responsive, mobile-first styling for the quiz interface
 * Optimized for Core Web Vitals and user experience
 *
 * @author    Eliquid Depot
 * @copyright 2025 Eliquid Depot
 */

/* ====================================
   Container & Layout
   ==================================== */

.flavorfinder-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.flavorfinder-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #3e3e3e;
    margin-bottom: 30px;
}

.flavorfinder-icon {
    display: inline-block;
    font-size: 2.8rem;
    margin-right: 10px;
}

/* ====================================
   Quiz Introduction
   ==================================== */

.flavorfinder-intro {
    border-radius: 12px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.intro-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.intro-description {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.intro-benefits {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.benefit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.benefit-icon {
    font-size: 2rem;
}

.benefit-item span:last-child {
    font-size: 0.95rem;
    font-weight: 600;
}

.start-quiz-btn {
    font-size: 1.25rem;
    padding: 15px 40px;
    background: #FB9B50;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(251, 155, 80, 0.5);
    background: #ff8c3a;
}

.intro-links {
    margin-top: 30px;
    font-size: 0.95rem;
    opacity: 0.9;
}

.intro-links a {
    color: #FB9B50;
    text-decoration: underline;
    font-weight: 600;
}

.intro-links a:hover {
    opacity: 0.8;
}

/* ====================================
   Quiz Form
   ==================================== */

.flavorfinder-quiz {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.quiz-progress {
    margin-bottom: 40px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #FB9B50;
    transition: width 0.4s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
}

/* ====================================
   Quiz Steps
   ==================================== */

.quiz-step {
    display: none;
}

.quiz-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.step-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #3e3e3e;
    margin-bottom: 10px;
    line-height: 1.3;
}

.step-subtitle {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 30px;
}

/* ====================================
   Options Grid
   ==================================== */

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.option-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.option-card input[type="checkbox"],
.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 80px;
}

.option-card:hover .option-content {
    border-color: #FB9B50;
    background: #fff5ef;
}

.option-card input:checked ~ .option-content {
    background: #FB9B50;
    border-color: #FB9B50;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(251, 155, 80, 0.3);
}

.option-label {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

/* ====================================
   Step Actions
   ==================================== */

.step-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.step-actions .btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #FB9B50;
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(251, 155, 80, 0.4);
    background: #ff8c3a;
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
}

/* ====================================
   Loading State
   ==================================== */

.flavorfinder-loading {
    text-align: center;
    padding: 80px 40px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 30px;
    border: 5px solid #e9ecef;
    border-top-color: #FB9B50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.flavorfinder-loading h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #3e3e3e;
    margin-bottom: 10px;
}

.flavorfinder-loading p {
    font-size: 1.125rem;
    color: #6c757d;
}

/* ====================================
   Results Section
   ==================================== */

.flavorfinder-results {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #3e3e3e;
    margin-bottom: 15px;
}

.results-subtitle {
    font-size: 1.125rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.retake-btn {
    padding: 10px 25px;
    background: #e9ecef;
    color: #495057;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.retake-btn:hover {
    background: #dee2e6;
}

/* ====================================
   Products Grid
   ==================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.show-more-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 40px;
}

.show-more-container .btn {
    min-width: 250px;
}

.product-card {
    position: relative;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.match-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    z-index: 10;
    color: #fff;
}

.perfect-match {
    background: #28a745;
}

.great-match {
    background: #17a2b8;
}

.good-match {
    background: #ffc107;
    color: #333;
}

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #3e3e3e;
    margin-bottom: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #3e3e3e;
    display: block;
    margin-bottom: 10px;
}

.regular-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 1rem;
    margin-right: 8px;
}

.sale-price {
    color: #dc3545;
}

.product-description {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-actions {
    padding: 0 20px 20px;
}

.view-product-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #FB9B50;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: transform 0.2s;
}

.view-product-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(251, 155, 80, 0.4);
    background: #ff8c3a;
}

/* ====================================
   Empty Results
   ==================================== */

.results-empty {
    text-align: center;
    padding: 60px 40px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 40px;
}

.results-empty h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #3e3e3e;
    margin-bottom: 15px;
}

.results-empty p {
    font-size: 1.125rem;
    color: #6c757d;
    line-height: 1.7;
    margin-bottom: 25px;
}

.results-empty a {
    color: #FB9B50;
    font-weight: 600;
    text-decoration: underline;
}

/* ====================================
   SEO Content Section
   ==================================== */

.results-seo-content {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 10px;
    margin-top: 40px;
}

.results-seo-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3e3e3e;
    margin-bottom: 20px;
}

.results-seo-content p {
    font-size: 1rem;
    color: #495057;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* ====================================
   Home Widget Styles
   ==================================== */

.flavorfinder-home-widget {
    margin: 40px 0;
    padding: 40px;
    background: #3e3e3e;
    border-radius: 12px;
    color: #fff;
}

.widget-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.widget-content {
    flex: 1;
}

.widget-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.widget-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.widget-description {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 25px;
}

.widget-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #FB9B50;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    transition: transform 0.2s;
}

.widget-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(251, 155, 80, 0.5);
    background: #ff8c3a;
}

.widget-image {
    flex-shrink: 0;
}

/* ====================================
   Navigation Link Styles
   ==================================== */

.flavorfinder-nav-item {
    display: inline-block;
}

.flavorfinder-nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.flavorfinder-nav-link:hover {
    color: #FB9B50;
}

.nav-link-icon {
    font-size: 1.2rem;
}

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

@media (max-width: 768px) {
    .flavorfinder-title {
        font-size: 1.875rem;
    }

    .flavorfinder-intro {
        padding: 40px 25px;
    }

    .intro-content h2 {
        font-size: 1.5rem;
    }

    .intro-description {
        font-size: 1rem;
    }

    .intro-benefits {
        flex-direction: column;
        gap: 20px;
    }

    .start-quiz-btn {
        font-size: 1.125rem;
        padding: 12px 30px;
    }

    .flavorfinder-quiz,
    .flavorfinder-results {
        padding: 25px;
    }

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

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

    .step-actions {
        flex-direction: column;
    }

    .step-actions .btn {
        width: 100%;
    }

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

    .widget-container {
        flex-direction: column;
        text-align: center;
    }

    .widget-image {
        display: none;
    }

    .results-header h2 {
        font-size: 1.5rem;
    }

    .results-subtitle {
        font-size: 1rem;
    }

    .results-seo-content {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .flavorfinder-container {
        padding: 15px;
    }

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

    .flavorfinder-icon {
        font-size: 2rem;
    }

    .intro-content h2 {
        font-size: 1.25rem;
    }

    .step-title {
        font-size: 1.25rem;
    }

    .product-image {
        height: 200px;
    }
}

/* ====================================
   Accessibility Enhancements
   ==================================== */

.option-card:focus-within .option-content {
    outline: 3px solid #FB9B50;
    outline-offset: 2px;
}

.btn:focus {
    outline: 3px solid #FB9B50;
    outline-offset: 2px;
}

/* ====================================
   Performance Optimizations
   ==================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
