﻿/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e1e1e;
    color: #cccccc;
    line-height: 1.4;
    overflow-x: hidden;
}

/* Container and layout */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background-color: #2d2d30;
    padding: 1rem 2rem;
    border-bottom: 1px solid #3e3e42;
    text-align: center;
}

    .header h1 {
        font-size: 1.5rem;
        font-weight: 400;
        color: #ffffff;
        letter-spacing: 0.5px;
    }

/* Main content */
.main-content {
    display: flex;
    flex: 1;
    min-height: 0;
}

.video-section {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: #1e1e1e;
}

#video-player {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: 4px;
    outline: none;
}

.no-video-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background-color: #1a1a1a;
    border-radius: 8px;
    border: 2px dashed #3e3e42;
}

.placeholder-content {
    text-align: center;
    color: #858585;
}

    .placeholder-content h3 {
        font-size: 1.5rem;
        font-weight: 400;
        margin-bottom: 0.5rem;
        color: #cccccc;
    }

    .placeholder-content p {
        font-size: 1rem;
        color: #858585;
    }

#current-video-title {
    font-size: 1.25rem;
    font-weight: 400;
    color: #ffffff;
}

/* Sidebar - VS Code style */
.sidebar {
    width: 320px;
    background-color: #252526;
    border-right: 1px solid #3e3e42;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.explorer-header {
    padding: 8px 20px;
    background-color: #2d2d30;
    border-bottom: 1px solid #3e3e42;
}

    .explorer-header h3 {
        font-size: 11px;
        font-weight: 500;
        color: #cccccc;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* File tree items */
.tree-item {
    display: flex;
    align-items: center;
    padding: 4px 8px 4px 0;
    cursor: pointer;
    font-size: 13px;
    line-height: 22px;
    white-space: nowrap;
    position: relative;
}

    .tree-item:hover {
        background-color: #2a2d2e;
    }

    .tree-item.selected {
        background-color: #094771;
        color: #ffffff;
    }

    .tree-item.active {
        background-color: #0e639c;
        color: #ffffff;
    }

    /* Indentation for nested items */
    .tree-item[data-level="0"] {
        padding-left: 8px;
    }

    .tree-item[data-level="1"] {
        padding-left: 28px;
    }

    .tree-item[data-level="2"] {
        padding-left: 48px;
    }

/* Folder icons and expand/collapse */
.tree-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .tree-icon.folder {
        color: #dcb67a;
    }

        .tree-icon.folder.expanded {
            color: #dcb67a;
        }

    .tree-icon.file {
        color: #519aba;
    }

.expand-arrow {
    position: absolute;
    left: 8px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cccccc;
    transition: transform 0.1s ease;
}

    .expand-arrow.expanded {
        transform: rotate(90deg);
    }

.tree-item[data-level="1"] .expand-arrow {
    left: 28px;
}

/* Tree item content */
.tree-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-filename {
    color: #858585;
    font-size: 11px;
    margin-left: 8px;
}

/* Folder states */
.folder-item {
    font-weight: 500;
}

    .folder-item.collapsed + .folder-children {
        display: none;
    }

.folder-children {
    display: block;
}

/* Video file styling */
.video-item .tree-icon {
    color: #ff6b6b;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        order: -1;
        max-height: 250px;
        border-right: none;
        border-bottom: 1px solid #3e3e42;
    }

    .header {
        padding: 1rem;
    }

    .video-section {
        padding: 1rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #4f4f4f;
    }

/* Performance optimizations */
.video-section,
.sidebar {
    contain: layout style paint;
}

.file-tree {
    contain: layout style;
}

/* Icons using CSS */
.tree-icon::before {
    font-size: 16px;
    line-height: 1;
}

.tree-icon.folder::before {
    content: "📁";
}

.tree-icon.folder.expanded::before {
    content: "📂";
}

.tree-icon.file::before {
    content: "🎬";
}

.expand-arrow::before {
    content: "▶";
    font-size: 10px;
    color: #cccccc;
}
