/* Online Classroom Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
}

.classroom-container {
    display: flex;
    height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 300px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    overflow-y: auto;
}

.course-header {
    position: sticky;
    top: 0;
    background: #2c3e50;
    z-index: 10;
    padding-bottom: 15px;
}

.course-header h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #ecf0f1;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #34495e;
    border-radius: 4px;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #3498db;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.9rem;
    color: #bdc3c7;
}

.week-nav {
    margin-top: 30px;
}

.week-item {
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.week-item:hover {
    background: #34495e;
}

.week-item.active {
    background: #3498db !important;
    border-left-color: #2980b9 !important;
}

.week-item.completed {
    background: #27ae60;
    border-left-color: #229954;
}

.week-item.completed::after {
    content: "✓";
    float: right;
    font-weight: bold;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h1 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.week-controls {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 8px 16px;
    border: 1px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
    background: #3498db;
    color: white;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.lesson-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.lesson-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-btn {
    background: #27ae60;
    color: white;
}

.action-btn:hover {
    background: #229954;
}

.action-btn.secondary {
    background: #95a5a6;
}

.action-btn.secondary:hover {
    background: #7f8c8d;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gallery-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.05);
}

.gallery-info {
    padding: 20px;
}

.gallery-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.gallery-description {
    color: #555;
    line-height: 1.5;
    margin-bottom: 12px;
}

.gallery-use {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.gallery-source {
    color: #888;
    font-size: 0.85rem;
}

/* Week Sections */
.week-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.summary {
    background: #e8f4fd;
    border-left-color: #3498db;
}

.key-points {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.preparation {
    background: #d1ecf1;
    border-left-color: #17a2b8;
}

.group-questions {
    background: #d4edda;
    border-left-color: #28a745;
}

.optional-resources {
    background: #f8d7da;
    border-left-color: #dc3545;
}

/* Video Container */
.video-container {
    margin: 10px;
    position: relative;
    width: 280px;
    height: 157px;
    overflow: hidden;
    border-radius: 8px;
    display: inline-block;
}

.videos-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.video-container iframe {
    width: 100%;
    height: 100%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

#notesText {
    width: 100%;
    height: 200px;
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

/* Image Modal */
.image-modal {
    z-index: 2000;
}

.image-modal-content {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    max-width: 95vw;
    max-height: 95vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 5% auto;
    pointer-events: none;
}

.image-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

#modalImage {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    pointer-events: auto;
}

.modal-image-info {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    max-width: 100%;
    text-align: center;
    pointer-events: auto;
}

.image-close:hover {
    background: rgba(0,0,0,0.8);
}

#modalImage {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.modal-image-info {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    max-width: 100%;
    text-align: center;
}

.modal-image-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
}

.modal-image-info p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 15px;
    color: #2c3e50;
}

p {
    margin-bottom: 15px;
    line-height: 1.6;
}

ul, ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

