/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background: #4C061D;
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Breadcrumb Navigation */
.breadcrumb {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.breadcrumb a:hover {
    opacity: 1;
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    background-color: white;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    padding: 1rem 2rem;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

nav a:hover,
nav a.active {
    color: #3B3923;
    border-bottom-color: #3B3923;
    background-color: #B4C292;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Home Page Styles */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.lesson-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lesson-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.lesson-card h3 {
    color: #3B3923;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.lesson-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Lesson List */
.lesson-list {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.lesson-item {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.lesson-item:last-child {
    border-bottom: none;
}

.lesson-item:hover {
    background-color: #f8f9fa;
}

.lesson-item .date {
    font-weight: bold;
    color: #D17A22;
    min-width: 120px;
    font-family: monospace;
}

.lesson-item .title {
    flex: 1;
    margin: 0 1rem;
}

.lesson-item a {
    color: #3B3923;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid #3B3923;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.lesson-item a:hover {
    background-color: #3B3923;
    color: white;
}

/* Lesson Page Styles */
.lesson-page {
    max-width: 900px;
}

.lesson-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.lesson-header h2 {
    color: #3B3923;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.lesson-subtitle {
    color: #666;
    font-size: 1.1rem;
}

.lesson-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.lesson-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.lesson-section h3 {
    color: #3B3923;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Embed Containers */
.embed-container {
    position: relative;
    width: 100%;
    margin: 1rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.embed-container iframe {
    width: 100%;
    min-height: 400px;
    border: none;
}

.embed-note {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #B4C292;
    border-left: 4px solid #736F4E;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    color: #4C061D;
}

/* Homework Section */
.homework {
    border-left: 4px solid #D17A22;
}

.homework h3 {
    color: #3B3923;
}

.homework-item {
    margin-bottom: 1.5rem;
}

.homework-item h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.homework-link {
    margin: 1.5rem 0;
    text-align: center;
}

.homework-instructions {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #D17A22;
    color: white;
    border-radius: 6px;
    border-left: 4px solid #4C061D;
}

.homework-instructions h5 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.homework-instructions ul {
    margin-left: 1.5rem;
}

.homework-instructions li {
    margin-bottom: 0.5rem;
    color: white;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #3B3923;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background-color: #736F4E;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 57, 35, 0.3);
}

.btn-secondary {
    background-color: #736F4E;
}

.btn-secondary:hover {
    background-color: #4C061D;
}

.btn-homework {
    background-color: #D17A22;
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.btn-homework:hover {
    background-color: #3B3923;
    color: white;
    box-shadow: 0 4px 12px rgba(209, 122, 34, 0.3);
}

/* Vocabulary Table Styles */
.vocabulary-table {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.vocabulary-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.vocabulary-table th {
    background-color: #4C061D;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.vocabulary-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.vocabulary-table tr:last-child td {
    border-bottom: none;
}

.vocabulary-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.vocabulary-table tr:hover {
    background-color: #B4C292;
}

.vocabulary-table td strong {
    color: #3B3923;
    font-size: 1.1rem;
}

.vocabulary-table td em {
    color: #666;
    font-size: 0.9rem;
    display: block;
    margin-top: 0.2rem;
}

.vocabulary-tip {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #B4C292;
    border-left: 4px solid #D17A22;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    color: #4C061D;
}

/* Exercise Section */
.exercise-section {
    margin-top: 3rem;
    padding: 2rem 0;
}

.exercise-section h3 {
    color: #3B3923;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
    padding: 1rem;
    background-color: #B4C292;
    border-radius: 8px;
}

/* Exercise Folder Styles */
.exercise-folder {
    margin-top: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.folder-header {
    background: #4C061D;
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.folder-header:hover {
    background: #3B3923;
}

.level-badge {
    background: #D17A22;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.folder-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 500;
    flex: 1;
}

.folder-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.folder-header.collapsed .folder-arrow {
    transform: rotate(-90deg);
}

.folder-content {
    padding: 2rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
    overflow: hidden;
}

.folder-content.collapsed {
    max-height: 0;
    padding: 0 2rem;
}

.folder-content .lesson-grid {
    gap: 1.5rem;
}

/* Exercise Page Styles */
.exercise-page {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #f8f9fa;
    color: #333;
}

.exercise-header {
    background: #4C061D;
    color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 2rem;
}

.exercise-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    min-height: 400px;
}

.exercise-instructions {
    background-color: #D17A22;
    color: white;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 2rem;
    text-align: center;
}

.progress-bar {
    background-color: #B4C292;
    height: 10px;
    border-radius: 5px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    background-color: #3B3923;
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.question-number {
    background-color: #3B3923;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 1rem;
    display: inline-block;
}

.exercise-hint {
    background-color: #D17A22;
    color: white;
    padding: 0.8rem;
    border-radius: 5px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.exercise-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-size: 1.1rem;
    text-align: center;
    display: none;
}

.exercise-feedback.correct {
    background-color: #ecfdf5;
    color: #047857;
    border: 2px solid #10b981;
}

.exercise-feedback.incorrect {
    background-color: #fef2f2;
    color: #dc2626;
    border: 2px solid #ef4444;
}

.exercise-controls {
    text-align: center;
    margin-top: 2rem;
}

.navigation-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.dictionary-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background-color: #4C061D;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.dictionary-link:hover {
    background-color: #736F4E;
    text-decoration: none;
    color: white;
}

/* Drag & Drop Specific Styles */
.prefixes-container {
    background: #B4C292;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 2px dashed #736F4E;
}

.prefixes-container h3 {
    margin-top: 0;
    color: #4C061D;
    text-align: center;
}

.prefixes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.prefix {
    background: #3B3923;
    color: white;
    padding: 0.8rem;
    border-radius: 6px;
    text-align: center;
    cursor: grab;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.prefix:active {
    cursor: grabbing;
}

.prefix:hover {
    background: #736F4E;
    transform: translateY(-2px);
}

.drop-zone {
    background: #B4C292;
    border: 2px dashed #736F4E;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    min-height: 40px;
    display: inline-block;
    min-width: 100px;
    text-align: center;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
    vertical-align: middle;
    font-size: 1.1rem;
    line-height: 1.4;
}

.drop-zone.dragover {
    background: #D17A22;
    border-color: #3B3923;
    transform: scale(1.05);
}

.drop-zone.correct {
    background: #10b981;
    color: white;
    border-color: #059669;
}

.drop-zone.incorrect {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
}

.readonly-mode {
    pointer-events: none;
    opacity: 0.8;
}

.readonly-mode .drop-zone {
    background: #10b981;
    color: white;
    border-color: #059669;
}

/* Footer */
footer {
    background-color: #4C061D;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

footer a {
    color: white;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav a {
        padding: 0.8rem 1rem;
        border-bottom: 1px solid #eee;
        border-right: none;
    }
    
    nav a:last-child {
        border-bottom: none;
    }
    
    main {
        padding: 1rem;
    }
    
    .lesson-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .lesson-card {
        padding: 1.5rem;
    }
    
    .lesson-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .lesson-item .date {
        min-width: auto;
    }
    
    .embed-container iframe {
        min-height: 300px;
    }
    
    .lesson-section {
        padding: 1.5rem;
    }
    
    .btn-homework {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }
    
    .vocabulary-table th,
    .vocabulary-table td {
        padding: 0.7rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .vocabulary-table td strong {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .embed-container iframe {
        min-height: 250px;
    }
    
    .lesson-section {
        padding: 1rem;
    }
    
    .lesson-header {
        padding: 1.5rem 1rem;
    }
    
    .lesson-header h2 {
        font-size: 1.5rem;
    }
}