/* Player Page Specific Styles */

/* Ensure proper viewport handling */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Loading indicator styles */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.loading-spinner i {
    font-size: 24px;
    color: #9146FF;
    animation: spin 1s linear infinite;
}

.loading-spinner span {
    font-size: 12px;
    color: #ffffff;
    opacity: 0.8;
    margin-bottom: 10px;
    display: block;
}

.buffer-progress {
    margin-top: 10px;
}

.buffer-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.buffer-fill {
    height: 100%;
    background: linear-gradient(45deg, #9146FF, #7c3aed);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error message styles */
.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.error-content i {
    font-size: 32px;
    color: #ff6b35;
}

.error-content h3 {
    margin: 0;
    font-size: 18px;
    color: #ffffff;
}

.error-content p {
    margin: 0;
    font-size: 14px;
    color: #cccccc;
    text-align: center;
}

.retry-btn {
    background: linear-gradient(45deg, #9146FF, #7c3aed);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: linear-gradient(45deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
}

/* Video Quality Menu */
.quality-menu {
    position: absolute;
    bottom: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 12px;
    padding: 0;
    min-width: 200px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(145, 70, 255, 0.3);
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.quality-menu.show {
    display: block;
    animation: slideInUp 0.3s ease;
}

.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.quality-header h4 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.close-quality-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-quality-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.quality-options {
    padding: 8px 0;
}

.quality-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.quality-option:hover {
    background: rgba(145, 70, 255, 0.2);
}

.quality-option.active {
    background: rgba(145, 70, 255, 0.3);
    color: #9146FF;
}

.quality-name {
    font-weight: 600;
    font-size: 14px;
}

.quality-desc {
    font-size: 12px;
    opacity: 0.7;
    color: #ccc;
}

.quality-option.active .quality-desc {
    color: #9146FF;
}

/* Player Container */
.player-container {
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
    max-width: 100vw;
    max-height: 100vh;
}

/* Video Section */
.video-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: calc(100vw - 350px);
}

.video-player-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    max-height: 100vh;
    max-width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Video Overlay */
.video-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.live-badge-overlay {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
}

.viewer-count-overlay {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    width: fit-content;
}

.stream-title-overlay {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    max-width: 300px;
    width: fit-content;
}

/* Video Controls Overlay */
.video-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.video-player-container:hover .video-controls-overlay {
    opacity: 1;
    pointer-events: all;
}

.control-left, .control-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.control-btn:hover {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    transform: scale(1.1);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.time-display {
    color: white;
    font-size: 14px;
    font-family: monospace;
}

/* Stream Info Panel */
.stream-info-panel {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    padding: 8px;
    border-top: 1px solid #4a4a4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 8vh;
    overflow: hidden;
}

.streamer-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.streamer-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.streamer-details h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #f5f5f5;
}

.game-category {
    font-size: 14px;
    color: #a0a0a0;
    margin-bottom: 8px;
}

.stream-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.follow-btn, .subscribe-btn, .share-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.follow-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a1a;
}

.follow-btn:hover {
    background: linear-gradient(45deg, #ffed4e, #ffd700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.subscribe-btn {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
}

.subscribe-btn:hover {
    background: linear-gradient(45deg, #ff8c42, #ff6b35);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.share-btn {
    background: linear-gradient(45deg, #4a4a4a, #5a5a5a);
    color: #f5f5f5;
}

.share-btn:hover {
    background: linear-gradient(45deg, #5a5a5a, #4a4a4a);
    transform: translateY(-2px);
}

/* Chat Section */
.chat-section {
    width: 350px;
    min-width: 280px;
    max-width: 500px;
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    border-left: 1px solid #4a4a4a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s ease;
}

.chat-section.resized {
    width: 450px;
}

.chat-section.minimized {
    width: 280px;
}

.chat-section.expanded {
    width: 500px;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid #4a4a4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.chat-header h3 {
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.user-profile-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(45deg, #4a4a4a, #5a5a5a);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #6a6a6a;
}

.profile-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-username {
    font-size: 12px;
    font-weight: 500;
    color: #f5f5f5;
}

.profile-type {
    font-size: 10px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    font-weight: 600;
}

.chat-controls {
    display: flex;
    gap: 8px;
}

/* Connection status removed for cleaner UI */

.chat-btn {
    background: none;
    border: none;
    color: #a0a0a0;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-btn:hover {
    color: #f5f5f5;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a1a;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 300px);
}

.chat-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    animation: fadeInUp 0.3s ease;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.chat-content {
    flex: 1;
    min-width: 0;
}

.chat-username {
    font-size: 13px;
    font-weight: 500;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
}

.chat-text {
    font-size: 14px;
    color: #f5f5f5;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-timestamp {
    font-size: 11px;
    color: #a0a0a0;
    margin-top: 2px;
}

/* Chat Input */
.chat-input-container {
    padding: 16px;
    border-top: 1px solid #4a4a4a;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.chat-input {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
    border: 1px solid #5a5a5a;
    border-radius: 4px;
    color: #f5f5f5;
    font-size: 14px;
    outline: none;
}

.chat-input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.chat-input::placeholder {
    color: #a0a0a0;
}

.chat-send-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-send-btn:hover {
    background: linear-gradient(45deg, #ffed4e, #ffd700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.chat-emoji-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 18px;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-btn:hover {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    transform: scale(1.1);
}

/* Mobile Chat Toggle */
.mobile-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    z-index: 1000;
    display: none;
}

.chat-count {
    font-size: 10px;
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    text-align: center;
}

/* Back Button */
.back-button {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 1000;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.9) 0%, rgba(58, 58, 58, 0.9) 100%);
    color: #f5f5f5;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    border: 1px solid #4a4a4a;
}

.back-link:hover {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* Navigation Bar Modifications for Player */
.stream-info-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 16px;
}

.stream-title {
    font-size: 14px;
    font-weight: 500;
    color: #f5f5f5;
}

.streamer-name-nav {
    font-size: 12px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stream-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-indicator-nav {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.viewer-count-nav {
    font-size: 14px;
    color: #a0a0a0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .chat-section {
        width: 300px;
        min-width: 250px;
    }
    
    .video-section {
        max-width: calc(100vw - 300px);
    }
}

@media (max-width: 768px) {
    /* Force mobile viewport */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    .player-container {
        height: 100vh !important;
        width: 100vw !important;
        flex-direction: column !important;
        overflow: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .video-section {
        flex: 1 !important;
        min-height: 0 !important;
        width: 100% !important;
        height: 60vh !important;
        position: relative !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .video-player-container {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .video-player {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        touch-action: manipulation !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    .chat-section {
        width: 100%;
        height: 40vh;
        min-width: auto;
        max-width: 100vw;
        border-left: none;
        border-top: 1px solid rgba(145, 70, 255, 0.2);
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
    }
    
    .chat-section.minimized,
    .chat-section.resized,
    .chat-section.expanded {
        width: 100%;
        height: 40vh;
    }
    
    .video-overlay {
        top: 8px;
        left: 8px;
        gap: 4px;
    }
    
    .live-badge-overlay,
    .viewer-count-overlay {
        font-size: 10px;
        padding: 2px 6px;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(5px);
    }
    
    .stream-title-overlay {
        font-size: 12px;
        padding: 6px 10px;
        max-width: 180px;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(5px);
    }
    
    .video-controls-overlay {
        padding: 12px;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    }
    
    .control-btn {
        padding: 8px;
        font-size: 16px;
        min-width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.7);
        border-radius: 50%;
        backdrop-filter: blur(5px);
        transition: all 0.2s ease;
    }
    
    .control-btn:hover,
    .control-btn:active {
        background: rgba(145, 70, 255, 0.8);
        transform: scale(1.1);
    }
    
    .volume-slider {
        width: 80px;
        height: 4px;
    }
    
    .time-display {
        font-size: 12px;
        color: white;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    }
    
    .stream-info-panel {
        padding: 8px 12px;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(5px);
        max-height: 10vh;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    
    .streamer-info {
        gap: 12px;
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
    }
    
    .streamer-avatar {
        width: 50px;
        height: 50px;
    }
    
    .streamer-details h2 {
        font-size: 14px;
        margin: 0;
        line-height: 1.2;
    }
    
    .chat-header {
        padding: 12px;
        font-size: 14px;
        background: rgba(145, 70, 255, 0.1);
        border-bottom: 1px solid rgba(145, 70, 255, 0.2);
    }
    
    .chat-messages {
        padding: 12px;
        height: calc(40vh - 120px);
        background: transparent;
    }
    
    .chat-input-container {
        padding: 12px;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(5px);
    }
    
    .chat-input {
        padding: 10px;
        font-size: 13px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(145, 70, 255, 0.3);
        color: white;
    }
    
    .chat-input:focus {
        background: rgba(255, 255, 255, 0.15);
        border-color: #9146FF;
    }
    
    /* Mobile-specific touch improvements */
    .video-player-container {
        touch-action: manipulation;
    }
    
    /* Mobile touch targets */
    .control-btn, .nav-btn, .chat-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Mobile scroll improvements */
    .chat-messages::-webkit-scrollbar {
        width: 4px;
    }
    
    .chat-messages::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }
    
    /* Mobile quality menu */
    .quality-menu {
        bottom: 120px;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-height: 60vh;
    }
    
    /* Improved mobile navigation */
    .navbar {
        padding: 8px 12px;
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
    }
    
    .nav-left .logo {
        font-size: 16px;
        font-weight: bold;
    }
    
    .stream-info-nav {
        display: none;
    }
    
    .nav-right {
        gap: 8px;
    }
    
    .nav-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .chat-send-btn {
        padding: 10px;
        min-width: 40px;
    }
    
    .back-button {
        top: 8px;
        left: 8px;
    }
    
    .back-link {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    /* Ensure emoji buttons are touch-friendly */
    .emoji-btn {
        padding: 8px;
        font-size: 16px;
        min-width: 36px;
        height: 36px;
    }
    
    /* Improve chat message readability */
    .chat-message {
        margin-bottom: 8px;
        font-size: 13px;
    }
    
    .chat-username {
        font-size: 12px;
    }
    
    .chat-text {
        font-size: 13px;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    /* Force mobile viewport */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    .player-container {
        height: 100vh !important;
        width: 100vw !important;
        overflow: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .video-section {
        height: 50vh !important;
        position: relative !important;
        width: 100% !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .video-player-container {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .video-player {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        touch-action: manipulation !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    .chat-section {
        height: 30vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        display: flex;
        flex-direction: column;
    }
    
    .stream-info-panel {
        padding: 4px 8px;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(5px);
        max-height: 8vh;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .streamer-info {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }
    
    .streamer-avatar {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }
    
    .streamer-details h2 {
        font-size: 12px;
        margin: 0;
        line-height: 1.2;
    }
    
    .stream-actions {
        flex-direction: row;
        gap: 4px;
        flex-shrink: 0;
    }
    
    .follow-btn, .subscribe-btn, .share-btn {
        font-size: 10px;
        padding: 4px 8px;
        min-width: auto;
        height: 24px;
    }
    
    .chat-header {
        padding: 8px;
    }
    
    .chat-messages {
        padding: 8px;
        height: calc(30vh - 120px);
        overflow-y: auto;
        flex: 1;
    }
    
    .chat-input-container {
        padding: 8px;
        background: rgba(0, 0, 0, 0.8);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .chat-input {
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .chat-send-btn {
        padding: 12px;
        min-width: 44px;
        height: 44px;
        border-radius: 8px;
    }
    
    .emoji-btn {
        padding: 6px;
        font-size: 14px;
        min-width: 32px;
        height: 32px;
    }
    
    /* Ensure video controls are properly sized for mobile */
    .video-controls-overlay {
        padding: 8px;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(5px);
    }
    
    .control-btn {
        min-width: 44px;
        height: 44px;
        font-size: 16px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .time-display {
        font-size: 10px;
    }
    
    /* Mobile quality menu adjustments */
    .quality-menu {
        bottom: 100px;
        right: 10px;
        left: 10px;
        min-width: auto;
        width: calc(100% - 20px);
    }
    
    .quality-option {
        padding: 16px 20px;
    }
    
    .quality-name {
        font-size: 16px;
    }
    
    .quality-desc {
        font-size: 14px;
    }
}

/* Fullscreen Styles */
.player-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    /* Prevent horizontal scrolling */
    body {
        overflow-x: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    /* Ensure video fills screen properly */
    .video-player {
        object-fit: cover;
        width: 100%;
        height: 100%;
    }
    
    /* Improve touch targets */
    .control-btn, .chat-btn, .emoji-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for mobile */
    .chat-messages {
        padding: 16px 12px;
    }
    
    .chat-input-container {
        padding: 12px 16px;
        border-top: 1px solid #4a4a4a;
    }
    
    /* Responsive chat layout */
    .chat-section {
        display: flex;
        flex-direction: column;
    }
    
    .chat-messages {
        flex: 1;
        overflow-y: auto;
    }
}

.player-container.fullscreen .chat-section {
    display: none;
}

.player-container.fullscreen .mobile-chat-toggle {
    display: none;
}

.player-container.fullscreen .back-button {
    display: none;
}

/* Chat Message Types */
.chat-message.subscriber {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 237, 78, 0.1) 100%);
    border-left: 3px solid #ffd700;
    padding-left: 8px;
    margin-left: -8px;
}

.chat-message.moderator {
    background: linear-gradient(90deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 140, 66, 0.1) 100%);
    border-left: 3px solid #ff6b35;
    padding-left: 8px;
    margin-left: -8px;
}

.chat-message.broadcaster {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 237, 78, 0.2) 100%);
    border-left: 3px solid #ffd700;
    padding-left: 8px;
    margin-left: -8px;
}

.chat-message.system {
    background: linear-gradient(90deg, rgba(160, 160, 160, 0.1) 0%, rgba(180, 180, 180, 0.1) 100%);
    border-left: 3px solid #a0a0a0;
    padding-left: 8px;
    margin-left: -8px;
    font-style: italic;
}

.chat-message.system .chat-username {
    background: linear-gradient(45deg, #a0a0a0, #b0b0b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-message.system .chat-text {
    color: #a0a0a0;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #4a4a4a;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #ffed4e, #ffd700);
} 

/* Chat Authentication Overlay */
.chat-auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(45, 45, 45, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.chat-auth-content {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    border-radius: 16px;
    border: 1px solid #4a4a4a;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.chat-auth-icon {
    font-size: 48px;
    color: #ffd700;
    margin-bottom: 20px;
}

.chat-auth-content h4 {
    color: #f5f5f5;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.chat-auth-content p {
    color: #a0a0a0;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.chat-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-login-btn, .chat-guest-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chat-login-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a1a;
}

.chat-login-btn:hover {
    background: linear-gradient(45deg, #ffed4e, #ffd700);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.chat-guest-btn {
    background: linear-gradient(45deg, #9146FF, #a855f7);
    color: white;
}

.chat-guest-btn:hover {
    background: linear-gradient(45deg, #a855f7, #9146FF);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(145, 70, 255, 0.3);
}

/* Mobile responsive for chat auth */
@media (max-width: 768px) {
    .chat-auth-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .chat-auth-icon {
        font-size: 36px;
    }
    
    .chat-auth-content h4 {
        font-size: 20px;
    }
    
    .chat-auth-content p {
        font-size: 14px;
    }
    
    .chat-login-btn, .chat-guest-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}