:root {
    /* Brand colors */
    --color-brand: #8251EE;
    --color-brand-hover: #9366F5;

    /* Neutral backgrounds */
    --color-bg-1: hsl(240, 6%, 10%);
    --color-bg-2: hsl(240, 5%, 12%);
    --color-bg-3: hsl(240, 5%, 16%);

    /* Text colors */
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #A1A1AA;
    --color-text-muted: #71717A;

    /* Status */
    --color-success: #10B981;
    --color-danger: #EF4444;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--color-bg-1);
    color: var(--color-text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
    /* Subtle background texture for depth */
    background-image: radial-gradient(circle at top right, rgba(130, 81, 238, 0.15), transparent 40%),
        radial-gradient(circle at bottom left, rgba(130, 81, 238, 0.05), transparent 40%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    margin: 0;
}

#app {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Main Video Area */
#video-container {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #000;
    z-index: 1;
}

#player {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 100vh;
}

#overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#overlay.hidden {
    display: none;
}

#overlay button {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    background: var(--color-brand);
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(130, 81, 238, 0.4);
    transition: all 0.2s ease;
}

#overlay button:hover {
    background: var(--color-brand-hover);
    transform: scale(1.05);
}

#empty-state-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    color: var(--color-text-secondary);
}

#empty-state-overlay.hidden {
    display: none;
}

#empty-state-overlay h2 {
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

#admin-controls {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    gap: 10px;
    animation: slideUp 0.3s ease-out forwards;
}

#admin-controls.hidden {
    display: none;
}

.admin-btn {
    background: var(--color-bg-3);
    color: var(--color-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#btn-admin-skip:hover {
    background: #F59E0B;
    color: #fff;
}

#btn-admin-clear:hover {
    background: var(--color-danger);
    color: #fff;
}

#btn-admin-lock {
    background: rgba(130, 81, 238, 0.2);
    color: var(--color-brand-light);
    border: 1px solid rgba(130, 81, 238, 0.4);
}

#btn-admin-lock:hover {
    background: var(--color-brand);
    color: #fff;
}

/* Sidebar - Glassmorphism */
#sidebar {
    width: 380px;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 20;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

header h2 {
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

#connection-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    color: var(--color-text-secondary);
}

#connection-status.connected {
    color: var(--color-success);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

#now-playing {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
}

#now-playing h3 {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

#now-playing p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-brand-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#queue-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#queue-section h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

#queue-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 8px;
}

/* Custom Scrollbar for Queue List */
#queue-list::-webkit-scrollbar {
    width: 6px;
}

#queue-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

#queue-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#queue-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.queue-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Fractional specific styling */
.queue-item.draggable {
    cursor: grab;
}

.queue-item.draggable:active {
    cursor: grabbing;
}

.queue-item.dragging {
    opacity: 0.5;
    background: rgba(130, 81, 238, 0.1);
    border-color: var(--color-brand);
}

.queue-item.drag-over {
    border-top: 2px solid var(--color-brand);
}

.queue-item.draggable::before {
    content: "≡";
    color: var(--color-text-muted);
    font-size: 1.2rem;
    cursor: grab;
}

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

.btn-remove-item {
    background: transparent;
    border: none;
    color: var(--color-danger);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 0 4px;
}

.btn-remove-item:hover {
    transform: scale(1.2);
}

.queue-item:hover .btn-remove-item {
    opacity: 1;
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--color-brand);
}

#add-queue-form {
    display: flex;
    margin-top: 20px;
    position: relative;
}

#add-queue-form input {
    flex-grow: 1;
    padding: 12px 16px;
    padding-right: 80px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

#add-queue-form input:focus {
    border-color: var(--color-brand);
    background: rgba(0, 0, 0, 0.5);
}

#add-queue-form button {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    padding: 0 16px;
    background: var(--color-brand);
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#add-queue-form button:hover {
    background: var(--color-brand-hover);
}

footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

#btn-login {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

#btn-login:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}