/* assets/css/style.css - Modern Studio Dark Theme */

@import url('https://fonts.cdnfonts.com/css/aller');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4, .app-header h1, .track-details h2 {
    font-family: 'Aller', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Custom Studio Dark Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0d0d0f;
}
::-webkit-scrollbar-thumb {
    background: #25252a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #00e676;
}

body {
    background-color: #0b0b0d;
    color: #e1e1e6;
    height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 0%, rgba(0, 230, 118, 0.03) 0%, transparent 60%);
}

/* Master Layout Grid — 3-pane workspace (sidebar · library · pitch drawer) */
.app-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #0b0b0d;
    position: relative;
}

/* Collapsible Studio Sidebar (Total Collapse with Edge Floating Trigger) */
/* Slim Icon-Rail Collapsed Sidebar */
.sidebar {
    width: 250px;
    background: #121215;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease;
    flex-shrink: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
    z-index: 10;
    position: relative;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 64px !important;
    min-width: 64px !important;
    padding: 1.25rem 0.5rem !important;
}

/* Hide all text, search boxes, and list elements when collapsed */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-search-wrap,
.sidebar.collapsed .playlist-accordion-content,
.sidebar.collapsed .playlist-arrow,
.sidebar.collapsed .user-profile-box,
.sidebar.collapsed .sidebar-section,
.sidebar.collapsed .sidebar-title {
    display: none !important;
}

/* Center the toggle button neatly inside the top of the slim rail */
.sidebar.collapsed .sidebar-header {
    justify-content: center !important;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
}

.sidebar.collapsed .btn-toggle-sidebar {
    background: #141418;
    border: 1px solid rgba(0, 230, 118, 0.4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.7);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-toggle-sidebar {
    background: #1a1a1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #00e676;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-toggle-sidebar:hover {
    background: #222228;
    border-color: #00e676;
    transform: scale(1.05);
}

.sidebar-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #8f8f9d;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: #8f8f9d;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: #18181c;
    color: #fff;
}

.nav-item.active {
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.5rem;
    color: #8f8f9d;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.btn-mini-add {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #00e676;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-mini-add:hover {
    background: #00e676;
    color: #121215;
}

/* Sidebar Playlist Search Input */
.sidebar-search-wrap {
    margin-bottom: 0.4rem;
}

.sidebar-search-input {
    width: 100%;
    background: #0d0d0f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-search-input:focus {
    border-color: #00e676;
}

.sidebar-playlists {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Sidebar Playlist Accordion Styles */
.playlist-accordion-group {
    display: flex;
    flex-direction: column;
}

.playlist-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-share-playlist {
    background: transparent;
    border: none;
    color: #8f8f9d;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-share-playlist:hover {
    color: #00e676;
    background: rgba(0, 230, 118, 0.1);
}

.playlist-arrow {
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    color: #666;
    font-size: 0.7rem;
    transition: transform 0.2s, color 0.2s;
}

.playlist-arrow:hover {
    color: #00e676;
}

.playlist-accordion-group.open .playlist-arrow {
    transform: rotate(90deg);
    color: #00e676;
}

.playlist-accordion-content {
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    padding-left: 2.1rem;
    padding-right: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.2rem;
    margin-bottom: 0.4rem;
}

.playlist-accordion-group.open .playlist-accordion-content {
    display: flex;
}

/* Sub-Track Items styled with border-free custom micro font style */
.sub-track-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    padding: 0.15rem 0.2rem;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    line-height: 1.5;
    color: #8f8f9d;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
}

.sub-track-item:hover, .sub-track-item.active {
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
}

/* Main Workspace */
.main-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding: 1.75rem 2.25rem;
    position: relative;
}

