/* --- Vocabulary Modal (Redesigned for V2.4) --- */

/* --- Overlay & Animation --- */
.vocab-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Softer overlay */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    opacity: 0; /* Start hidden for animation */
    transition: opacity 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.vocab-modal-overlay.show {
    opacity: 1;
}

.vocab-modal-content {
    background-color: #ffffff;
    width: 100%;
    max-width: 480px; /* Slightly wider */
    border-radius: 24px; /* Softer corners */
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.15); /* Softer, deeper shadow */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95); /* Start smaller for animation */
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vocab-modal-overlay.show .vocab-modal-content {
    transform: scale(1);
}

/* --- Progress Bar --- */
.vocab-progress-bar {
    width: 100%;
    height: 10px; /* Slightly thicker */
    background-color: #f0f2f5; /* Lighter background */
}

.vocab-progress-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #007aff, #5856d6); /* Gradient for accent */
    transition: width 0.4s ease-in-out;
    border-radius: 0 5px 5px 0;
}

/* --- Step Container --- */
#vocab-step-container {
    padding: 35px;
    text-align: center;
}

.vocab-step h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1c1e21;
    margin-bottom: 30px;
}

/* --- Learn Step (Flashcard) --- */
.flashcard {
    background: #f9f9f9;
    border: 1px solid #e9e9ed;
    border-radius: 16px; /* Softer radius */
    padding: 30px;
    margin-bottom: 30px;
    transition: transform 0.2s ease;
}

.flashcard:hover {
    transform: translateY(-3px);
}

.flashcard .word {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.flashcard .translation {
    font-size: 22px;
    font-weight: 500;
    color: #007aff;
}

/* --- Quiz Step --- */
.quiz-word {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 35px;
    color: #1c1e21;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quiz-option-btn {
    width: 100%;
    padding: 16px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 18px;
    font-weight: 500;
    border: 2px solid #e9e9ed; /* Thicker, lighter border */
    border-radius: 12px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative; /* For feedback icons */
}

.quiz-option-btn:hover:not(:disabled) {
    background-color: #f0f2f5;
    border-color: #007aff;
    transform: translateY(-2px);
}

.quiz-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Feedback states for buttons */
.quiz-option-btn.correct {
    background-color: #e9fbf0;
    border-color: #34c759;
    color: #1c4b27;
    font-weight: 600;
}

.quiz-option-btn.incorrect {
    background-color: #fff0f0;
    border-color: #ff3b30;
    color: #5c1a1a;
}

/* Add feedback icons */
.quiz-option-btn::after {
    content: '';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.3s ease;
    font-size: 18px;
}

.quiz-option-btn.correct::after {
    content: '\f00c'; /* Check icon */
    color: #34c759;
    transform: translateY(-50%) scale(1);
}

.quiz-option-btn.incorrect::after {
    content: '\f00d'; /* Times icon */
    color: #ff3b30;
    transform: translateY(-50%) scale(1);
}


/* --- Typing Quiz --- */
.typing-quiz-area {
    display: flex;
    gap: 10px;
}

#typing-answer {
    flex-grow: 1;
    padding: 14px;
    border-radius: 12px;
    border: 2px solid #dddfe2;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 17px;
    transition: all 0.3s ease;
}

#typing-answer:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

#typing-answer.correct {
    background-color: #e9fbf0;
    border-color: #34c759;
}

#typing-answer.incorrect {
    background-color: #fff0f0;
    border-color: #ff3b30;
}


/* --- End Step --- */
.end-step h2 {
    color: #34c759; /* Green for success */
}
.end-step p {
    font-size: 17px;
    color: #606770;
    margin-bottom: 30px;
    line-height: 1.7;
}

/* --- General Button --- */
.vocab-btn-next {
    background-color: #007aff;
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.2);
    font-family: 'Vazirmatn', sans-serif; /* Added Font */
}

.vocab-btn-next:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
}

/* --- Responsive Design --- */
@media (max-width: 500px) {
    .vocab-modal-content {
        width: 92%;
        max-height: 95vh;
        overflow-y: auto;
    }

    #vocab-step-container {
        padding: 25px;
    }

    .vocab-step h2 {
        font-size: 20px;
    }

    .flashcard .word {
        font-size: 26px;
    }

    .flashcard .translation {
        font-size: 19px;
    }

    .quiz-word {
        font-size: 28px;
    }

    .quiz-option-btn {
        padding: 14px;
        font-size: 16px;
    }

    .vocab-btn-next {
        padding: 14px 25px;
        font-size: 16px;
    }
}