/* Lesson Modal Styles */
.lesson-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.lesson-modal.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lesson-modal-content {
    background: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

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

.lesson-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.lesson-header h2 {
    margin: 0;
    font-size: 1.8em;
}

.close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    font-size: 2em;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    line-height: 1;
    padding: 0;
}

.close-modal:hover {
    background: white;
    color: #667eea;
    transform: rotate(90deg);
}

.lesson-body {
    padding: 30px;
}

/* Root Section Styles */
.root-section {
    background: #f8f9fa;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
}

.root-section:last-child {
    margin-bottom: 0;
}

.root-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #cbd5e0;
}

.root-name {
    font-size: 1.8em;
    color: #5a67d8;
    margin: 0;
    font-weight: bold;
}

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

.root-meaning {
    color: #2d3748;
    font-size: 1.1em;
}

.root-meaning strong {
    color: #5a67d8;
}

/* Words List */
.words-list {
    display: grid;
    gap: 20px;
}

.word-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.word-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: #5a67d8;
    transform: translateX(5px);
}

.word-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.word-name {
    font-size: 1.5em;
    color: #2d3748;
    margin: 0;
    font-weight: bold;
}

.word-pronunciation {
    color: #718096;
    font-style: italic;
    font-size: 0.95em;
}

.word-pos {
    background: #edf2f7;
    color: #4a5568;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: bold;
}

.word-definition {
    color: #2d3748;
    font-size: 1.1em;
    margin: 10px 0;
    line-height: 1.6;
}

.word-example {
    color: #718096;
    font-size: 1em;
    margin: 10px 0 0 0;
    padding: 12px;
    background: #f7fafc;
    border-left: 4px solid #5a67d8;
    border-radius: 5px;
    line-height: 1.5;
}

/* Error Message */
.error-message {
    background: #fff5f5;
    border: 3px solid #feb2b2;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.error-message h3 {
    color: #c53030;
    margin-bottom: 10px;
}

.error-message p {
    color: #742a2a;
    font-size: 1.1em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lesson-modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .lesson-header {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .lesson-header h2 {
        font-size: 1.4em;
    }
    
    .lesson-body {
        padding: 20px;
    }
    
    .root-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .root-name {
        font-size: 1.5em;
    }
    
    .word-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .word-name {
        font-size: 1.3em;
    }
    
    .word-card:hover {
        transform: none;
    }
}

/* Scrollbar styling for modal */
.lesson-modal-content::-webkit-scrollbar {
    width: 10px;
}

.lesson-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.lesson-modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.lesson-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}