.app-header {
    margin-bottom: 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 1.25rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-logo {
    display: inline-block;
    height: 40px;
    width: 140px;
    background-color: #00e676;
    -webkit-mask-image: url('../logo.png');
    mask-image: url('../logo.png');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    filter: drop-shadow(0 0 8px rgba(0, 230, 118, 0.4));
}

.app-header h1 {
    font-size: 1.6rem;
    color: #00e676;
    letter-spacing: -0.02em;
}

/* Glassmorphic Audio Player Card */
.player-card {
    background: #141418;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 2.25rem;
    box-shadow: 0 12px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

.player-header-flex {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
}

.artwork-preview {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    background: #0b0b0d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.6);
}

.artwork-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-details h2 {
    font-size: 1.45rem;
    margin-bottom: 0.25rem;
    color: #fff;
}

.track-details p {
    color: #8f8f9d;
    font-size: 0.95rem;
}

.album-tag {
    font-size: 0.85rem;
    font-style: italic;
    color: #00e676 !important;
    margin-bottom: 0.4rem;
}

.track-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.tag-badge {
    background: rgba(255, 255, 255, 0.05);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* Recessed Waveform Container */
.waveform-box {
    background: #0a0a0c;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

/* Player Control Buttons */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.btn-control {
    background: #1a1a1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #8f8f9d;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-control:hover {
    background: #222228;
    color: #fff;
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-control.active-toggle {
    color: #00e676;
    background: rgba(0, 230, 118, 0.12);
    border-color: #00e676;
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.2);
}

.btn-play-main {
    background: #00e676;
    color: #0b0b0d;
    width: 52px;
    height: 52px;
    border: none;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.4);
}

.btn-play-main:hover {
    background: #00c853;
    color: #0b0b0d;
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.6);
}

.repeat-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #00e676;
}

/* Volume Slider Bar */
.volume-container {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #0a0a0c;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-left: 0.5rem;
}

.btn-mute {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #8f8f9d;
    display: flex;
    align-items: center;
}

.btn-mute:hover {
    color: #00e676;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 4px;
    border-radius: 2px;
    background: #222228;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #00e676;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.6);
}

/* Main Tracklist View Controls */
.playlist-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    background: #141418;
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #0a0a0c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.45rem 0.85rem;
    border-radius: 20px;
}

.search-input {
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    font-size: 0.85rem;
    width: 190px;
}

.search-input::placeholder {
    color: #666;
}

.playlist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Track Row Item */
.track-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #141418;
    padding: 0.7rem 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.track-item:hover {
    background: #1a1a1e;
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.track-item.active {
    border-color: #00e676;
    background: #18181c;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.1);
}

.track-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.track-item-art {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    object-fit: cover;
    background: #0a0a0c;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.track-checkbox {
    accent-color: #00e676;
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.track-meta {
    display: flex;
    flex-direction: column;
}

.track-title {
    font-weight: 700;
    color: #fff;
}

.track-sub {
    font-size: 0.83rem;
    color: #8f8f9d;
}

.track-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.track-actions button svg {
    flex-shrink: 0;
}

/* Action Buttons */
.btn-export-single, .btn-edit, .btn-add-p, .btn-delete {
    background: #1a1a1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #8f8f9d;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
}

.btn-export-single {
    color: #00e676;
    border-color: rgba(0, 230, 118, 0.2);
}

.btn-export-single:hover {
    background: #00e676;
    color: #0b0b0d;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
}

.btn-edit:hover, .btn-add-p:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    background: #222228;
}

.btn-delete {
    padding: 0.35rem 0.5rem;
}

.btn-delete:hover {
    color: #ff5555;
    border-color: rgba(255, 85, 85, 0.3);
    background: rgba(255, 85, 85, 0.1);
}
/* ==========================================================
    DYNAMIC TWO-LAYER BOTTOM CONTROL CENTER
   ========================================================== */

#batch-action-bar, .batch-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #141417;
    border-top: 1px solid #29292e;
    border-bottom: 1px solid #29292e;
    padding: 0.6rem 2rem;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.25s ease;
    z-index: 9998;
}

#batch-action-bar.visible, .batch-bar.visible {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

body.mini-active #batch-action-bar, 
body.mini-active .batch-bar {
    bottom: 52px; /* Lifts up cleanly if the sticky mini player is active */
}

.batch-bar .batch-info {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #00e676;
    background: rgba(0, 230, 118, 0.1);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(0, 230, 118, 0.25);
}

