* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #ff4757;
    --primary-dark: #ff2e43;
    --secondary: #3742fa;
    --dark: #1a1a1a;
    --darker: #0f0f0f;
    --light: #f8f9fa;
    --gray: #6c757d;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    background: var(--darker);
    color: var(--light);
    overflow-x: hidden;
}

/* Screens */
.screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.hidden {
    display: none !important;
}

/* Login Screen - Make scrollable */
#loginScreen {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
}

.login-container {
    background: var(--dark);
    padding: clamp(20px, 5vw, 40px);
    border-radius: clamp(15px, 3vw, 20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 500px;
    text-align: center;
    margin: auto;
    margin-top: 10vh;
    margin-bottom: 10vh;
}

.login-header {
    margin-bottom: clamp(25px, 6vw, 40px);
}

.login-header h1 {
    color: var(--primary);
    font-size: clamp(1.8em, 5vw, 2.5em);
    margin-bottom: 10px;
    line-height: 1.2;
}

.login-header p {
    color: var(--gray);
    font-size: clamp(0.9em, 3vw, 1.1em);
}

.input-group {
    background: var(--darker);
    border-radius: clamp(8px, 2vw, 10px);
    padding: clamp(12px, 3vw, 15px);
    margin-bottom: clamp(15px, 4vw, 20px);
    display: flex;
    align-items: center;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.input-group:focus-within {
    border-color: var(--primary);
}

.input-group i {
    color: var(--gray);
    margin-right: clamp(10px, 3vw, 15px);
    font-size: clamp(1em, 3vw, 1.2em);
}

.input-group input {
    background: none;
    border: none;
    color: var(--light);
    font-size: clamp(0.95em, 3vw, 1.1em);
    width: 100%;
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: clamp(12px, 3vw, 15px) clamp(20px, 5vw, 30px);
    border-radius: clamp(8px, 2vw, 10px);
    font-size: clamp(0.95em, 3vw, 1.1em);
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2vw, 10px);
    transition: all 0.3s;
    margin-bottom: clamp(15px, 4vw, 20px);
    min-height: 48px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    border: none;
    padding: clamp(10px, 2.5vw, 12px) clamp(15px, 4vw, 25px);
    border-radius: clamp(8px, 2vw, 10px);
    font-size: clamp(0.9em, 2.5vw, 1em);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 1.5vw, 8px);
    transition: all 0.3s;
    min-height: 44px;
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.guest-login {
    margin-top: clamp(20px, 5vw, 30px);
    padding-top: clamp(15px, 4vw, 30px);
    border-top: 1px solid var(--gray);
}

.guest-login p {
    margin-bottom: clamp(10px, 3vw, 15px);
    color: var(--light);
    font-size: clamp(0.9em, 2.5vw, 1em);
}

.guest-login input {
    width: 100%;
    padding: clamp(10px, 2.5vw, 12px);
    margin-bottom: clamp(12px, 3vw, 15px);
    background: var(--darker);
    border: 2px solid var(--gray);
    border-radius: clamp(6px, 1.5vw, 8px);
    color: var(--light);
    font-size: clamp(0.9em, 2.5vw, 1em);
    min-height: 44px;
}

.login-footer {
    margin-top: clamp(20px, 5vw, 30px);
    color: var(--gray);
    font-size: clamp(0.8em, 2vw, 0.9em);
    line-height: 1.4;
}

/* Main App - Keep original structure but make scrollable */
#mainApp {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* App Header - Keep fixed */
.app-header {
    background: var(--dark);
    padding: clamp(10px, 2.5vw, 15px) clamp(15px, 3vw, 30px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary);
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
    z-index: 100;
    position: relative;
}

.header-left h1 {
    color: var(--primary);
    font-size: clamp(1.3em, 4vw, 1.8em);
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
}

.user-status {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    margin-top: 3px;
    flex-wrap: wrap;
}

#userRole {
    background: var(--primary);
    padding: clamp(4px, 1vw, 5px) clamp(10px, 2.5vw, 15px);
    border-radius: 20px;
    font-size: clamp(0.75em, 2vw, 0.9em);
    font-weight: bold;
    white-space: nowrap;
}

.status-indicator {
    width: clamp(8px, 2vw, 10px);
    height: clamp(8px, 2vw, 10px);
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-right {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2.5vw, 20px);
    flex-wrap: wrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    background: var(--darker);
    padding: clamp(6px, 1.5vw, 8px) clamp(10px, 2.5vw, 15px);
    border-radius: 20px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info i {
    font-size: clamp(1.2em, 3vw, 1.5em);
    color: var(--primary);
    flex-shrink: 0;
}

.btn-small {
    background: var(--gray);
    color: white;
    border: none;
    padding: clamp(6px, 1.5vw, 8px) clamp(10px, 2.5vw, 15px);
    border-radius: clamp(6px, 1.5vw, 8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 5px);
    transition: all 0.3s;
    font-size: clamp(0.8em, 2vw, 0.9em);
    min-height: 36px;
    white-space: nowrap;
}

.btn-small:hover {
    background: var(--primary);
}

/* Main Content - Scrollable container */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: clamp(10px, 2.5vw, 20px);
    background: var(--darker);
    gap: clamp(10px, 2.5vw, 20px);
}

