* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #0033A0;
    --secondary-blue: #0055CC;
    --light-blue: #66CCFF;
    --dark-bg: #0a0f2e;
    --darker-bg: #05081f;
    --text-light: #ffffff;
    --text-gray: #b0c4de;
    --accent-gold: #FFD700;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 50%, #0d1b3a 100%);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary-blue);
    box-shadow: 0 4px 20px rgba(0, 51, 160, 0.3);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.logo-text-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 51, 160, 0.5);
}

.logo-img {
    height: 60px;
    width: auto;
    margin-right: 15px;
    filter: drop-shadow(0 0 10px rgba(0, 51, 160, 0.5));
}

.vip-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 2px;
    margin-top: -5px;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-blue);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero-section {
    padding: 40px 0;
    min-height: calc(100vh - 100px);
}

.channels-header {
    text-align: center;
    margin-bottom: 40px;
}

.channels-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 30px;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.channel-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.channel-tab {
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid rgba(0, 51, 160, 0.3);
    color: var(--text-light);
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.channel-tab:hover {
    border-color: var(--primary-blue);
    background: rgba(0, 51, 160, 0.2);
    transform: translateY(-2px);
}

.channel-tab.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    box-shadow: 0 5px 20px rgba(0, 51, 160, 0.5);
}

.stream-container {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 51, 160, 0.3);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.stream-container.hidden {
    display: none;
}

.stream-container.active {
    border-color: var(--primary-blue);
    box-shadow: 0 10px 40px rgba(0, 51, 160, 0.5);
}

