/* =====================================================================================
   VERB CONJUGATION EXERCISE STYLES - SFA Widget Design Language
   Beautiful, therapeutic, and professional styling matching SFA widget
   ===================================================================================== */

/* CSS Custom Properties for Elementor customization */
.verb-conjugation-root {
    --verb-conjugation-primary: #3b82f6;
    --verb-conjugation-success: #10b981;
    --verb-conjugation-error: #ef4444;
    --verb-conjugation-challenge-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Shared component (ex-*) variable mapping */
    --ex-primary: var(--verb-conjugation-primary);
    --ex-primary-dark: #2563eb;
    --ex-primary-light: #dbeafe;
    --ex-primary-ring: #93bbfd;
    --ex-success: var(--verb-conjugation-success);
    --ex-success-dark: #059669;
    --ex-success-light: #d1fae5;
    --ex-error: var(--verb-conjugation-error);
    --ex-error-dark: #dc2626;
    --ex-error-light: #fee2e2;
    --ex-warning: #f59e0b;
    --ex-warning-light: #fef3c7;
    --ex-neutral-50: #f9fafb;
    --ex-neutral-100: #f3f4f6;
    --ex-neutral-200: #e5e7eb;
    --ex-neutral-300: #d1d5db;
    --ex-neutral-500: #6b7280;
    --ex-neutral-700: #374151;
    --ex-neutral-800: #1f2937;
    --ex-radius-sm: 6px;
    --ex-radius-md: 8px;
    --ex-radius-lg: 12px;
    --ex-radius-full: 9999px;
    --ex-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --ex-transition: 0.2s ease;
    --ex-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== ELEMENTOR BUTTON RESET ===== */
.elementor-kit-15048 .verb-conjugation-root button:not(.te-mh-gear):not(.te-mh-path):not(.vc-choice-pill):not(.vc-skip-btn):not(.vc-flag-btn):not(.check-button):not(.skip-button):not(.next-button):not(.retry-button):not(.restart-button):not(.new-exercise-button):not(.audio-button):not(.tts-button),
.elementor-kit-15048 .verb-conjugation-exercise button:not(.te-mh-gear):not(.te-mh-path):not(.vc-choice-pill):not(.vc-skip-btn):not(.vc-flag-btn):not(.check-button):not(.skip-button):not(.next-button):not(.retry-button):not(.restart-button):not(.new-exercise-button):not(.audio-button):not(.tts-button) {
    letter-spacing: normal;
    text-transform: none;
    line-height: normal;
}

/* ===== CONTAINER & LAYOUT ===== */
.verb-conjugation-exercise {
    background: white;
    border-radius: 16px;
    padding: 10px 20px 20px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
}

/* ===== HEADER (matching SFA) ===== */
.exercise-header {
    text-align: center;
    margin-bottom: 30px;
}

.exercise-header h3 {
    color: #1f2937;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    margin-top: 0;
}

.progress-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.question-counter {
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
    color: #6b7280;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
}

.score-display {
    background: linear-gradient(135deg, var(--verb-conjugation-primary, #3b82f6) 0%, #1d4ed8 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ===== WORD DISPLAY (matching SFA gradient style) ===== */
/* Challenge card — compact: tense label + verb hero + 2×2 choice grid */
.conjugation-challenge {
    background: var(--verb-conjugation-challenge-bg, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    border-radius: 16px;
    padding: 20px 20px 16px;
    margin-bottom: 8px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.conjugation-challenge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
}

.verb-prompt {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 14px;
}

/* New compact text: "Future Tense for" */
.vc-tense-label {
    display: block;
    font-size: 15px;
    opacity: 0.85;
    font-weight: 400;
    margin-bottom: 4px;
}

/* Big verb name */
.vc-verb-hero {
    font-size: 36px;
    font-weight: 700;
    display: block;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 2×2 choice grid inside the card */
.vc-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    position: relative;
    z-index: 2;
}

/* Legacy text elements — hidden when using new layout */
.base-verb,
.target-tense {
    display: none;
}

.base-verb .label,
.base-verb strong,
.target-tense .label,
.target-tense strong {
    display: none;
}

/* ===== AUDIO BUTTONS (SFA style) ===== */
.audio-button, .tts-button {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    vertical-align: middle;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}

.audio-button:hover, .tts-button:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.05);
    color: white;
}

.audio-button:disabled, .tts-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.audio-button.playing, .tts-button.speaking {
    animation: pulse 1.5s infinite;
    background: rgba(255,255,255,0.4);
}

/* ===== MULTIPLE CHOICE PILLS (inside purple card) ===== */
.verb-conjugation-root .vc-choice-pill {
    padding: 12px 8px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 10px;
    background: rgba(255,255,255,0.92);
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
    text-align: center;
    font-family: inherit;
}

.verb-conjugation-root .vc-choice-pill:hover:not(:disabled) {
    background: white;
    border-color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: #1f2937;
}

.verb-conjugation-root .vc-choice-pill:active:not(:disabled) {
    transform: scale(0.97);
}

.verb-conjugation-root .vc-choice-pill.correct {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}

.verb-conjugation-root .vc-choice-pill.incorrect {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.verb-conjugation-root .vc-choice-pill.reveal-correct {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
    opacity: 0.8;
}

.verb-conjugation-root .vc-choice-pill.dimmed {
    opacity: 0.3;
}

.verb-conjugation-root .vc-choice-pill:disabled {
    cursor: default;
}

/* Skip row (below pips) */
.vc-skip-row {
    display: flex;
    justify-content: center;
    margin-top: 2px;
}

/* Skip button */
.verb-conjugation-root .vc-skip-btn {
    padding: 4px 12px;
    font-size: 13px;
    min-width: 44px;
    min-height: 44px;
    background: none;
    color: var(--ex-neutral-500);
    border: none;
    cursor: pointer;
    opacity: 0.5;
    font-weight: 500;
}

.verb-conjugation-root .vc-skip-btn:hover {
    opacity: 1;
    color: #6b7280;
}

/* ===== ANSWER INPUT SECTION (typing mode) ===== */
.answer-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.answer-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.answer-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.answer-input:focus {
    outline: none;
    border-color: var(--verb-conjugation-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #f8fafc;
}

/* ===== BUTTONS (SFA style) ===== */
.check-button, .skip-button, .next-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    text-decoration: none;
}

.check-button {
    background: linear-gradient(135deg, var(--verb-conjugation-primary, #3b82f6) 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.check-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    color: white;
}

.check-button:disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.skip-button {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.skip-button:hover {
    background: #e5e7eb;
    color: #4b5563;
    border-color: #d1d5db;
}

.next-button {
    background: linear-gradient(135deg, var(--verb-conjugation-success, #10b981) 0%, #047857 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.next-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    color: white;
}

/* Feedback — now handled by shared-components.css (.ex-feedback-*) */

.correct-answer {
    background: #f0f9ff;
    border: 1px solid #3b82f6;
    color: #1d4ed8;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 500;
    margin-top: 10px;
    display: inline-block;
}

/* ===== COMPLETION SCREEN (SFA style) ===== */
.verb-conjugation-complete {
    text-align: center;
    padding: 40px 20px;
}

.verb-conjugation-complete h3 {
    color: #1f2937;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
}

.final-score {
    margin-bottom: 30px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--verb-conjugation-success, #10b981) 0%, #047857 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.percentage {
    font-size: 32px;
    font-weight: bold;
    color: white;
}

.completion-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.restart-button, .new-exercise-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.restart-button {
    background: var(--verb-conjugation-primary, #3b82f6);
    color: white;
}

.restart-button:hover {
    background: #2563eb;
    color: white;
}

.new-exercise-button:hover {
    background: #e5e7eb;
    color: #4b5563;
}

.new-exercise-button {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

/* ===== LOADING & ERROR STATES (SFA style) ===== */
.verb-conjugation-loading, .verb-conjugation-error, .verb-conjugation-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.retry-button {
    background: var(--verb-conjugation-primary, #3b82f6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.retry-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    color: white;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .verb-conjugation-exercise {
        padding: 8px 14px 14px;
        margin: 0;
        max-width: none;
    }
    
    .exercise-header h3 {
        font-size: 20px;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .vc-verb-hero {
        font-size: 28px;
    }
    
    .answer-input-group {
        flex-direction: column;
        gap: 15px;
    }

    .answer-input {
        min-width: 100%;
        font-size: 16px;
    }

    .verb-conjugation-root .vc-choice-pill {
        padding: 10px 6px;
        font-size: 14px;
    }

    .vc-verb-hero {
        font-size: 28px;
    }
    
    .completion-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .restart-button, .new-exercise-button {
        width: 200px;
    }
    
    .audio-button, .tts-button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .percentage {
        font-size: 28px;
    }
}

/* ===== ELEMENTOR PREVIEW MODE ===== */
.elementor-preview .verb-conjugation-root {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
}

/* ===== MERGED HEADER INTEGRATION ===== */

/* Settings panel (slides in from gear pill) */
.vc-settings-panel {
    background: var(--ex-neutral-50);
    border: 1px solid var(--ex-neutral-200);
    border-radius: var(--ex-radius-lg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vc-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vc-setting-row label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ex-neutral-700);
    white-space: nowrap;
}

.vc-setting-select {
    padding: 7px 12px;
    border: 1px solid var(--ex-neutral-300);
    border-radius: var(--ex-radius-md);
    font-size: 14px;
    background: #fff;
    color: var(--ex-neutral-800);
    cursor: pointer;
    min-width: 140px;
}

.vc-setting-select:focus {
    outline: 3px solid var(--ex-primary);
    outline-offset: 2px;
}

/* Progress pips row (below challenge card) */
.vc-pips-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 12px;
}

.vc-pips-count {
    font-weight: 600;
    color: var(--ex-neutral-700);
    white-space: nowrap;
}

.vc-pips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
}

.vc-pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ex-neutral-200);
    display: inline-block;
    transition: transform 0.2s ease, background 0.2s ease;
}

.vc-pip.current {
    background: var(--verb-conjugation-primary, #3b82f6);
    transform: scale(1.4);
}

.vc-pip.correct {
    background: var(--verb-conjugation-success, #10b981);
    animation: vcPipPop 0.3s ease;
}

.vc-pip.incorrect {
    background: var(--verb-conjugation-error, #ef4444);
    animation: vcPipPop 0.3s ease;
}

.vc-pip.skipped {
    background: var(--ex-neutral-300);
}

@keyframes vcPipPop {
    0% { transform: scale(0.5); }
    60% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.vc-pips-score {
    font-weight: 600;
    color: var(--ex-success-dark);
    white-space: nowrap;
    margin-left: auto;
}

/* Legacy progress row (unused, kept for compatibility) */
.vc-progress-row {
    display: none;
}

.vc-counter {
    font-weight: 600;
}

.vc-score {
    font-weight: 600;
    color: var(--ex-success-dark);
}

/* Bottom utils row */
.vc-bottom-utils {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.verb-conjugation-root .vc-flag-btn {
    background: none;
    border: none;
    font-size: 16px;
    opacity: 0.25;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verb-conjugation-root .vc-flag-btn:hover {
    opacity: 0.6;
    color: inherit;
}

.verb-conjugation-root .vc-flag-btn:focus-visible {
    outline: 3px solid var(--ex-primary);
    outline-offset: 2px;
}

/* Hide old exercise-header when merged header is active */
body.has-merged-header .verb-conjugation-exercise .exercise-header {
    display: none;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .audio-button, .tts-button, .check-button, .next-button, .retry-button {
        transition: none;
    }

    @keyframes pulse {
        0%, 100% { transform: scale(1); opacity: 1; }
    }
}