/* Desktop Layout - Side by side */
@media (min-width: 769px) {
    .app-container {
        flex-direction: row;
    }
    
    .main-content {
        flex: 3;
        display: flex;
        flex-direction: column;
        gap: clamp(10px, 2.5vw, 20px);
        overflow-y: auto;
    }
    
    .chat-section {
        flex: 1;
        min-width: 350px;
        max-width: 500px;
        display: flex;
        flex-direction: column;
        background: var(--dark);
        border-left: 2px solid var(--darker);
        border-radius: clamp(10px, 2.5vw, 15px);
        overflow: hidden;
        transition: all 0.3s ease;
    }
}

/* Mobile Layout - Stacked with chat at bottom */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        padding: 0;
    }
    
    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: clamp(10px, 2.5vw, 20px);
        overflow-y: auto;
        gap: clamp(10px, 2.5vw, 20px);
    }
    
    .chat-section {
        width: 100%;
        display: flex;
        flex-direction: column;
        background: var(--dark);
        border-top: 2px solid var(--darker);
        border-radius: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        position: relative;
        max-height: 50vh;
    }
    
    .chat-section.collapsed {
        max-height: 60px !important;
        overflow: hidden;
    }
    
    .chat-section.collapsed .chat-messages,
    .chat-section.collapsed .chat-input-area {
        display: none !important;
    }
}

/* Video Section */
.video-section {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2.5vw, 20px);
}

.video-container {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2.5vw, 20px);
}

.video-player {
    flex: 0 0 auto;
    background: black;
    border-radius: clamp(10px, 2.5vw, 15px);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    min-height: 200px;
    width: 100%;
}

#youtubePlayer {
    width: 100%;
    height: 100%;
    display: none;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--gray);
    font-size: clamp(1em, 3vw, 1.5em);
    text-align: center;
    padding: 20px;
}

.video-placeholder i {
    font-size: clamp(2.5em, 8vw, 4em);
    margin-bottom: clamp(10px, 3vw, 20px);
    color: var(--gray);
}

.placeholder-sub {
    font-size: clamp(0.7em, 2vw, 0.8em);
    color: var(--gray);
    margin-top: clamp(5px, 1.5vw, 10px);
}

.video-controls {
    background: var(--dark);
    padding: clamp(12px, 3vw, 20px);
    border-radius: clamp(10px, 2.5vw, 15px);
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2.5vw, 15px);
}

@media (min-width: 768px) {
    .video-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.now-playing h3 {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    margin-bottom: clamp(5px, 1.5vw, 10px);
    font-size: clamp(0.9em, 2.5vw, 1.1em);
}

#nowPlayingTitle {
    color: var(--light);
    font-size: clamp(0.85em, 2.5vw, 1.1em);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2.5vw, 20px);
    flex-wrap: wrap;
    justify-content: center;
}

@media (min-width: 768px) {
    .player-controls {
        justify-content: flex-end;
    }
}

.btn-control {
    background: var(--primary);
    color: white;
    border: none;
    padding: clamp(8px, 2vw, 10px) clamp(12px, 3vw, 20px);
    border-radius: clamp(6px, 1.5vw, 8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 8px);
    transition: all 0.3s;
    font-size: clamp(0.85em, 2.5vw, 1em);
    min-height: 40px;
}

.btn-control:hover {
    background: var(--primary-dark);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 10px);
    color: var(--light);
    font-size: clamp(0.85em, 2.5vw, 1em);
}

#volumeSlider {
    width: clamp(60px, 20vw, 100px);
    height: 20px;
}

/* FLOATING URL INPUT FOR ADMIN */
.floating-url-input {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--dark);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    border: 2px solid var(--primary);
    min-width: 300px;
    max-width: 400px;
    cursor: move;
    user-select: none;
    backdrop-filter: blur(10px);
    transition: transform 0.3s, box-shadow 0.3s;
}

.floating-url-input:hover {
    box-shadow: 0 15px 40px rgba(255, 71, 87, 0.3);
    transform: translateY(-5px);
}

.floating-url-input.dragging {
    opacity: 0.9;
    box-shadow: 0 20px 50px rgba(255, 71, 87, 0.5);
}

.floating-url-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray);
}

