/**
 * Mini LLM Frontend Styles
 * Modern lesson interface with responsive design
 */

/* Simplified Typography System */
.mini-llm-container {
    font-size: 16px; /* Base font size */
}

/* All Headings - 24px */
.mini-llm-container h1, .mini-llm-container h2, .mini-llm-container h3,
.mini-llm-course-title {
    font-size: 24px !important;
    font-weight: 600;
    line-height: 1.3;
}

/* Lessons Menu H3 - Uppercase Bold */
.mini-llm-lessons-menu h3 {
    font-size: 24px !important;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.3;
}

/* Lesson Title - 16px */
.lesson-title {
    font-size: 16px !important;
    font-weight: 600;
    line-height: 1.4;
}

/* Normal Text */
.mini-llm-container p, .mini-llm-container div {
    font-size: 16px;
    line-height: 1.6;
}

/* Small Text */
.mini-llm-container small, .mini-llm-container .small {
    font-size: 12px;
    line-height: 1.4;
}

/* Reset and Base Styles */
.mini-llm-container {
    max-width: 1400px;
    margin: 100px auto 0;
    padding: 20px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #FFFFFF;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.mini-llm-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000000;
}

.mini-llm-title-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.course-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 200px;
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #28a745;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.course-progress .course-progress-text {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.reset-progress-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    margin-left: 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reset-progress-btn:hover {
    background: transparent !important;
    transform: rotate(180deg);
}

.reset-icon {
    font-size: 12px;
    color: #333;
}

.mini-llm-breadcrumb {
    font-size: 12px;
    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: 12px;
    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;
    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: 12px;
    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: #f2f2f2;
    color: #D16E9E !important;
    transform: translateX(4px);
}

.lesson-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    text-decoration: none;
    color: #000000 !important;
    transition: all 0.2s ease;
    border: 1px solid #f2f2f2;
    position: relative;
}

.lesson-link.completed {
    background: #f8f9fa;
    border-left: 3px solid #28a745;
}

.lesson-link.completed .lesson-title {
    color: #28a745;
    font-weight: 500;
}

.lesson-item.active .lesson-link.completed {
    color: #28a745 !important;
}

.lesson-checkmark {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-weight: bold;
    font-size: 12px;
}

.lesson-link:hover {
    background: #f2f2f2;
    transform: translateX(2px);
    text-decoration: none;
    color: #D16E9E;
}

.lesson-number {
    font-weight: 600;
    margin-right: 8px;
    min-width: 20px;
}

.lesson-title {
    font-size: 12px;
    line-height: 1.4;
}

/* Podlekcije Styles - Same as lekcije, just indented */
.podlekcije-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    padding-left: 10px;
    display: none;
}

.lesson-item.active .podlekcije-list {
    display: block;
}

.podlekcija-item {
    margin-bottom: 8px;
}

.podlekcija-item.active .podlekcija-link {
    background: #f2f2f2;
    color: #D16E9E !important;
    transform: translateX(4px);
}

.podlekcija-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    text-decoration: none;
    color: #000000 !important;
    transition: all 0.2s ease;
    border: 1px solid #f2f2f2;
    position: relative;
    cursor: pointer;
}

.podlekcija-link.completed {
    background: #f8f9fa;
    border-left: 3px solid #28a745;
}

.podlekcija-link.completed .podlekcija-title {
    color: #28a745;
    font-weight: 500;
}

.podlekcija-item.active .podlekcija-link.completed {
    color: #28a745 !important;
}

.podlekcija-link:hover {
    background: #f2f2f2;
    transform: translateX(2px);
    text-decoration: none;
    color: #D16E9E;
}

.podlekcija-number {
    font-weight: 600;
    margin-right: 8px;
    min-width: 20px;
}

.podlekcija-title {
    font-size: 12px;
    line-height: 1.4;
}

/* Content Area */
.mini-llm-content {
    background: white;
    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-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.complete-lesson-btn {
    background: #D16E9E;
    color: white;
    border: 2px solid #D16E9E;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.complete-lesson-btn:hover {
    background: white;
    color: #D16E9E;
    border-color: #D16E9E;
}

.complete-lesson-btn.completed {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    pointer-events: none !important;
    cursor: default !important;
}

.complete-lesson-btn.completed:hover {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    transform: none !important;
}

.check-icon {
    font-weight: bold;
}

.lesson-header .lesson-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0;
}

.lesson-progress {
    font-size: 12px;
    color: #666;
    background: #f8f9fa;
    padding: 6px 12px;
}

/* Video Player */
.mini-llm-video-container {
    margin-bottom: 30px;
    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: black !important;
}

.play-pause-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: black !important;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    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);
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.1s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.time-display {
    font-size: 12px;
    font-family: monospace;
    color: white !important;
    white-space: nowrap;
}
.description-content p{
    margin-bottom:20px !important;
}
.fullscreen-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: black !important;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s ease;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.play-icon,
.pause-icon,
.fullscreen-icon,
.reset-icon {
    min-width: 16px;
    height: 16px;
    display: inline-block;
}

