/* Flashcards Styles */

.hidden {
    display: none !important;
}

/* Lesson Selector */
.lesson-selector {
    text-align: center;
}

.lesson-selector h3 {
    color: #2d3748;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.selector-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.selector-btn {
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    background: #edf2f7;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.selector-btn:hover {
    background: #e2e8f0;
    border-color: #5a67d8;
}

.lesson-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.lesson-checkbox {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lesson-checkbox:hover {
    background: #f7fafc;
    border-color: #5a67d8;
}

.lesson-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.lesson-checkbox span {
    font-size: 1em;
    color: #2d3748;
}

/* Flashcard Area */
.flashcard-area {
    animation: fadeIn 0.5s ease;
}

.flashcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
}

.progress-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.progress-info span {
    font-size: 1.1em;
    color: #2d3748;
    font-weight: bold;
}

#lesson-info {
    font-size: 0.95em;
    color: #718096;
    font-weight: normal;
}

.control-btn {
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.4);
}

/* Flashcard Container */
.flashcard-container {
    perspective: 1000px;
    margin: 30px auto;
    max-width: 600px;
}

.flashcard {
    width: 100%;
    height: 400px;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.flashcard-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.flashcard-back {
    background: white;
    border: 3px solid #667eea;
    transform: rotateY(180deg);
}

.card-content {
    text-align: center;
    width: 100%;
}

.flashcard-front .card-content h2 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.speak-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 2em;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.speak-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.speak-btn:active {
    transform: scale(0.95);
}

.card-hint {
    font-size: 1.1em;
    opacity: 0.9;
    margin-top: 20px;
}

/* Back of card */
#card-pronunciation {
    color: #718096;
    font-size: 1.3em;
    margin-bottom: 10px;
}

.card-pos {
    background: #edf2f7;
    color: #4a5568;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
}

.card-definition {
    font-size: 1.3em;
    color: #2d3748;
    margin-bottom: 15px;
    line-height: 1.6;
}

.card-example {
    color: #718096;
    font-size: 1.1em;
    margin-bottom: 20px;
    padding: 10px;
    background: #f7fafc;
    border-left: 4px solid #667eea;
    border-radius: 5px;
}

.root-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.root-badge {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9em;
    display: inline-block;
}

.meaning-text {
    color: #2d3748;
    font-size: 1em;
}

/* Flashcard Controls */
.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.nav-btn,
.flip-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.5);
}

.nav-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
}

.flip-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.flip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(72, 187, 120, 0.5);
}

/* Keyboard Hint */
.keyboard-hint {
    text-align: center;
    margin-top: 20px;
    color: #718096;
}

.keyboard-hint kbd {
    background: #edf2f7;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    padding: 3px 8px;
    font-family: monospace;
    font-size: 0.9em;
    margin: 0 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .flashcard {
        height: 350px;
    }
    
    .flashcard-front .card-content h2 {
        font-size: 2.2em;
    }
    
    .card-definition {
        font-size: 1.1em;
    }
    
    .flashcard-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn,
    .flip-btn {
        width: 100%;
    }
    
    .lesson-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .flashcard-header {
        flex-direction: column;
        gap: 15px;
    }
}