.floating-url-input-header h4 {
    color: var(--warning);
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.floating-controls {
    display: flex;
    gap: 5px;
}

.floating-controls button {
    background: var(--darker);
    border: none;
    color: var(--light);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 0.9em;
}

.floating-controls button:hover {
    background: var(--primary);
    color: white;
}

.floating-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-input-group input {
    padding: 12px;
    background: var(--darker);
    border: 2px solid var(--gray);
    border-radius: 8px;
    color: var(--light);
    font-size: 0.9em;
    width: 100%;
}

.floating-input-group input:focus {
    border-color: var(--primary);
    outline: none;
}

.floating-input-group button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.floating-input-group button:hover {
    background: var(--primary-dark);
}

/* Hide original URL input when floating input is visible */
.floating-url-input-visible #videoUrl,
.floating-url-input-visible #videoTitle {
    display: none !important;
}

/* Host Controls */
.host-controls {
    background: var(--dark);
    padding: clamp(12px, 3vw, 20px);
    border-radius: clamp(10px, 2.5vw, 15px);
    margin-top: clamp(10px, 2.5vw, 20px);
}

.controls-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: clamp(15px, 3vw, 20px);
}

@media (min-width: 640px) {
    .controls-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.controls-header h3 {
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    font-size: clamp(0.95em, 2.5vw, 1.2em);
}

.badge {
    background: var(--primary);
    color: white;
    padding: clamp(4px, 1vw, 5px) clamp(10px, 2.5vw, 15px);
    border-radius: 20px;
    font-size: clamp(0.75em, 2vw, 0.9em);
    font-weight: bold;
    white-space: nowrap;
    display: inline-block;
}

.add-video-form {
    margin-bottom: clamp(15px, 3vw, 30px);
}

.input-row {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2vw, 10px);
    margin-bottom: clamp(10px, 2.5vw, 15px);
}

@media (min-width: 768px) {
    .input-row {
        display: grid;
        grid-template-columns: 2fr 1.5fr 1fr;
        gap: clamp(8px, 2vw, 10px);
    }
}

.input-row input {
    padding: clamp(10px, 2.5vw, 12px);
    background: var(--darker);
    border: 2px solid var(--gray);
    border-radius: clamp(6px, 1.5vw, 8px);
    color: var(--light);
    font-size: clamp(0.9em, 2.5vw, 1em);
    min-height: 44px;
}

.input-row input:focus {
    border-color: var(--primary);
    outline: none;
}

.quick-actions {
    display: flex;
    gap: clamp(8px, 2vw, 10px);
    flex-wrap: wrap;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: clamp(8px, 2vw, 10px) clamp(12px, 3vw, 20px);
    border-radius: clamp(6px, 1.5vw, 8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 8px);
    transition: all 0.3s;
    font-size: clamp(0.85em, 2.5vw, 1em);
    min-height: 40px;
}

.btn-danger:hover {
    opacity: 0.9;
}

.queue-section {
    background: var(--darker);
    padding: clamp(10px, 2.5vw, 15px);
    border-radius: clamp(8px, 2vw, 10px);
}

.queue-section h4 {
    color: var(--light);
    margin-bottom: clamp(10px, 2.5vw, 15px);
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    font-size: clamp(0.9em, 2.5vw, 1.1em);
}

.queue-list {
    max-height: none;
    overflow: visible;
}