/* Loading indicator for auto-starting video */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-light);
    z-index: 10;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-indicator p {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Channel Selection Tabs - Ultra Modern Professional Design */
.channel-tabs-container {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
    padding: 0 20px;
    flex-wrap: wrap;
}

.channel-tab-btn {
    background: linear-gradient(145deg, #ff4444, #cc0000);
    border: 2px solid #cc0000;
    border-radius: 20px;
    padding: 20px 28px;
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    max-width: 280px;
    min-width: 240px;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(204, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
}

.channel-tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
    z-index: 0;
}

.channel-tab-btn:hover::before {
    left: 100%;
}

.channel-tab-btn:hover {
    background: linear-gradient(145deg, #ff5555, #ff2222);
    border-color: #ff0000;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.4), 0 5px 12px rgba(0, 0, 0, 0.2);
}

.channel-tab-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 51, 160, 0.1);
}

.channel-tab-btn.active {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    border-color: #ff0000;
    color: white;
    box-shadow: 0 12px 40px rgba(255, 0, 0, 0.5), 0 6px 20px rgba(255, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    animation: active-pulse 3s ease-in-out infinite;
}

.channel-tab-btn > * {
    position: relative;
    z-index: 1;
}

@keyframes active-pulse {
    0%, 100% {
        box-shadow: 0 12px 40px rgba(255, 0, 0, 0.5), 0 6px 20px rgba(255, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 12px 40px rgba(255, 0, 0, 0.6), 0 6px 20px rgba(255, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

/* Channel Icon */
.channel-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.35s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.channel-tab-btn:hover .channel-icon {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.channel-tab-btn.active .channel-icon {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Channel Content */
.channel-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.channel-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.3;
    color: inherit;
}

.channel-subtitle {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.65;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 1px;
}

.channel-tab-btn.active .channel-subtitle {
    opacity: 0.85;
}

/* Quality Badge */
.channel-quality {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #FFD700, #FFB84D);
    color: #000;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 6px rgba(255, 165, 0, 0.3);
    text-transform: uppercase;
    line-height: 1.2;
}

.channel-tab-btn.active .channel-quality {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}
    position: relative;
    z-index: 1;
}

.channel-tab-icon {
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.channel-tab-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.channel-tab-title {
    font-size: 18px;
    letter-spacing: 2px;
    font-weight: 900;
    text-transform: uppercase;
}

.channel-tab-subtitle {
    font-size: 12px;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-transform: none;
}

.channel-tab-badge {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-light);
}

.channel-tab-btn.active .channel-tab-badge {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

.channel-tab-btn {
    justify-content: space-between;
}

.live-indicator-small {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.live-indicator-small .live-dot {
    width: 10px;
    height: 10px;
    background: #ff4444;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.live-indicator-small .live-text {
    font-size: 12px;
    font-weight: 700;
    color: #ff4444;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

.channel-tab-btn.active .live-indicator-small {
    background: rgba(255, 255, 255, 0.2);
}

.channel-tab-btn.active .live-indicator-small .live-text {
    color: var(--text-light);
}

.stream-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.channel-label {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.channel-number {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 51, 160, 0.2);
    padding: 8px 20px;
    border-radius: 25px;
    border: 2px solid var(--primary-blue);
}

.live-dot {
    width: 12px;
    height: 12px;
    background: var(--primary-blue);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px var(--primary-blue);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.live-text {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--text-light);
}

.viewer-count {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-size: 14px;
}

.viewer-icon {
    font-size: 18px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.8);
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 51, 160, 0.1), rgba(102, 204, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-placeholder:hover {
    background: linear-gradient(135deg, rgba(0, 51, 160, 0.2), rgba(102, 204, 255, 0.2));
}

.video-overlay {
    text-align: center;
    z-index: 2;
}

.play-button {
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.play-button:hover {
    transform: scale(1.1);
}

.stream-message {
    color: var(--text-light);
    font-size: 18px;
    font-weight: 600;
    margin-top: 10px;
}

.video-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 3;
}

.control-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(0, 51, 160, 0.8);
    transform: scale(1.1);
}

.stream-info {
    text-align: center;
}

.stream-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stream-description {
    color: var(--text-gray);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* Contestants Section */
.contestants-section {
    padding: 80px 0;
    background: rgba(15, 15, 15, 0.5);
}

.section-title {
    font-size: 42px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 50px;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-blue);
    border-radius: 2px;
}

.contestants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.contestant-card {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.contestant-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-blue);
    box-shadow: 0 10px 30px rgba(0, 51, 160, 0.4);
}

.contestant-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: rgba(255, 255, 255, 0.3);
}

.contestant-info {
    padding: 20px;
    text-align: center;
}

.contestant-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-light);
}

.contestant-age {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 10px;
}

.contestant-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.status-active {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.status-evicted {
    background: rgba(0, 51, 160, 0.2);
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

/* Schedule Section */
.schedule-section {
    padding: 80px 0;
}

.schedule-list {
    max-width: 900px;
    margin: 50px auto 0;
}

.schedule-item {
    background: rgba(26, 26, 26, 0.8);
    border-left: 4px solid var(--primary-blue);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.schedule-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0, 51, 160, 0.3);
}

.schedule-time {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-blue);
    min-width: 120px;
}

.schedule-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-light);
    flex: 1;
}

.schedule-description {
    color: var(--text-gray);
    font-size: 14px;
    margin-top: 5px;
}

/* News Section */
.news-section {
    padding: 80px 0;
    background: rgba(15, 15, 15, 0.5);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.news-card {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-blue);
    box-shadow: 0 10px 30px rgba(0, 51, 160, 0.4);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
}

.news-content {
    padding: 25px;
}

.news-date {
    color: var(--text-gray);
    font-size: 12px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-light);
    line-height: 1.4;
}

.news-excerpt {
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--darker-bg);
    padding: 60px 0 20px;
    border-top: 2px solid var(--primary-blue);
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-light);
}

.footer-section p {
    color: var(--text-gray);
    font-size: 14px;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-link,
.footer-link {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.social-link:hover,
.footer-link:hover {
    color: var(--primary-blue);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 51, 160, 0.2);
    color: var(--text-gray);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(26, 26, 26, 0.98);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-top: 2px solid var(--primary-blue);
    }

    .nav.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .logo {
        font-size: 24px;
    }
    
    .logo-img {
        height: 45px;
    }
    
    .logo-container {
        gap: 10px;
    }

    .channels-title {
        font-size: 32px;
    }

    .channel-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .channel-tab {
        width: 100%;
    }

    .stream-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .channel-label {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-title {
        font-size: 32px;
    }

    .contestants-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .schedule-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .schedule-time {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .stream-container {
        padding: 20px;
    }

    .logo {
        font-size: 20px;
    }
    
    .logo-img {
        height: 35px;
    }

    .vip-text {
        font-size: 12px;
    }

    .channels-title {
        font-size: 24px;
    }

    .channel-number {
        font-size: 18px;
    }
}

/* Live Chat Styles */
.live-chat-container {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 15px;
    border: 2px solid rgba(0, 51, 160, 0.3);
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    height: 500px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.8);
    position: relative; /* Ensure container is positioned for child elements */
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 51, 160, 0.5);
    position: relative; /* Make header relative so close button positions correctly */
    flex-shrink: 0; /* Prevent header from shrinking */
}

