:root {
    --bg-color: #121212;
    --sidebar-bg: #1e1e1e;
    --item-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --accent-color: #bb86fc;
    --secondary-color: #03dac6;
    --danger-color: #cf6679;
    --border-color: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    overflow: hidden;
}

/* Login Screen */
#login-view {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.login-box {
    background-color: var(--sidebar-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    width: 300px;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background-color: var(--item-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
}

.login-box button {
    width: 100%;
    padding: 10px;
    background-color: var(--accent-color);
    border: none;
    color: #000;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

/* Main Layout */
#main-view {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

#content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sidebar */
.sidebar-header {
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}

.nav-item {
    padding: 10px 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.playlist-list {
    flex: 1;
    overflow-y: auto;
}

.playlist-item {
    padding: 8px 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.delete-btn {
    color: var(--danger-color);
    cursor: pointer;
    font-size: 0.8rem;
}

/* Content Area */
.toolbar {
    padding: 1rem;
    background-color: var(--bg-color);
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
}

.toolbar input {
    flex: 1;
    padding: 8px;
    background-color: var(--item-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
}

.record-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.record-item {
    background-color: var(--item-bg);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-info {
    flex: 1;
}

.record-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.record-meta {
    font-size: 0.8rem;
    color: #aaa;
}

.record-actions button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
}

.record-actions button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Player Bar */
#player-bar {
    height: 80px;
    background-color: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 100;
    position: relative;
}

.player-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.player-controls i {
    font-size: 1.5rem;
    cursor: pointer;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.player-title {
    font-weight: bold;
    font-size: 0.9rem;
}

.player-time {
    font-size: 0.8rem;
    color: #aaa;
}

.player-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 5px;
}

#seek-bar {
    flex: 1;
    cursor: pointer;
    accent-color: var(--accent-color);
}

#current-time,
#total-duration {
    font-size: 0.8rem;
    color: #aaa;
    min-width: 35px;
    text-align: center;
}

/* Mobile Responsive */
.mobile-menu-btn {
    display: none;
    float: right;
    cursor: pointer;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
        background-color: var(--item-bg);
        border-bottom: 1px solid var(--border-color);
    }

    #main-view {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .record-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .record-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
}

.hidden {
    display: none !important;
}
.record-item.dragging {
    opacity: 0.4;
    border: 2px dashed #ccc;
}

.record-item.over {
    border-top: 2px solid #007bff;
}

.record-item[draggable='true'] {
    cursor: move;
}
