html, body {
    height: 100%;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    background-color: #000;
}

.vh-100 {
    height: 100dvh !important;
}

/* Video Player Area */
#dplayer-container {
    width: 100%;
    background-color: #000;
    flex: 1 1 auto;
    min-height: 0;
}

#dplayer, #dplayer-mobile {
    height: 100% !important;
    width: 100% !important;
}

/* Zones & Modules */
.module-zone {
    background-color: #1a1d20;
    transition: all 0.2s ease;
}

.draggable-module {
    background-color: #212529;
    transition: opacity 0.2s;
}

.module-header {
    cursor: grab;
    user-select: none;
}

.module-drag-handle {
    cursor: grab;
    color: #6c757d;
}

.module-drag-handle:active, .module-header:active {
    cursor: grabbing;
}

.cursor-grab {
    cursor: grab;
}

/* Layout Expansion & Zone Visibility Management */
.zone-hidden {
    display: none !important;
}

/* During dragging, show hidden zones so they can be drop targets */
body.dragging-active .zone-hidden {
    display: flex !important;
    background-color: rgba(13, 110, 253, 0.05) !important;
    border: 2px dashed rgba(13, 110, 253, 0.3) !important;
}

/* Ensure resizers also show up during dragging if their zone is hidden */
body.dragging-active #resizer-v.zone-hidden,
body.dragging-active #resizer-h-sidebar.zone-hidden {
    display: block !important;
}

/* Resizers */
.resizer-h {
    width: 4px;
    background: rgba(255, 255, 255, 0.05);
    cursor: col-resize;
    z-index: 10;
    flex: 0 0 4px;
}
.resizer-h:hover, .resizer-h.resizing {
    background: rgba(13, 110, 253, 0.5) !important;
}

.resizer-v {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    cursor: row-resize;
    z-index: 10;
    flex: 0 0 4px;
}
.resizer-v:hover, .resizer-v.resizing {
    background: rgba(13, 110, 253, 0.5) !important;
}

#main-column {
    min-width: 0;
    min-height: 0;
    flex: 1 1 0%;
}

/* Hide border when sidebar is hidden */
#main-column.no-sidebar {
    border-right: none !important;
}

body.resizing {
    cursor: move;
    user-select: none;
}
body.resizing * {
    pointer-events: none !important;
}

/* Mobile Tab Styles */
.nav-tabs .nav-link {
    color: #6c757d;
}
.nav-tabs .nav-link.active {
    color: #0d6efd !important;
    background-color: transparent !important;
    border-bottom: 2px solid #0d6efd !important;
}
.nav-tabs .nav-link.active i {
    color: #0d6efd !important;
}

/* Sortable Customization */
.sortable-ghost {
    opacity: 0.2;
    background-color: #0d6efd !important;
}

/* Chat Messages */
.chat-msg {
    margin-bottom: 6px;
    word-break: break-all;
    line-height: 1.4;
}
.chat-msg .sender {
    font-weight: bold;
    font-size: 0.85rem;
    margin-right: 6px;
}
.chat-msg .text {
    font-size: 0.9rem;
    color: #f8f9fa;
}
.system-msg {
    background-color: rgba(255, 193, 7, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
    margin: 8px 0;
}
.system-msg i {
    width: 16px;
    text-align: center;
}

/* Playlist & Search */
.playlist-item {
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border-color: #2d3238 !important;
    padding: 8px 12px;
    color: #8a8e94 !important;
    background-color: transparent !important;
}
.playlist-item.active {
    background-color: rgba(13, 110, 253, 0.15) !important;
    border-left: 4px solid #0d6efd !important;
    color: #0d6efd !important;
}
.playlist-item:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ced4da !important;
}

.playlist-item .drag-handle {
    cursor: grab;
    color: #495057;
}

/* Accordion */
.accordion-button::after {
    filter: invert(1);
    transform: scale(0.7);
}
.accordion-item {
    border-color: #2d3238 !important;
}

/* Utility */
.btn-xs {
    font-size: 0.7rem;
    padding: 1px 5px;
}
.cursor-pointer {
    cursor: pointer;
}
