/**
 * CPG Tracker Quiz Styles
 */

/* Quiz Container */
.cpg-quiz {
    
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
 
    overflow: hidden;
}

/* Quiz Header */
.cpg-quiz-header {
    padding: 40px 40px 30px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.cpg-quiz-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 10px;
    font-family: sanfran, -apple-system, BlinkMacSystemFont, sans-serif;
}

.cpg-quiz-question {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
    font-family: sanfranreg, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Step Indicators */
.cpg-quiz-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cpg-quiz-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cpg-quiz-steps li span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 20px;
    background: #e5e5e5;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: sanfranreg, -apple-system, BlinkMacSystemFont, sans-serif;
}

.cpg-quiz-steps li.active span {
    background: #E7E24C;
    color: #1a1a1a;
}

.cpg-quiz-steps li.completed span {
    background: #1a1a1a;
    color: #fff;
}

/* Quiz Body */
.cpg-quiz-body {
    padding: 40px;
}

/* Options Grid */
.cpg-quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    list-style: none;
    margin: 0 0 40px 0;
    padding: 0;
}

/* Option Card */
.cpg-quiz-option {
    position: relative;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cpg-quiz-option:hover {
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cpg-quiz-option.selected {
    border-color: #E7E24C;
    background: #fffef5;
    box-shadow: 0 0 0 3px rgba(231, 226, 76, 0.2);
}

.cpg-quiz-option-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    object-fit: contain;
}

.cpg-quiz-option-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0;
    font-family: sanfran, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Help Tooltip */
.cpg-quiz-help {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    cursor: help;
}

.cpg-quiz-help-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.cpg-quiz-help:hover .cpg-quiz-help-icon {
    background: #E7E24C;
    color: #1a1a1a;
}

.cpg-quiz-help-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    padding: 16px;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 10;
    text-align: left;
    font-family: sanfranreg, -apple-system, BlinkMacSystemFont, sans-serif;
}

.cpg-quiz-help-content::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    width: 12px;
    height: 12px;
    background: #1a1a1a;
    transform: rotate(45deg);
}

.cpg-quiz-help:hover .cpg-quiz-help-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Navigation */
.cpg-quiz-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.cpg-quiz-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: sanfran, -apple-system, BlinkMacSystemFont, sans-serif;
}

.cpg-quiz-btn-prev,
.cpg-quiz-btn-restart {
    background: #f0f0f0;
    color: #666;
}

.cpg-quiz-btn-prev:hover,
.cpg-quiz-btn-restart:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

.cpg-quiz-btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cpg-quiz-btn-next {
    background: #E7E24C;
    color: #1a1a1a;
    margin-left: auto;
}

.cpg-quiz-btn-next:hover {
    background: #d4cf3a;
}

.cpg-quiz-btn-next:disabled {
    background: #e5e5e5;
    color: #999;
    cursor: not-allowed;
}

/* Loading State */
.cpg-quiz-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}

.cpg-quiz-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e5e5e5;
    border-top-color: #E7E24C;
    border-radius: 50%;
    animation: cpg-quiz-spin 0.8s linear infinite;
    margin-bottom: 20px;
}

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

/* Results Section */
.cpg-quiz-results .cpg-quiz-header {
    border-bottom: none;
    padding-bottom: 0;
}

.cpg-quiz-results-products {
    /* Container for the grid */
}

/* Product Grid and Cards - Exact match to archive */
.cpg-quiz-results-products .cpg-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.cpg-quiz-results-products .cpg-product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.cpg-quiz-results-products .cpg-standout-banner {
    background: #E7E24C;
    color: #000;
    text-align: center;
    padding: 8px 12px;
    font-size: 13px;
    font-family: sanfranreg;
}

.cpg-quiz-results-products .cpg-product-image {
    position: relative;
}

.cpg-quiz-results-products .cpg-product-image > a > img {
    width: 100%;
    height: auto;
    display: block;
}

.cpg-quiz-results-products .cpg-secondary-image {
    position: absolute;
    bottom: -30px;
    right: 10px;
    width: 35%;
    height: auto;
    border-radius: 4px;
}