.batch-bar .batch-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Crucial: Add breathing room at the bottom of your track list so rows/buttons aren't hidden */
#playlist-container {
    padding-bottom: 110px !important;
}

/* Modern Primary Action Button */
.btn-primary-action {
    background-color: #00e676;
    color: #0b0b0d;
    font-family: 'Aller', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0.8rem 1.25rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
}

.btn-primary-action:hover {
    background-color: #00c853;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 230, 118, 0.45);
}

.btn-upload {
    background-color: #00e676;
    color: #0b0b0d;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: bold;
    display: inline-block;
    transition: all 0.2s;
}

.btn-upload:hover {
    background-color: #00c853;
}

.btn-secondary {
    background: #1a1a1e;
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.btn-secondary:hover {
    background: #00e676;
    color: #0b0b0d;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #141418;
    padding: 1.75rem;
    border-radius: 12px;
    width: 90%;
    max-width: 460px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
}

.modal-art-box {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    background: #0d0d0f;
    padding: 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-art-box img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-btn {
    position: absolute;
    right: 1.25rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #8f8f9d;
    transition: color 0.15s;
}

.close-btn:hover {
    color: #fff;
}

.modal-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0d0d0f;
    color: #fff;
    margin-top: 0.25rem;
    outline: none;
    transition: border-color 0.2s;
}

.modal-input:focus {
    border-color: #00e676;
}

/* Checkbox Playlist Modal Styles */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    background: #0d0d0f;
    padding: 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.checkbox-item:hover {
    background: #141418;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00e676;
    cursor: pointer;
}

/* Sync Metadata Tags on Library Rows */
.track-sync-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.sync-badge {
    background: rgba(0, 230, 118, 0.04);
    color: #a8a8b3;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.sync-badge strong {
    color: #00e676;
    font-weight: 600;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media screen and (max-width: 1024px) {
    .app-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100% !important;
        height: auto;
        max-height: 250px;
        overflow-y: auto;
    }
    
    .sidebar.collapsed {
        width: 100% !important;
        max-height: 60px;
    }

    .main-wrapper {
        width: 100%;
        padding: 1.25rem 1rem;
    }

    .track-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .track-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

@media screen and (max-width: 768px) {
    .app-header {
        padding: 0.5rem 0.75rem !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .app-header h1 {
        font-size: 1.2rem !important;
    }

    .header-brand {
        gap: 0.75rem;
    }

    .header-logo {
        width: 90px;
        height: 28px;
    }

    .app-header > a.btn-primary-action {
        width: 100% !important;
        margin-top: 0 !important;
        padding: 0.45rem !important;
        font-size: 0.8rem !important;
    }

    .player-header-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .playlist-header-bar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }

    .playlist-header-bar > div {
        flex-wrap: wrap;
    }

    .batch-bar {
        padding: 0.6rem 1rem;
        flex-direction: column;
        gap: 0.6rem;
    }
    
    .batch-bar > div {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===================================================
   3-PANE WORKSPACE LAYOUT (DISCO WORKSPACE)
   =================================================== */

.app-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #0b0b0d;
}

.main-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

/* Right Pane (Pitch Builder Drawer) with Dynamic Height Handling */
.pitch-drawer-pane {
    width: 320px;
    background: #141417;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    max-height: 100vh;
    box-sizing: border-box;
    z-index: 70;
    transition: height 0.25s ease, max-height 0.25s ease;
    overflow-y: auto;
}

/* When Mini Player is active at the bottom (~52px) */
body.mini-active .pitch-drawer-pane {
    height: calc(100vh - 52px);
    max-height: calc(100vh - 52px);
}

/* When Batch Action Bar (2nd layer) is active (~70px) */
body.batch-bar-active .pitch-drawer-pane {
    height: calc(100vh - 70px);
    max-height: calc(100vh - 70px);
}

/* When BOTH Mini Player and Batch Action Bar are active simultaneously (~122px) */
body.mini-active.batch-bar-active .pitch-drawer-pane {
    height: calc(100vh - 122px);
    max-height: calc(100vh - 122px);
}

/* Drag and Drop Pitch Builder States */
.drop-zone {
    flex: 1;
    min-height: 90px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    border-color: #00e676 !important;
    background: rgba(0, 230, 118, 0.08) !important;
}

/* Track Row Dragging Visual Feedback */
.track-item.dragging {
    opacity: 0.4;
    background: rgba(0, 230, 118, 0.1) !important;
    border: 1px dashed #00e676 !important;
}

.track-item.drag-over {
    border-top: 2px solid #00e676 !important;
}

.track-drag-handle {
    cursor: grab;
    color: #555;
    font-weight: bold;
    user-select: none;
    transition: color 0.15s ease;
}

.track-item:hover .track-drag-handle {
    color: #00e676;
}

/* Pitched Track Item Cards */
.pitch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #fff;
    gap: 0.5rem;
}

.pitch-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.pitch-item-remove {
    background: transparent;
    border: none;
    color: #8f8f9d;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.2rem;
    transition: color 0.15s ease;
}

.pitch-item-remove:hover {
    color: #ff5555;
}

.playlist-arrow {
    transition: transform 0.2s ease;
}
.playlist-accordion-group.open .playlist-arrow {
    transform: rotate(90deg);
}

/* Custom Styling for Wavesurfer Regions */
[data-region] {
    border-left: 2px solid #00e676 !important;
    border-right: 2px solid #00e676 !important;
    background-color: rgba(0, 230, 118, 0.35) !important;
}

.track-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.track-actions .btn-export-single {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a8a8b3;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.track-actions .btn-export-single:hover {
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
    border-color: rgba(0, 230, 118, 0.4);
}

/* Mobile Hamburger Toggle Button */
#btn-mobile-menu-toggle {
    display: none;
    background: #1a1a1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #00e676;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* Sticky Horizontal Mini Player Bar */
.mini-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(18, 18, 20, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 230, 118, 0.3);
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    z-index: 85;
    opacity: 0;
    pointer-events: none;
    transform: translateY(100px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.7);
    box-sizing: border-box;
}

.mini-player-bar.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Responsive mobile scaling for layout */
@media screen and (max-width: 1280px) {
    .pitch-drawer-pane {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .app-header {
        padding: 0.5rem 0.75rem !important;
        flex-direction: row !important;
        gap: 0.5rem;
    }
    .app-header h1 {
        font-size: 1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-brand {
        gap: 0.5rem !important;
        min-width: 0;
    }
    .header-logo {
        width: 70px !important;
        height: 22px !important;
    }
    .app-header > a.btn-primary-action {
        padding: 0.3rem 0.55rem !important;
        font-size: 0.73rem !important;
        width: auto !important;
        margin-top: 0 !important;
        flex-shrink: 0;
        gap: 0.25rem !important;
        white-space: nowrap;
    }
    .app-header > a.btn-primary-action svg {
        width: 13px !important;
        height: 13px !important;
    }
    .mini-player-bar {
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }
    .mini-waveform-container {
        display: none !important;
    }
}

@media screen and (max-width: 1024px) {
    #btn-mobile-menu-toggle {
        display: flex;
    }
    aside.sidebar.mobile-collapsed .user-profile-box,
    aside.sidebar.mobile-collapsed .sidebar-nav,
    aside.sidebar.mobile-collapsed .sidebar-section {
        display: none !important;
    }
    aside.sidebar.mobile-collapsed {
        width: 100% !important;
        height: auto !important;
        padding: 0.75rem 1rem !important;
    }
    aside.sidebar {
        width: 100% !important;
        max-height: 85vh;
        overflow-y: auto;
    }
}

/* Style for Clear Pitch Workspace / Clear Queue Button */
#btn-clear-pitch, 
.btn-clear-pitch,
#clear-pitch-btn {
    background: #1a1a1e;
    color: #ff5555;
    border: 1px solid rgba(255, 85, 85, 0.3);
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    margin-top: 0.5rem;
    transition: all 0.15s ease;
}

#btn-clear-pitch:hover, 
.btn-clear-pitch:hover,
#clear-pitch-btn:hover {
    background: rgba(255, 85, 85, 0.15);
    border-color: #ff5555;
    color: #ff5555;
}