/**
 * Malvern Building Quiz Styles
 * Standalone Version
 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

/* Main Container */
.malvern-quiz {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.malvern-quiz__container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

/* Header */
.malvern-quiz__header {
    text-align: center;
    margin-bottom: 2rem;
}

.malvern-quiz__title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
}

.malvern-quiz__description {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* Progress Bar */
.malvern-quiz__progress {
    margin-bottom: 2rem;
}

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

.malvern-quiz__progress-fill {
    height: 100%;
    background: #0073aa;
    transition: width 0.3s ease;
    width: 0%;
}

.malvern-quiz__progress-text {
    display: block;
    text-align: center;
    font-size: 0.875rem;
    color: #666;
}

/* Content */
.malvern-quiz__content {
    min-height: 300px;
}

.malvern-quiz__loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Questions */
.malvern-quiz__question {
    animation: fadeIn 0.3s ease;
}

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

.malvern-quiz__question-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
    color: #1a1a1a;
}

.malvern-quiz__options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.malvern-quiz__option {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.malvern-quiz__option:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.malvern-quiz__option input[type="radio"],
.malvern-quiz__option input[type="checkbox"] {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.malvern-quiz__option input[type="radio"]:checked + .malvern-quiz__option-label,
.malvern-quiz__option input[type="checkbox"]:checked + .malvern-quiz__option-label {
    font-weight: 600;
    color: #0073aa;
}

.malvern-quiz__option:has(input:checked) {
    border-color: #0073aa;
    background: #f0f8ff;
}

.malvern-quiz__option-label {
    flex: 1;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
}

/* Navigation */
.malvern-quiz__navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.malvern-quiz__button {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.malvern-quiz__button--back {
    background: #f5f5f5;
    color: #333;
}

.malvern-quiz__button--back:hover {
    background: #e0e0e0;
}

.malvern-quiz__button--next {
    background: #0073aa;
    color: #fff;
    margin-left: auto;
}

.malvern-quiz__button--next:hover {
    background: #005a87;
}

.malvern-quiz__button--primary {
    background: #0073aa;
    color: #fff;
}

.malvern-quiz__button--primary:hover {
    background: #005a87;
}

/* Results */
.malvern-quiz__results {
    animation: fadeIn 0.3s ease;
}

.malvern-quiz__results-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 2rem;
    text-align: center;
    color: #1a1a1a;
}

.malvern-quiz__results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.malvern-quiz__no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
}

/* Product Card */
.malvern-quiz__product-card {
    position: relative;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.malvern-quiz__product-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
    transform: translateY(-2px);
}

.malvern-quiz__product-medal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.malvern-quiz__product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f5f5f5;
}

.malvern-quiz__product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.malvern-quiz__product-content {
    padding: 1.5rem;
}

.malvern-quiz__product-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #1a1a1a;
}

.malvern-quiz__product-match {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.malvern-quiz__product-match-percentage {
    font-size: 2rem;
    font-weight: 700;
    color: #0073aa;
}

.malvern-quiz__product-match-label {
    font-size: 1rem;
    color: #666;
}

.malvern-quiz__product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.malvern-quiz__product-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.malvern-quiz__product-actions {
    display: flex;
    gap: 1rem;
}

.malvern-quiz__product-actions .malvern-quiz__button {
    flex: 1;
    text-align: center;
}

/* Responsive Design */
@media (min-width: 768px) {
    .malvern-quiz {
        padding: 3rem 2rem;
    }

    .malvern-quiz__container {
        padding: 3rem;
    }

    .malvern-quiz__results-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .malvern-quiz__options {
        gap: 1.25rem;
    }

    .malvern-quiz__option {
        padding: 1.25rem 2rem;
    }
}

@media (min-width: 1024px) {
    .malvern-quiz__results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Theme Variations */
.malvern-quiz--theme-brand .malvern-quiz__progress-fill,
.malvern-quiz--theme-brand .malvern-quiz__button--next,
.malvern-quiz--theme-brand .malvern-quiz__button--primary {
    background: #0073aa;
}

.malvern-quiz--theme-brand .malvern-quiz__option:hover,
.malvern-quiz--theme-brand .malvern-quiz__option:has(input:checked) {
    border-color: #0073aa;
    background: #f0f8ff;
}