.queue-item {
    background: rgba(255, 255, 255, 0.05);
    padding: clamp(10px, 2.5vw, 15px);
    margin-bottom: clamp(8px, 2vw, 10px);
    border-radius: clamp(6px, 1.5vw, 8px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s;
}

@media (min-width: 640px) {
    .queue-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.queue-item.active {
    border-left-color: var(--success);
    background: rgba(0, 184, 148, 0.1);
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-info h5 {
    color: var(--light);
    margin-bottom: 5px;
    font-size: clamp(0.85em, 2.5vw, 1em);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-info .url {
    color: var(--gray);
    font-size: clamp(0.7em, 2vw, 0.8em);
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.queue-item-info small {
    font-size: clamp(0.7em, 2vw, 0.8em);
    color: var(--gray);
    display: block;
    margin-top: 3px;
}

.queue-item-controls {
    display: flex;
    gap: clamp(4px, 1vw, 5px);
    flex-shrink: 0;
}

.queue-item-controls button {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: clamp(4px, 1vw, 5px);
    border-radius: 4px;
    transition: all 0.3s;
    font-size: clamp(0.9em, 2.5vw, 1.1em);
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.queue-item-controls button:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Section - Collapsible */
.chat-section {
    display: flex;
    flex-direction: column;
    background: var(--dark);
    border-radius: clamp(10px, 2.5vw, 15px);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Chat header with collapse button */
.chat-header {
    background: var(--darker);
    padding: clamp(12px, 3vw, 20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary);
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.3s;
}

.chat-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-header h3 {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    font-size: clamp(0.95em, 2.5vw, 1.2em);
    margin: 0;
}

.chat-header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.online-count {
    background: var(--success);
    color: white;
    padding: clamp(4px, 1vw, 5px) clamp(10px, 2.5vw, 15px);
    border-radius: 20px;
    font-weight: bold;
    font-size: clamp(0.75em, 2vw, 0.9em);
}

.collapse-toggle {
    background: none;
    border: none;
    color: var(--light);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.collapse-toggle i {
    font-size: 1.2em;
    transition: transform 0.3s;
}

.chat-section.collapsed .collapse-toggle i {
    transform: rotate(180deg);
}

/* Chat content area */
.chat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chat-section.collapsed .chat-content {
    height: 0;
    opacity: 0;
}

.chat-messages {
    flex: 1;
    padding: clamp(12px, 3vw, 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2.5vw, 15px);
    min-height: 200px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--dark);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.message {
    background: var(--darker);
    padding: clamp(10px, 2.5vw, 15px);
    border-radius: clamp(8px, 2vw, 12px);
    max-width: 85%;
    animation: slideIn 0.3s;
    word-break: break-word;
    overflow-wrap: break-word;
    flex-shrink: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user-message {
    background: var(--primary);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.system-message {
    background: var(--warning);
    color: var(--dark);
    align-self: center;
    font-style: italic;
    font-size: clamp(0.8em, 2.2vw, 0.9em);
    padding: clamp(8px, 2vw, 10px) clamp(12px, 3vw, 20px);
    text-align: center;
    max-width: 90%;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: clamp(0.7em, 2vw, 0.8em);
    color: rgba(255, 255, 255, 0.7);
    flex-wrap: wrap;
    gap: 5px;
}

.message.user-message .message-header {
    color: rgba(255, 255, 255, 0.9);
}

.message.system-message .message-header {
    color: var(--dark);
}

.message-time {
    font-size: clamp(0.65em, 1.8vw, 0.7em);
    opacity: 0.7;
}

.chat-input-area {
    padding: clamp(12px, 3vw, 20px);
    background: var(--darker);
    border-top: 2px solid var(--dark);
    flex-shrink: 0;
}

.chat-section.collapsed .chat-input-area {
    display: none;
}

.user-controls {
    display: flex;
    gap: clamp(8px, 2vw, 10px);
    margin-bottom: clamp(10px, 2.5vw, 15px);
    flex-wrap: wrap;
}

.user-controls input {
    flex: 1;
    min-width: 150px;
    padding: clamp(8px, 2vw, 10px);
    background: var(--dark);
    border: 2px solid var(--gray);
    border-radius: clamp(6px, 1.5vw, 8px);
    color: var(--light);
    font-size: clamp(0.85em, 2.5vw, 1em);
    min-height: 40px;
}

.message-input {
    display: flex;
    gap: clamp(8px, 2vw, 10px);
}

.message-input input {
    flex: 1;
    padding: clamp(10px, 2.5vw, 12px);
    background: var(--dark);
    border: 2px solid var(--gray);
    border-radius: clamp(6px, 1.5vw, 8px);
    color: var(--light);
    font-size: clamp(0.9em, 2.5vw, 1em);
    min-height: 44px;
}

.message-input input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: clamp(6px, 1.5vw, 8px);
    height: clamp(6px, 1.5vw, 8px);
}

::-webkit-scrollbar-track {
    background: var(--dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary,
    .btn-control,
    .btn-danger,
    .btn-small,
    .queue-item-controls button {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    input,
    textarea,
    select {
        font-size: 16px;
    }
    
    .queue-item-controls button {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Smooth scrolling for touch */
    #loginScreen,
    .main-content,
    .chat-messages {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    .floating-controls button {
        width: 40px;
        height: 40px;
    }
    
    .collapse-toggle {
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
    }
}

/* Small mobile devices */
@media (max-width: 375px) {
    .app-header {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    
    .header-left, .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .video-controls {
        padding: 10px;
    }
    
    .player-controls {
        justify-content: center;
    }
    
    .floating-url-input {
        min-width: 280px;
        max-width: 280px;
        right: 10px;
        bottom: 10px;
    }
    
    .chat-header {
        padding: 10px;
    }
    
    .chat-header h3 {
        font-size: 1em;
    }
}

/* Large desktop screens */
@media (min-width: 1440px) {
    .app-container {
        max-width: 1400px;
        margin: 0 auto;
        width: 100%;
    }
    
    .chat-section {
        flex: 0 0 450px;
    }
}

/* Ensure hidden class works properly */
.hidden {
    display: none !important;
}

/* Floating input toggle button */
.floating-toggle-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--warning);
    color: var(--dark);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    z-index: 999;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.floating-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.floating-toggle-btn.hidden {
    display: none !important;
}