/* Layout - container, header, grid structure */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

h1:hover {
    opacity: 0.8;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--color-primary);
    color: #000;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: bold;
}

.header-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-btn {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
}

.header-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Player mode layout */
.layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
    /* On mobile: player first, file browser second */
    .player-section {
        order: 1;
    }
    .file-browser {
        order: 2;
    }
}

/* File Browser Sidebar */
.file-browser {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.file-browser-header {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.file-list {
    max-height: 70vh;
    overflow-y: auto;
}

@media (max-width: 900px) {
    .file-list {
        max-height: 50vh;
    }
}

.file-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: background 0.2s;
}

.file-item:hover {
    background: var(--color-surface-hover);
}

.file-item.active {
    background: rgba(77, 171, 247, 0.2);
    border-left: 3px solid var(--color-primary);
}

.file-item.folder {
    color: var(--color-warning);
}

.file-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.file-name {
    flex: 1;
    font-size: 0.9rem;
    word-break: break-word;
    line-height: 1.3;
}

.file-size {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.sidebar-breadcrumb {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.1);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.sidebar-breadcrumb span {
    cursor: pointer;
    color: var(--color-primary);
}

.sidebar-breadcrumb span:hover {
    text-decoration: underline;
}

/* Loading & Empty States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--color-text-muted);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--color-text-dim);
    text-align: center;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
