/**
 * TheCpuHub PC Quiz v3 Styles
 *
 * Dark theme, mobile-first, sharp corners per brand.
 * Only loaded on /pc-quiz/.
 *
 * @package TheCpuHub
 * @since 2.2.0
 */

/* ===================================================
   Base & Reset
   =================================================== */

.pc-quiz {
    background: #0a0a0a;
    color: #e5e5e5;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    padding-bottom: 4rem;
}

.pc-quiz *,
.pc-quiz *::before,
.pc-quiz *::after {
    box-sizing: border-box;
}

.pc-quiz button {
    font-family: inherit;
    border-radius: 0;
}

/* ===================================================
   Progress Bar
   =================================================== */

.quiz-progress {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem 1rem 0;
}

.quiz-progress__bar {
    height: 4px;
    background: #222;
    position: relative;
    margin-bottom: 0.75rem;
}

.quiz-progress__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #dc4f91;
    transition: width 0.4s ease;
    width: 33.33%;
}

.quiz-progress__steps {
    display: flex;
    justify-content: space-between;
}

.quiz-step {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    background: #1a1a1a;
    border: 2px solid #333;
}

.quiz-step.active {
    border-color: #dc4f91;
    color: #dc4f91;
}

.quiz-step.current {
    background: #dc4f91;
    color: #fff;
    border-color: #dc4f91;
}

/* ===================================================
   Panels & Transitions
   =================================================== */

