/**
 * Pocket-Sommelier - Taste Questionnaire Styles v1.0
 * Dark Mode Support via themes.css variable overrides
 */

/* ==================== Sub-Screen Override ==================== */
#taste-questionnaire-screen {
    background: var(--bg-primary, var(--cream));
    z-index: 70;
}

#taste-questionnaire-screen.active {
    display: flex;
    flex-direction: column;
}

/* ==================== Header ==================== */
.tq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
    background: var(--bg-secondary, #fff);
    border-bottom: 1px solid var(--border-color, var(--gray-200));
}

.tq-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary, var(--gray-100));
    color: var(--text-secondary, var(--gray-600));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tq-close-btn:hover {
    background: var(--gray-200);
    color: var(--text-primary, var(--gray-900));
}

.tq-header-text {
    flex: 1;
    text-align: center;
}

.tq-header-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    margin: 0;
}

.tq-header-spacer {
    width: 36px;
    flex-shrink: 0;
}

/* ==================== Progress Bar ==================== */
.tq-progress-bar {
    height: 3px;
    background: var(--bg-tertiary, var(--gray-100));
    position: relative;
    overflow: hidden;
}

.tq-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light, #D4AF37) 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 2px 2px 0;
}

/* ==================== Content Area ==================== */
.tq-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 20px 100px 20px;
    display: flex;
    flex-direction: column;
}

/* ==================== Question Wrapper ==================== */
.tq-question-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tq-question-wrapper.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ==================== Step Indicator ==================== */
.tq-step-indicator {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin: 0 0 8px 0;
}

/* ==================== Question Title ==================== */
.tq-question-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    margin: 0 0 24px 0;
    line-height: 1.3;
}

/* ==================== Options ==================== */
.tq-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.tq-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-secondary, #fff);
    border: 2px solid var(--border-color, var(--gray-200));
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    font-size: 15px;
    color: var(--text-primary, var(--gray-800));
    line-height: 1.4;
}

.tq-option:hover {
    border-color: var(--gold);
}

.tq-option:active {
    transform: scale(0.98);
}

.tq-option.selected {
    border-color: var(--gold);
    background: rgba(197, 160, 89, 0.08);
    box-shadow: 0 0 0 1px var(--gold);
}

/* Radio dot */
.tq-option-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color, var(--gray-200));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tq-option.selected .tq-option-radio {
    border-color: var(--gold);
    background: var(--gold);
}

.tq-option-radio-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.2s ease;
}

.tq-option.selected .tq-option-radio-dot {
    background: #fff;
}

.tq-option-label {
    flex: 1;
}

/* ==================== Info Button (Prominent) ==================== */
.tq-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(197, 160, 89, 0.08);
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--gold, #c5a059);
    padding: 8px 14px;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.tq-info-btn:hover {
    background: rgba(197, 160, 89, 0.15);
    border-color: var(--gold);
}

.tq-info-btn:active {
    transform: scale(0.98);
}

.tq-info-btn svg {
    flex-shrink: 0;
}

.tq-info-btn-text {
    /* Emoji + text zusammen */
}

.tq-info-btn-chevron {
    transition: transform 0.3s ease;
    color: var(--gold, #c5a059);
}

.tq-info-btn.open .tq-info-btn-chevron {
    transform: rotate(180deg);
}

/* ==================== Info Panel ==================== */
.tq-info-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    opacity: 0;
}

.tq-info-panel.open {
    max-height: 2000px;
    opacity: 1;
}

.tq-info-content {
    background: var(--bg-secondary, #fff);
    border: 1px solid var(--border-color, var(--gray-200));
    border-radius: 14px;
    padding: 18px;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* Info Panel Header Row (Icon + Close X) */
.tq-info-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tq-info-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(197, 160, 89, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}

.tq-info-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    margin: 0 0 8px 0;
}

.tq-info-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary, var(--gray-600));
    margin: 0;
}

/* Close X Button */
.tq-info-close-x {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary, var(--gray-100));
    color: var(--text-secondary, var(--gray-600));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.tq-info-close-x:hover {
    background: var(--gray-200);
    color: var(--text-primary, var(--gray-900));
}

/* Hide old close button */
.tq-info-close-btn {
    display: none;
}


/* ==================== Action Row (Info + Next side by side) ==================== */
.tq-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}

/* ==================== Back Row ==================== */
.tq-back-row {
    padding-top: 12px;
}

/* ==================== Navigation (legacy, kept for back/next styling) ==================== */
.tq-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    margin-top: auto;
}

.tq-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary, var(--gray-600));
    padding: 10px 4px;
    transition: color 0.2s ease;
}

.tq-nav-back:hover {
    color: var(--gold);
}

.tq-nav-next,
.tq-nav-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--gold) 0%, #92702D 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.3);
}