.chat-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-light);
    margin: 0;
}

.chat-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-light);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(10, 15, 46, 0.5);
    min-height: 0; /* Allow flex shrinking */
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-blue);
}

.chat-message {
    background: rgba(0, 51, 160, 0.2);
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 3px solid var(--primary-blue);
    animation: slideIn 0.3s ease;
}

.chat-message.own-message {
    background: rgba(0, 51, 160, 0.4);
    border-left-color: var(--light-blue);
    margin-left: auto;
    max-width: 80%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 12px;
}

.message-username {
    font-weight: 700;
    color: var(--light-blue);
}

.message-time {
    color: var(--text-gray);
    font-size: 11px;
}

.message-text {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: rgba(26, 26, 26, 0.95);
    border-top: 2px solid rgba(0, 51, 160, 0.3);
    margin-top: auto; /* Push to bottom */
    flex-shrink: 0; /* Prevent shrinking */
    border-radius: 0 0 15px 15px; /* Match container border radius */
}

.chat-input {
    flex: 1;
    background: rgba(10, 15, 46, 0.8);
    border: 2px solid rgba(0, 51, 160, 0.3);
    border-radius: 25px;
    padding: 12px 20px;
    color: var(--text-light);
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 10px rgba(0, 51, 160, 0.5);
}

.chat-input::placeholder {
    color: var(--text-gray);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    color: var(--text-light);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap; /* Prevent text wrapping */
    flex-shrink: 0; /* Prevent button from shrinking */
}

.chat-send-btn:hover {
    background: linear-gradient(135deg, var(--secondary-blue), var(--light-blue));
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 51, 160, 0.5);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-loading {
    text-align: center;
    color: var(--text-gray);
    padding: 20px;
    font-style: italic;
}

.chat-collapsed {
    height: auto;
    min-height: auto;
}

.chat-collapsed .chat-messages {
    display: none;
}

.chat-collapsed .chat-input-container {
    display: none;
}

.chat-hidden {
    display: none !important;
}


/* Username Picker Modal */
.username-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.username-modal-content {
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    border: 2px solid var(--primary-blue);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 50px rgba(0, 51, 160, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.username-modal-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.username-input {
    width: 100%;
    background: rgba(10, 15, 46, 0.8);
    border: 2px solid rgba(0, 51, 160, 0.3);
    border-radius: 15px;
    padding: 15px 20px;
    color: var(--text-light);
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.username-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 15px rgba(0, 51, 160, 0.5);
    background: rgba(10, 15, 46, 0.95);
}

.username-input::placeholder {
    color: var(--text-gray);
}

.username-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.username-submit-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border: none;
    border-radius: 15px;
    padding: 15px 40px;
    color: var(--text-light);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    width: 100%;
}

.username-submit-btn:hover {
    background: linear-gradient(135deg, var(--secondary-blue), var(--light-blue));
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 51, 160, 0.5);
}

.username-submit-btn:active {
    transform: scale(0.98);
}

.username-submit-btn:disabled,
.chat-send-btn:disabled,
.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Responsive Chat */
@media (max-width: 768px) {
    .live-chat-container {
        height: 400px;
        max-height: 50vh;
    }
    
    .chat-message.own-message {
        max-width: 90%;
    }
    
    .chat-input-container {
        flex-direction: column;
    }
    
    .chat-send-btn {
        width: 100%;
    }
    
    .username-modal-content {
        padding: 30px 20px;
    }
    
    .username-modal-content h2 {
        font-size: 24px;
    }
}

