/**
 * Mini LLM Frontend Styles
 * Modern lesson interface with responsive design
 */

/* Reset and Base Styles */
.mini-llm-container {
    max-width: 1400px;
    margin: 100px auto 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

.mini-llm-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000000;
}

.mini-llm-breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.mini-llm-breadcrumb a {
    color: #818a91;
    text-decoration: none;
}

.mini-llm-breadcrumb a:hover {
    text-decoration: underline;
}

.mini-llm-breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

.mini-llm-course-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e1e1e;
    margin: 0;
}

/* Layout */
.mini-llm-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    min-height: 600px;
}

/* Sidebar */
.mini-llm-sidebar {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mini-llm-lessons-menu h3 {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f2f2f2;
}

.lessons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lesson-item {
    margin-bottom: 8px;
}

.lesson-item.active .lesson-link {
    background: #000000;
    color: white;
    transform: translateX(4px);
}

.lesson-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    color: #000000;
    transition: all 0.2s ease;
    border: 1px solid #f2f2f2;
}

.lesson-link:hover {
    background: #f2f2f2;
    transform: translateX(2px);
    text-decoration: none;
    color: #000000;
}

.lesson-number {
    font-weight: 600;
    margin-right: 8px;
    min-width: 20px;
}

.lesson-title {
    font-size: 14px;
    line-height: 1.4;
}

/* Content Area */
.mini-llm-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.mini-llm-lesson-content {
    padding: 30px;
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.lesson-header .lesson-title {
    font-size: 24px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0;
}

.lesson-progress {
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Video Player */
.mini-llm-video-container {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    position: relative;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
}

#mini-llm-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mini-llm-video-container:hover .video-overlay {
    opacity: 1;
}

.video-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.play-pause-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s ease;
}

.play-pause-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.progress-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: #818a91;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.time-display {
    font-size: 14px;
    font-family: monospace;
    color: white;
    white-space: nowrap;
}

.fullscreen-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s ease;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Files Container */
.mini-llm-files-container {
    margin-top: 30px;
}

.mini-llm-files-container h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 20px 0;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: #f0f8ff;
    border-color: #818a91;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

.file-icon {
    font-size: 24px;
    margin-right: 15px;
    min-width: 24px;
}

.file-info {
    flex: 1;
}

.file-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 4px 0;
}

.file-type {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.file-actions {
    margin-left: 15px;
}

.download-btn {
    background: #000000;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.download-btn:hover {
    background: #333333;
}

.download-icon {
    font-size: 12px;
}

/* No Content State */
.mini-llm-no-content {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-content-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.mini-llm-no-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 10px 0;
}

.mini-llm-no-content p {
    font-size: 16px;
    margin: 0;
}

/* Loading State */
.mini-llm-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #818a91;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mini-llm-loading p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Fullscreen Styles */
.mini-llm-video-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #000;
    border-radius: 0;
}

.mini-llm-video-container.fullscreen .video-wrapper {
    height: 100vh;
    padding-bottom: 0;
}

.mini-llm-video-container.fullscreen #mini-llm-video {
    height: 100vh;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .mini-llm-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mini-llm-sidebar {
        position: static;
        order: 2;
    }
    
    .mini-llm-content {
        order: 1;
    }
}

@media (max-width: 768px) {
    .mini-llm-container {
        margin-top: 50px;
        padding: 15px;
    }
    
    .mini-llm-course-title {
        font-size: 24px;
    }
    
    .mini-llm-lesson-content {
        padding: 20px;
    }
    
    .lesson-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
    
    .file-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .file-actions {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .mini-llm-container {
        padding: 10px;
    }
    
    .mini-llm-lesson-content {
        padding: 15px;
    }
    
    .video-controls {
        gap: 10px;
    }
    
    .play-pause-btn,
    .fullscreen-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .time-display {
        font-size: 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.lesson-link:focus,
.play-pause-btn:focus,
.fullscreen-btn:focus,
.download-btn:focus {
    outline: 2px solid #818a91;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mini-llm-container {
        border: 2px solid;
    }
    
    .lesson-link {
        border: 2px solid;
    }
    
    .file-item {
        border: 2px solid;
    }
}

/* Audio Player Styles */
.mini-llm-audio-container {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
}

.audio-player {
    display: flex;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

.audio-thumbnail {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.audio-icon {
    font-size: 24px;
    color: white;
}

.audio-controls {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 15px;
}

.audio-play-pause-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #818a91;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.audio-play-pause-btn:hover {
    background: #6c757d;
    transform: scale(1.05);
}

.audio-info {
    flex: 1;
    min-width: 0;
}

.audio-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e1e1e;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-progress-bar {
    flex: 1;
    height: 6px;
    background: #e1e5e9;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.audio-progress-fill {
    height: 100%;
    background: #818a91;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.audio-time-display {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.audio-volume {
    display: flex;
    align-items: center;
}

.volume-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e5e9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.volume-btn:hover {
    background: #e9ecef;
    color: #818a91;
}

/* Responsive Audio Player */
@media (max-width: 768px) {
    .audio-player {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .audio-thumbnail {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .audio-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .audio-progress {
        width: 100%;
    }
}
