/**
 * Fill in the Blank Block - Académie des Étoiles
 * Text input question with validation
 */

/* ========================================
   BASE STYLES
   ======================================== */

.ade-fill-in-blank {
    margin: var(--ade-space-2xl) 0;
}

.ade-fill-in-blank__question-card {
    /* Removed bulky white wrapper - clean minimal style */

    margin: var(--ade-space-xl) 0;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.ade-fill-in-blank__question-card--correct {
    border-color: #10b981;
}

.ade-fill-in-blank__question-card--incorrect {
    border-color: #ef4444;
}

/* Header with badge */
.ade-fill-in-blank__header {
    margin-bottom: var(--ade-space-lg);
}

.ade-fill-in-blank__badge {
    display: inline-block;
    padding: var(--ade-space-xs) var(--ade-space-md);
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: var(--ade-white);
    border-radius: 20px;
    font-size: var(--ade-font-size-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Question text */
.ade-fill-in-blank__question {
    font-size: var(--ade-font-size-large);
    font-weight: 600;
    color: var(--ade-primary-dark);
    margin: 0 0 var(--ade-space-xl) 0;
    line-height: 1.4;
}

/* Form */
.ade-fill-in-blank__form {
    margin-bottom: 0;
}

/* Input wrapper */
.ade-fill-in-blank__input-wrapper {
    position: relative;
    margin-bottom: var(--ade-space-xl);
}

/* Text input */
.ade-fill-in-blank__input {
    width: 100%;
    padding: var(--ade-space-md) var(--ade-space-lg);
    padding-right: 50px;
    font-size: var(--ade-font-size-base);
    font-family: inherit;
    line-height: 1.6;
    color: var(--ade-gray-dark);
    background: var(--ade-white);
    border: 2px solid var(--ade-gray);
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ade-fill-in-blank__input:hover {
    border-color: var(--ade-primary);
}

.ade-fill-in-blank__input:focus {
    outline: none;
    border-color: var(--ade-primary);
    box-shadow: 0 0 0 3px var(--ade-primary-light);
}

.ade-fill-in-blank__input::placeholder {
    color: var(--ade-gray);
    font-style: italic;
}

.ade-fill-in-blank__input:disabled {
    background: var(--ade-gray-lighter);
    cursor: not-allowed;
}

/* Input states */
.ade-fill-in-blank__input--correct {
    border-color: #10b981;
    background: #d1fae5;
}

.ade-fill-in-blank__input--incorrect {
    border-color: #ef4444;
    background: #fee2e2;
}

/* Input icon (shown after submission) */
.ade-fill-in-blank__input-icon {
    position: absolute;
    right: var(--ade-space-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    line-height: 1;
    display: none;
}

.ade-fill-in-blank__input-icon--correct {
    display: block;
}

.ade-fill-in-blank__input-icon--correct::after {
    content: "✓";
    color: #10b981;
    font-weight: 700;
}

.ade-fill-in-blank__input-icon--incorrect {
    display: block;
}

.ade-fill-in-blank__input-icon--incorrect::after {
    content: "✗";
    color: #ef4444;
    font-weight: 700;
}

/* Actions */
.ade-fill-in-blank__actions {
    display: flex;
    justify-content: center;
}

/* Submit button */
.ade-fill-in-blank__submit {
    padding: var(--ade-space-md) var(--ade-space-2xl);
    background: linear-gradient(135deg, var(--ade-primary) 0%, var(--ade-primary-dark) 100%);
    color: var(--ade-white);
    border: none;
    border-radius: 8px;
    font-size: var(--ade-font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--ade-shadow-sm);
}

.ade-fill-in-blank__submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--ade-shadow-md);
}

.ade-fill-in-blank__submit:active:not(:disabled) {
    transform: translateY(0);
}

.ade-fill-in-blank__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ade-fill-in-blank__submit:focus {
    outline: 2px solid var(--ade-primary);
    outline-offset: 2px;
}

/* Feedback area */
.ade-fill-in-blank__feedback {
    margin-top: var(--ade-space-xl);
    padding: var(--ade-space-lg);
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

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

.ade-fill-in-blank__feedback--correct {
    background: #d1fae5;
    border-left: 4px solid #10b981;
}

.ade-fill-in-blank__feedback--incorrect {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
}

/* Feedback header */
.ade-fill-in-blank__feedback-header {
    display: flex;
    align-items: center;
    gap: var(--ade-space-sm);
    margin-bottom: var(--ade-space-md);
}

.ade-fill-in-blank__feedback-icon {
    font-size: 24px;
    line-height: 1;
}

.ade-fill-in-blank__feedback-text {
    font-size: var(--ade-font-size-medium);
    font-weight: 600;
}

.ade-fill-in-blank__feedback--correct .ade-fill-in-blank__feedback-icon::after {
    content: "✓";
    color: #10b981;
}

.ade-fill-in-blank__feedback--correct .ade-fill-in-blank__feedback-text {
    color: #065f46;
}

.ade-fill-in-blank__feedback--incorrect .ade-fill-in-blank__feedback-icon::after {
    content: "✗";
    color: #ef4444;
}

.ade-fill-in-blank__feedback--incorrect .ade-fill-in-blank__feedback-text {
    color: #991b1b;
}

/* Correct answer display */
.ade-fill-in-blank__correct-answer {
    font-size: var(--ade-font-size-base);
    line-height: 1.6;
    color: var(--ade-gray-dark);
    margin-bottom: var(--ade-space-md);
    padding: var(--ade-space-sm) var(--ade-space-md);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
}

.ade-fill-in-blank__correct-answer strong {
    color: var(--ade-primary-dark);
}

.ade-fill-in-blank__correct-answer-text {
    font-weight: 600;
    color: #10b981;
}

/* Retry button */
.ade-fill-in-blank__retry-container {
    margin-top: var(--ade-space-md);
}

.ade-fill-in-blank__retry {
    padding: var(--ade-space-sm) var(--ade-space-lg);
    background: var(--ade-white);
    color: var(--ade-primary);
    border: 2px solid var(--ade-primary);
    border-radius: 8px;
    font-size: var(--ade-font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ade-fill-in-blank__retry:hover {
    background: var(--ade-primary);
    color: var(--ade-white);
}

.ade-fill-in-blank__retry:focus {
    outline: 2px solid var(--ade-primary);
    outline-offset: 2px;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */

@media screen and (max-width: 768px) {
    .ade-fill-in-blank__question-card {
        padding: var(--ade-space-xl);
    }

    .ade-fill-in-blank__question {
        font-size: var(--ade-font-size-medium);
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media screen and (max-width: 480px) {
    .ade-fill-in-blank__question-card {
        padding: var(--ade-space-lg);
        border-radius: 12px;
    }

    .ade-fill-in-blank__question {
        font-size: var(--ade-font-size-base);
    }

    .ade-fill-in-blank__input {
        font-size: var(--ade-font-size-small);
        padding: var(--ade-space-sm) var(--ade-space-md);
        padding-right: 45px;
    }

    .ade-fill-in-blank__submit {
        width: 100%;
        padding: var(--ade-space-md);
    }
}

/* ========================================
   PRINT
   ======================================== */

@media print {
    .ade-fill-in-blank__question-card {
        box-shadow: none;
        border: 1px solid var(--ade-gray);
        page-break-inside: avoid;
    }

    .ade-fill-in-blank__submit,
    .ade-fill-in-blank__retry {
        display: none;
    }

    .ade-fill-in-blank__feedback {
        page-break-inside: avoid;
    }
}
