/**
 * ═══════════════════════════════════════════════════════════════
 * FILL-IN-THE-BLANKS SYSTEM - STYLES
 * ═══════════════════════════════════════════════════════════════
 */

/* Container pentru întrebarea interactivă */
.fill-blank-container {
    font-size: 1.1rem;
    line-height: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin: 1rem 0;
}

/* Input-uri inline în text */
.fill-blank-input {
    /* Layout */
    display: inline-block;
    margin: 0 4px;
    padding: 6px 12px;
    min-width: 80px;
    max-width: 300px;
    
    /* Styling */
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px 4px 0 0;
    
    /* Text */
    color: #ffffff;
    font-size: inherit;
    font-family: inherit;
    text-align: center;
    
    /* Animation */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Comportament */
    outline: none;
}

/* Hover */
.fill-blank-input:hover {
    background: rgba(255, 255, 255, 0.08);
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* Focus (când utilizatorul scrie) */
.fill-blank-input:focus {
    background: rgba(37, 99, 235, 0.1);
    border-bottom-color: #2563eb;
    border-bottom-width: 3px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

/* Stări de validare */
.fill-blank-input.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    border-bottom-color: #10b981 !important;
    animation: correctPulse 0.6s ease-out;
}

.fill-blank-input.incorrect {
    background: rgba(239, 68, 68, 0.15) !important;
    border-bottom-color: #ef4444 !important;
    animation: incorrectShake 0.5s ease-out;
}

.fill-blank-input.partial {
    background: rgba(245, 158, 11, 0.15) !important;
    border-bottom-color: #f59e0b !important;
}

/* Input disabled (după submit) */
.fill-blank-input:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* Placeholder styling */
.fill-blank-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* Animație pentru răspuns corect */
@keyframes correctPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    }
    100% {
        transform: scale(1);
    }
}

/* Animație pentru răspuns greșit */
@keyframes incorrectShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-4px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(4px);
    }
}

/* Feedback indicator (opțional) */
.fill-blank-feedback {
    display: inline-block;
    margin-left: 8px;
    font-size: 1.2rem;
    vertical-align: middle;
    animation: fadeIn 0.3s ease-out;
}

.fill-blank-feedback.correct::after {
    content: '✓';
    color: #10b981;
}

.fill-blank-feedback.incorrect::after {
    content: '✗';
    color: #ef4444;
}

/* Animație fade-in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Progress indicator (sus în UI) */
.fill-blank-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.fill-blank-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.fill-blank-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    border-radius: 3px;
    transition: width 0.3s ease-out;
}

/* Stats (câte completate din total) */
.fill-blank-stats {
    font-weight: 600;
    color: #3b82f6;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .fill-blank-container {
        font-size: 1rem;
        line-height: 1.8rem;
        padding: 1rem;
    }
    
    .fill-blank-input {
        min-width: 60px;
        padding: 4px 8px;
        font-size: 0.95rem;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .fill-blank-input {
        background: rgba(255, 255, 255, 0.03);
        border-bottom-color: rgba(255, 255, 255, 0.2);
    }
    
    .fill-blank-input:hover {
        background: rgba(255, 255, 255, 0.06);
    }
}

/* Voice recording indicator pentru input-uri */
.fill-blank-input.voice-recording {
    border-bottom-color: #ef4444;
    animation: voicePulse 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* Mic button pentru fiecare input */
.fill-blank-voice-btn {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 4px;
    background: rgba(37, 99, 235, 0.2);
    border-radius: 50%;
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.fill-blank-voice-btn:hover {
    background: rgba(37, 99, 235, 0.4);
    transform: scale(1.1);
}

.fill-blank-voice-btn.active {
    background: rgba(239, 68, 68, 0.4);
    animation: voicePulse 1.5s ease-in-out infinite;
}

/* Tooltip pentru input-uri */
.fill-blank-input-wrapper {
    position: relative;
    display: inline-block;
}

.fill-blank-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.85rem;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.fill-blank-input-wrapper:hover .fill-blank-tooltip {
    opacity: 1;
}

/* Arrow pentru tooltip */
.fill-blank-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Print styles (pentru export PDF) */
@media print {
    .fill-blank-input {
        border-bottom: 1px solid #000;
        background: transparent;
    }
    
    .fill-blank-voice-btn {
        display: none;
    }
}