.quiz-panel {
    display: none;
    opacity: 0;
    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.quiz-panel.active {
    display: block;
    opacity: 1;
}

.quiz-panel.exit-left {
    display: block;
    opacity: 0;
    transform: translateX(-40px);
}

.quiz-panel.exit-right {
    display: block;
    opacity: 0;
    transform: translateX(40px);
}

.quiz-panel.enter-left {
    display: block;
    opacity: 0;
    transform: translateX(-40px);
}

.quiz-panel.enter-right {
    display: block;
    opacity: 0;
    transform: translateX(40px);
}

.quiz-panel__content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ===================================================
   Typography
   =================================================== */

.quiz-question {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
    text-align: center;
}

.quiz-subtitle {
    font-size: 0.9rem;
    color: #999;
    margin: 0 0 2rem;
    text-align: center;
}

/* ===================================================
   Step 1: Use Case Tiles
   =================================================== */

.quiz-options--usecase {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

/* Tablet: 3 columns */
@media (min-width: 540px) {
    .quiz-options--usecase {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop: 3 equal columns */
@media (min-width: 768px) {
    .quiz-options--usecase {
        grid-template-columns: repeat(3, 1fr);
    }
}

.quiz-tile--usecase {
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    min-height: 120px;
    display: flex;
    align-items: flex-end;
    text-align: left;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

.quiz-tile--usecase:hover {
    border-color: #444;
    transform: translateY(-2px);
}

.quiz-tile--usecase.selected {
    border-color: #dc4f91;
}

/* Tile background image */
.quiz-tile__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

/* Gradient overlay for text readability */
.quiz-tile__overlay {
    position: relative;
    z-index: 1;
    padding: 1rem;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.quiz-tile__icon {
    margin-bottom: 0.5rem;
    color: #dc4f91;
}

.quiz-tile__icon svg {
    width: 24px;
    height: 24px;
}

.quiz-tile__title {
    display: block;
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.quiz-tile__desc {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
}

/* Checkbox indicator (top-right) */
.quiz-tile__check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dc4f91;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
}

.quiz-tile--usecase.selected .quiz-tile__check {
    opacity: 1;
}

.quiz-tile__check svg {
    width: 16px;
    height: 16px;
}

/* ===================================================
   Step 2: Sub-Category Tiles
   =================================================== */

.quiz-options--subcategory {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-tile--subcategory {
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    padding: 1rem 1.25rem;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

.quiz-tile--subcategory:hover {
    border-color: #444;
    background: #222;
}

.quiz-tile--subcategory.selected {
    border-color: #dc4f91;
    background: #1a0a12;
}

.quiz-tile__label {
    display: block;
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.quiz-tile__examples {
    display: block;
    font-size: 0.8rem;
    color: #888;
    line-height: 1.3;
}

/* ===================================================
   Step 3: Budget Cards
   =================================================== */

.quiz-budget-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .quiz-budget-cards {
        grid-template-columns: repeat(3, 1fr);
        align-items: start;
    }
}

.quiz-budget-card {
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    padding: 1.5rem;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    position: relative;
    font-family: inherit;
    color: inherit;
}

.quiz-budget-card:hover {
    border-color: #444;
    transform: translateY(-2px);
}

.quiz-budget-card.selected {
    border-color: #dc4f91;
    background: #1a0a12;
}

/* Featured card (Best Value / middle) */
.quiz-budget-card--featured {
    border-color: #333;
}

@media (min-width: 768px) {
    .quiz-budget-card--featured {
        transform: scale(1.04);
    }

    .quiz-budget-card--featured:hover {
        transform: scale(1.04) translateY(-2px);
    }

    .quiz-budget-card--featured.selected {
        border-color: #dc4f91;
    }
}

.quiz-budget-card__badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: #dc4f91;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid #dc4f91;
}

.quiz-budget-card__label {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.quiz-budget-card__price {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}

.quiz-budget-card__desc {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.4;
}

/* ===================================================
   Product Cards
   =================================================== */

.quiz-results__products {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .quiz-results__products {
        grid-template-columns: repeat(3, 1fr);
        align-items: start;
    }
}

.quiz-product-card {
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.quiz-product-card:hover {
    transform: translateY(-2px);
    border-color: #444;
}

/* Primary card (Best Match) */
.quiz-product-card--primary {
    border-color: #dc4f91;
}

@media (min-width: 768px) {
    .quiz-product-card--primary {
        transform: scale(1.04);
    }

    .quiz-product-card--primary:hover {
        transform: scale(1.04) translateY(-2px);
    }
}

/* Badge Row */
.quiz-product-card__badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #141414;
    border-bottom: 1px solid #2a2a2a;
}

.quiz-product-card__tier-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.quiz-product-card__best-match {
    font-size: 0.7rem;
    font-weight: 700;
    color: #dc4f91;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quiz-product-card__recommended {
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: #dc4f91;
    padding: 0.15em 0.5em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Product Image */
.quiz-product-card__image {
    background: #111;
    padding: 1rem;
    text-align: center;
}

.quiz-product-card__image img {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
}

/* Product Info */
.quiz-product-card__info {
    padding: 1rem;
}

.quiz-product-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

/* Specs */
.quiz-product-card__specs {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.quiz-spec {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #aaa;
}

.quiz-spec svg {
    width: 14px;
    height: 14px;
    color: #666;
}

/* Price - full price as headline */
.quiz-product-card__price {
    margin-bottom: 1rem;
}

.quiz-product-card__amount {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.quiz-product-card__klarna {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.15rem;
}

/* CTA */
.quiz-product-card__actions {
    padding: 0 1rem 1rem;
}

/* ===================================================
   Buttons
   =================================================== */

.quiz-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
    border: 2px solid transparent;
    text-decoration: none;
    border-radius: 0;
}

.quiz-btn svg {
    width: 18px;
    height: 18px;
}

/* Primary (magenta) */
.quiz-btn--primary {
    background: #dc4f91;
    color: #fff;
    border-color: #dc4f91;
    width: 100%;
    justify-content: center;
}

.quiz-btn--primary:hover {
    background: #c9437f;
}

.quiz-btn--primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Back (outline grey) */
.quiz-btn--back {
    background: transparent;
    color: #999;
    border-color: #333;
}

.quiz-btn--back:hover {
    color: #fff;
    border-color: #555;
}

/* Next (used in Step 1) */
.quiz-btn--next {
    margin-left: auto;
}

/* Outline variant */
.quiz-btn--outline {
    background: transparent;
    color: #ccc;
    border-color: #333;
}

.quiz-btn--outline:hover {
    color: #fff;
    border-color: #555;
}

/* Navigation bar */
.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.quiz-nav .quiz-btn--primary {
    width: auto;
}

/* ===================================================
   Results Page
   =================================================== */

.quiz-results__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 0 0 0.25rem;
}

.quiz-results__subtitle {
    font-size: 0.9rem;
    color: #999;
    text-align: center;
    margin: 0 0 2rem;
}

/* ===================================================
   Trust Signals
   =================================================== */

.quiz-results__trust {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

@media (min-width: 600px) {
    .quiz-results__trust {
        grid-template-columns: repeat(4, 1fr);
    }
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #141414;
    border: 1px solid #2a2a2a;
    font-size: 0.8rem;
    color: #ccc;
}

.trust-item svg {
    width: 18px;
    height: 18px;
    color: #dc4f91;
    flex-shrink: 0;
}

/* ===================================================
   Loading & Empty States
   =================================================== */

.quiz-results__loading {
    text-align: center;
    padding: 3rem 1rem;
}

.quiz-results__loading p {
    color: #999;
    font-size: 0.9rem;
    margin: 0;
}

.quiz-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: #dc4f91;
    border-radius: 50%;
    animation: quiz-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Empty results fallback */
.quiz-results__empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
}

.quiz-results__empty p {
    margin: 0 0 0.5rem;
}

.quiz-results__empty p:last-child {
    margin-bottom: 0;
}

.quiz-results__empty a {
    color: #dc4f91;
    text-decoration: none;
}

.quiz-results__empty a:hover {
    text-decoration: underline;
}

/* Results Actions (Retake / Contact) */
.quiz-results__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* ===================================================
   Quiz Footer
   =================================================== */

.quiz-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: #666;
    border-top: 1px solid #1a1a1a;
}

.quiz-footer a {
    color: #dc4f91;
    text-decoration: none;
}

.quiz-footer a:hover {
    text-decoration: underline;
}

/* ===================================================
   Quiz Header (Minimal - from header-minimal.php)
   =================================================== */

.quiz-header {
    background: #0a0a0a;
    border-bottom: 1px solid #222;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.quiz-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quiz-header__logo img,
.quiz-header__logo .custom-logo {
    height: 36px;
    width: auto;
}

.quiz-header__back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #999;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.quiz-header__back:hover {
    color: #fff;
}

.quiz-header__back svg {
    width: 16px;
    height: 16px;
}

/* Page-level background override */
.page-quiz {
    background: #0a0a0a;
    color: #f0f0f0;
    min-height: 100vh;
}

.page-quiz .site-main {
    padding: 0;
}

/* ===================================================
   Responsive: Large Desktop
   =================================================== */

@media (min-width: 1024px) {
    .quiz-panel__content {
        padding: 2.5rem 2rem;
    }

    .quiz-question {
        font-size: 1.75rem;
    }

    .quiz-results__title {
        font-size: 2rem;
    }
}