.cpg-quiz-results-products .cpg-product-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.cpg-quiz-results-products .cpg-fitted-text {
    position: absolute;
    bottom: 20px;
    left: -5px;
    background: black;
    color: white;
    font-family: sanfran;
    padding: 0px 20px;
    border-radius: 5px;
    font-size: 12px;
}

.cpg-quiz-results-products .cpg-fitted-text:before {
    content: '\e081';
    font-family: etmodules;
    padding-right: 10px;
    color: #E7E24C;
}

.cpg-quiz-results-products .cpg-star-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 4px;
}

.cpg-quiz-results-products .cpg-star {
    font-size: 18px;
    line-height: 1;
}

.cpg-quiz-results-products .cpg-star-full {
    color: #fbbf24;
}

.cpg-quiz-results-products .cpg-star-half {
    color: #fbbf24;
}

.cpg-quiz-results-products .cpg-star-empty {
    color: #d1d5db;
}

.cpg-quiz-results-products .cpg-review-count {
    font-size: 14px;
    color: black;
    font-family: sanfranreg;
    margin-left: 4px;
}

.cpg-quiz-results-products h3.cpg-product-title a {
    font-family: sanfran;
    font-size: 30px;
}

.cpg-quiz-results-products .cpg-product-title {
    font-size: 16px;
    margin: 0 0 4px;
    line-height: 1.3;
}

.cpg-quiz-results-products .cpg-product-title a {
    text-decoration: none;
    color: inherit;
}

.cpg-quiz-results-products .cpg-primary-category {
    font-size: 13px;
    color: #666;
    text-decoration: none;
    display: inline-block;
}

.cpg-quiz-results-products .cpg-primary-category:hover {
    text-decoration: underline;
}

.cpg-quiz-results-products .cpg-product-price {
    font-weight: 600;
    margin-bottom: 16px;
    margin-top: auto;
    font-family: sanfran;
}

.cpg-quiz-results-products .cpg-product-price del {
    opacity: 0.3;
}

.cpg-quiz-results-products .cpg-key-features {
    margin-bottom: 16px;
}

.cpg-quiz-results-products .cpg-key-features ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cpg-quiz-results-products .cpg-key-features ul li {
    font-size: 12px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.cpg-quiz-results-products .cpg-key-features ul li:before {
    content: '✓';
    color: #22c55e;
    font-weight: bold;
    flex-shrink: 0;
}

.cpg-quiz-results-products .cpg-product-buttons {
    display: flex;
    gap: 8px;
}

.cpg-quiz-results-products .cpg-product-buttons .button,
.cpg-quiz-results-products .cpg-product-buttons .cpg-more-details-btn {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    font-size: 14px;
    text-decoration: none;
    border-radius: 4px;
    box-sizing: border-box;
}

.cpg-quiz-results-products .cpg-product-buttons .button {
    font-family: sanfran;
    background: #E7E24C;
    color: black;
    border: none;
    text-transform: capitalize;
}

.cpg-quiz-results-products .cpg-product-buttons .cpg-more-details-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    font-family: sanfran;
}

/* No Results */
.cpg-quiz-no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 1200px) {
    .cpg-quiz-results-products .cpg-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .cpg-quiz-results-products .cpg-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cpg-quiz-header {
        padding: 30px 20px 20px;
    }

    .cpg-quiz-title {
        font-size: 20px;
    }

    .cpg-quiz-question {
        font-size: 16px;
    }

    .cpg-quiz-steps {
        flex-wrap: wrap;
        gap: 6px;
    }

    .cpg-quiz-steps li span {
        padding: 6px 12px;
        font-size: 12px;
    }

    .cpg-quiz-body {
        padding: 30px 20px;
    }

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

    .cpg-quiz-help-content {
        width: 220px;
        right: -8px;
    }

    .cpg-quiz-nav {
        flex-wrap: wrap;
    }

    .cpg-quiz-btn {
        flex: 1;
        min-width: 120px;
    }

    .cpg-quiz-results-products .cpg-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cpg-quiz-results-products .cpg-key-features ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cpg-quiz-results-products .cpg-products-grid {
        grid-template-columns: 1fr;
    }
}