.tq-nav-next:hover,
.tq-nav-submit:hover {
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.4);
    transform: translateY(-1px);
}

.tq-nav-next:active,
.tq-nav-submit:active {
    transform: translateY(0);
}

.tq-nav-next.disabled,
.tq-nav-submit.disabled {
    opacity: 0.4;
    pointer-events: none;
    box-shadow: none;
}

/* ==================== Completion Screen ==================== */
.tq-complete-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    animation: tqFadeIn 0.4s ease;
}

@keyframes tqFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.tq-complete-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.tq-complete-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    margin: 0 0 8px 0;
}

.tq-complete-text {
    font-size: 15px;
    color: var(--text-secondary, var(--gray-600));
    margin: 0 0 24px 0;
    line-height: 1.5;
    max-width: 320px;
}

.tq-complete-hint {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-secondary, #fff);
    border: 1px solid var(--border-color, var(--gray-200));
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 28px;
    text-align: left;
    max-width: 340px;
}

.tq-complete-hint-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(197, 160, 89, 0.1);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tq-complete-hint-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary, var(--gray-600));
    margin: 0;
}

.tq-complete-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--gold) 0%, #92702D 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.3);
}

.tq-complete-btn:hover {
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.4);
    transform: translateY(-1px);
}

.tq-complete-btn:active {
    transform: translateY(0);
}

/* ==================== CTA Banners ==================== */
.tq-cta-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin: 0 16px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tq-cta-banner:active {
    transform: scale(0.98);
}

/* Home CTA: Gold gradient */
.tq-cta-home {
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.12) 0%, rgba(212, 175, 55, 0.08) 100%);
    border-color: rgba(197, 160, 89, 0.25);
}

.tq-cta-home:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(197, 160, 89, 0.15);
}

/* Journal CTA: Subtle card */
.tq-cta-journal {
    background: var(--bg-secondary, #fff);
    border-color: var(--border-color, var(--gray-200));
    flex-wrap: wrap;
}

.tq-cta-journal:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(197, 160, 89, 0.1);
}

/* CTA Icon */
.tq-cta-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(197, 160, 89, 0.1);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* CTA Text */
.tq-cta-text {
    flex: 1;
    min-width: 0;
}

.tq-cta-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.tq-cta-desc {
    font-size: 13px;
    color: var(--text-secondary, var(--gray-600));
    margin: 0;
    line-height: 1.4;
}

/* CTA Arrow (Home) */
.tq-cta-arrow {
    color: var(--gold);
    flex-shrink: 0;
}

/* CTA Button (Journal) */
.tq-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--gold) 0%, #92702D 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    width: 100%;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.25);
}

.tq-cta-btn:hover {
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.4);
}

/* ==================== Dark Mode Fine-Tuning ==================== */
[data-theme="dark"] .tq-option.selected {
    background: rgba(197, 160, 89, 0.15);
}

[data-theme="dark"] .tq-cta-home {
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.15) 0%, rgba(212, 175, 55, 0.10) 100%);
    border-color: rgba(197, 160, 89, 0.30);
}

[data-theme="dark"] .tq-info-icon-wrap {
    background: rgba(197, 160, 89, 0.15);
}

[data-theme="dark"] .tq-complete-hint-icon {
    background: rgba(197, 160, 89, 0.15);
}


[data-theme="dark"] .tq-info-btn {
    background: rgba(197, 160, 89, 0.12);
    border-color: rgba(197, 160, 89, 0.25);
}

[data-theme="dark"] .tq-info-btn:hover {
    background: rgba(197, 160, 89, 0.2);
}

[data-theme="dark"] .tq-info-close-x {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .tq-option.selected {
        background: rgba(197, 160, 89, 0.15);
    }

    :root:not([data-theme="light"]) .tq-cta-home {
        background: linear-gradient(135deg, rgba(197, 160, 89, 0.15) 0%, rgba(212, 175, 55, 0.10) 100%);
        border-color: rgba(197, 160, 89, 0.30);
    }

    :root:not([data-theme="light"]) .tq-info-icon-wrap {
        background: rgba(197, 160, 89, 0.15);
    }

    :root:not([data-theme="light"]) .tq-complete-hint-icon {
        background: rgba(197, 160, 89, 0.15);
    }

    :root:not([data-theme="light"]) .tq-info-btn {
        background: rgba(197, 160, 89, 0.12);
        border-color: rgba(197, 160, 89, 0.25);
    }

    :root:not([data-theme="light"]) .tq-info-btn:hover {
        background: rgba(197, 160, 89, 0.2);
    }

    :root:not([data-theme="light"]) .tq-info-close-x {
        background: var(--bg-tertiary);
        color: var(--text-secondary);
    }

}
