/* css/style.css */
:root {
    --bg-color: #0f0f13;
    --text-color: #ffffff;
    --primary-color: #6c5ce7;
    --primary-hover: #5b4cc4;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

/* Utilities */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: var(--glass-bg);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn.small {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.btn.full-width {
    width: 100%;
    margin-top: 10px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: white;
}

.icon-btn.trash:hover {
    color: #ff6b6b;
}

input[type="text"] {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px;
    border-radius: 8px;
    width: 100%;
    outline: none;
    font-family: inherit;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge.host {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.hidden {
    display: none !important;
}

/* Screens */
.screen {
    display: none;
    height: 100%;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Landing */
#landing {
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a1a2e 0%, #0f0f13 100%);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

#landing h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #6c5ce7, #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#landing p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

#landing .actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 300px;
}

.divider {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 5px 0;
}

/* Room Layout */
.navbar {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(15, 15, 19, 0.8);
}

.logo {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.room-info {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
}

.room-info span.id-box {
    font-family: monospace;
    background: var(--glass-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
}

.container {
    display: flex;
    height: calc(100% - 60px);
    gap: 20px;
    padding: 20px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.username-input {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    width: 200px;
}

.username-input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

.username-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.user-badge-container {
    position: relative;
    display: inline-block;
}

.user-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: rgba(15, 15, 19, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    min-width: 150px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.user-tooltip .u-item {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.user-tooltip .u-item:last-child {
    border-bottom: none;
}

.user-badge-container:hover .user-tooltip {
    display: block !important;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.video-container iframe,
.video-container #player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* transparent enough to see video, but blocks clicks? 
       Actually, standard youtube controls might sit above this if using iframe API.
       The youtube iframe usually eats events. 
       Best way is to use 'pointer-events: none' on iframe if we want to block, 
       but that stops play button too.
       
       We'll try to just rely on JS reverting state, 
       but for UI feedback, a small non-blocking toast is better.
    */
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: start;
    padding-top: 20px;
}

.overlay .msg {
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.controls-bar {
    padding: 10px;
}

.sidebar {
    width: 350px;
    display: flex;
    flex-direction: column;
}

.queue-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100%;
}

.now-playing {
    background: rgba(108, 92, 231, 0.2);
    border: 1px solid rgba(108, 92, 231, 0.4);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.now-playing .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    font-weight: 600;
}

.now-playing .info {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.queue-header h3 {
    font-size: 1.1rem;
}

.add-video {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.queue-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
}

.queue-list::-webkit-scrollbar {
    width: 6px;
}

.queue-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.queue-list li {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.queue-list li:hover {
    background: rgba(255, 255, 255, 0.08);
}

.queue-list li img {
    width: 40px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.empty-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 20px 0;
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 10px;
        overflow-y: auto;
    }

    .sidebar {
        width: 100%;
        height: 400px;
        /* Fixed height for queue on mobile */
    }
}