li {
    margin-bottom: 8px;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Key Points Section */
.key-points {
    background: #e8f5e8;
    border-left: 4px solid #27ae60;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.key-points h2 {
    color: #27ae60;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.key-points-list {
    list-style: none;
    padding-left: 0;
}

.key-points-list li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.key-points-list li::before {
    content: "•";
    color: #27ae60;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Preparation Checkboxes */
.preparation-list {
    list-style: none;
    padding-left: 0;
}

.preparation-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

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

.prep-checkbox {
    margin-right: 12px;
    margin-top: 2px;
    transform: scale(1.2);
    cursor: pointer;
}

.prep-label {
    cursor: pointer;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.prep-label.completed {
    text-decoration: line-through;
    opacity: 0.7;
    color: #27ae60;
}

.prep-label a {
    color: #3498db;
    text-decoration: none;
}

.prep-label a:hover {
    text-decoration: underline;
}

/* Study Materials */
.materials-item {
    background: #34495e !important;
    border-left-color: #3498db !important;
    font-weight: 600;
}

.nav-separator {
    padding: 10px 15px;
    font-size: 0.8rem;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #34495e;
    margin: 10px 0;
}

.materials-section {
    max-width: 1000px;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.material-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 3px solid transparent;
}

.material-card.required {
    border-color: #e74c3c;
}

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

.material-image {
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.material-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.material-info {
    padding: 25px;
}

.material-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.material-author {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 5px;
}

.material-type {
    color: #3498db;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.material-description {
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
}

.material-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.material-link {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}

.material-link:hover {
    background: #2980b9;
    text-decoration: none;
}

.required-badge {
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.optional-badge {
    background: #95a5a6;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.materials-note {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin-top: 30px;
}

.materials-note h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.materials-note p {
    color: #555;
    line-height: 1.6;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: #34495e;
    color: white;
    border: none;
    padding: 12px 20px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 1px solid #2c3e50;
}

.mobile-toggle:hover,
.mobile-toggle:focus,
.mobile-toggle:active {
    background: #3498db;
    outline: none;
}

.toggle-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .sidebar-content.collapsed {
        display: none;
    }
    
    .classroom-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 70vh;
        overflow-y: auto;
        position: sticky;
        top: 0;
        z-index: 100;
        display: flex;
        flex-direction: column;
    }
    
    .main-content {
        flex: 1;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px 20px;
    }
    
    .content-header h1 {
        font-size: 1.4rem;
    }
    
    .week-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-btn {
        flex: 1;
        margin: 0 5px;
    }
    
    .content-wrapper {
        padding: 20px 15px;
    }
    
    .lesson-content {
        padding: 20px 15px;
    }
    
    .lesson-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-btn {
        width: 100%;
        text-align: center;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gallery-item {
        margin-bottom: 20px;
    }
    
    .gallery-image {
        height: 200px;
    }
    
    .videos-section {
        flex-direction: column;
        align-items: center;
    }
    
    .video-container {
        width: 100%;
        max-width: 350px;
        height: 200px;
        margin: 10px 0;
    }
    
    .materials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .material-actions {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .material-link {
        text-align: center;
    }
    
    .week-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .summary, .key-points, .preparation, .group-questions, .optional-resources {
        padding: 15px;
    }
    
    .preparation-item {
        flex-direction: row;
        align-items: flex-start;
        padding: 8px;
    }
    
    .prep-checkbox {
        margin-right: 8px;
        margin-bottom: 0;
    }
    
    .prep-label {
        margin-left: 0;
        word-break: break-word;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
    
    #notesText {
        height: 150px;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }
    
    .week-item {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .course-header h2 {
        font-size: 1.3rem;
    }
    
    .progress-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 15px 10px;
    }
    
    .image-modal-content {
        max-width: 98vw;
        max-height: 98vh;
    }
    
    .image-close {
        top: -35px;
        font-size: 30px;
        width: 35px;
        height: 35px;
    }
    
    #modalImage {
        max-height: 80vh;
    }
    
    .modal-image-info {
        padding: 10px;
        font-size: 0.8rem;
    }
    
    .lesson-content {
        padding: 15px 10px;
    }
    
    .content-header {
        padding: 10px 15px;
    }
    
    .content-header h1 {
        font-size: 1.2rem;
    }
    
    .gallery-info {
        padding: 12px;
    }
    
    .gallery-title {
        font-size: 1rem;
    }
    
    .material-info {
        padding: 15px;
    }
    
    .material-title {
        font-size: 1.1rem;
    }
    
    .video-container {
        max-width: 100%;
        height: 180px;
    }
    
    .week-section {
        padding: 12px;
    }
    
    .summary, .key-points, .preparation, .group-questions, .optional-resources {
        padding: 12px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .materials-grid {
        grid-template-columns: 1fr;
    }
    
    .material-actions {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .material-link {
        text-align: center;
    }
}