.play-icon img,
.pause-icon img,
.fullscreen-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter:invert(1);
}

/* Lesson Description */
.mini-llm-lesson-description .description-content {
    margin: 25px 0;
    color: #000;
}

/* Override external font declarations */
.mini-llm-container * {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

.mini-llm-lesson-description .description-content p:last-child {
    margin-bottom: 0;
}

/* Files Container */
.mini-llm-files-container {
    margin-top: 30px;
}

.mini-llm-files-container h3 {
    font-size: 12px;
    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: 1px solid #e1e5e9;
    transition: all 0.2s ease;
    gap: 15px;
}

.file-item:hover {
    background: #f0f8ff;
    border-color: #818a91;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}


.file-info {
    flex: 1;
}

.file-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 4px 0;
}

.file-type {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.file-actions {
    margin-left: auto;
}

.download-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.download-btn:hover {
    color: #D16E9E;
    background: #f8f9fa;
}

.download-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.download-btn:hover .download-icon {
    opacity: 1;
}


/* No Content State */
.mini-llm-no-content {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-content-icon {
    font-size: 24px;
    margin-bottom: 20px;
}

.mini-llm-no-content h3 {
    font-size: 12px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 10px 0;
}

.mini-llm-no-content p {
    font-size: 12px;
    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: 12px;
    margin: 0;
}

/* Fullscreen Styles */
.mini-llm-video-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #000;
}

.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: 12px;
    }
    
    .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: 12px;
    }
    
    .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,
.podlekcija-link:focus,
.play-pause-btn:focus,
.fullscreen-btn:focus,
.download-btn:focus,
.complete-lesson-btn:focus {
    outline: 2px solid #D16E9E;
    outline-offset: 2px;
}

/* Override WordPress focus styles for player controls */
.play-pause-btn:focus,
.fullscreen-btn:focus {
    background: rgba(255, 255, 255, 0.3) !important;
    color: black !important;
    outline: 2px solid #D16E9E !important;
}

.download-btn:focus {
    background: #f8f9fa !important;
    color: #D16E9E !important;
    outline: 2px solid #D16E9E !important;
}

.audio-play-pause-btn:focus {
    background: #D16E9E !important;
}

.speed-btn:focus {
    background: #D16E9E !important;
    color: white !important;
    border-color: #D16E9E !important;
}

.complete-lesson-btn:focus {
    outline: 2px solid #D16E9E !important;
    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;
    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;
}

.audio-controls {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 15px;
}

.audio-play-pause-btn {
    width: 50px;
    height: 50px;
    background: #818a91;
    color: black !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.audio-play-pause-btn:hover {
    background: #6c757d;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.audio-info {
    flex: 1;
    min-width: 0;
}

.audio-title {
    font-size: 12px;
    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;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.audio-progress-fill {
    height: 100%;
    background: #818a91;
    width: 0%;
    transition: width 0.1s ease;
}

.audio-time-display {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.audio-speed {
    display: flex;
    align-items: center;
}

.speed-btn {
    width: 50px;
    height: 40px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e5e9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.speed-btn:hover {
    background: #e9ecef;
    color: #818a91;
    border-color: #818a91;
}

/* Forms Container */
.mini-llm-forms-container {
    margin-top: 30px;
}

.mini-llm-forms-container h3 {
    font-size: 12px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 20px 0;
}

/* Upload Form Styles - Drag & Drop */
.upload-form-container {
    margin-top: 20px;
}

.upload-form-container .form-group {
    margin-bottom: 20px;
}

.upload-form-container .form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    left: -9999px;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed rgba(139, 115, 85, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.5);
    position: relative;
    min-height: 120px;
}

.file-upload-label:hover {
    border-color: rgba(139, 115, 85, 0.6);
    background: rgba(139, 115, 85, 0.1);
}

.file-upload-label.has-file {
    border-color: #059669;
    background: rgba(5, 150, 105, 0.05);
}

.file-upload-label.drag-over {
    border-color: rgba(139, 115, 85, 0.8);
    background: rgba(139, 115, 85, 0.15);
    transform: scale(1.02);
}

.file-upload-label .drag-text {
    text-align: center;
    pointer-events: none;
}

.file-upload-label .drag-text .drag-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.upload-message {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 500;
}

.upload-message.success {
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid rgba(5, 150, 105, 0.3);
    color: #059669;
}

.upload-message.error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #dc2626;
}

/* Upload Form Submit Button */
#mini-llm-upload-form button[type="submit"] {
    background: #D16E9E !important;
    color: white !important;
    border: none !important;
    transition: all 450ms ease !important;
    padding: 0.875rem 1.5rem !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    width: 100% !important;
}

#mini-llm-upload-form button[type="submit"]:hover {
    background: #000000 !important;
    color: white !important;
    border: none !important;
}

#mini-llm-upload-form button[type="submit"]:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Responsive Audio Player */
@media (max-width: 768px) {
    .audio-player {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .audio-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .audio-progress {
        width: 100%;
    }
}
