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

:root {
    --primary-blue: #2196F3;
    --dark-blue: #1976D2;
    --header-bg: #1a1a1a;
    --bg-light: #f5f5f5;
    --text-dark: #333;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-light);
    margin: 0;
    padding: 0;
}

/* Header */
.site-header {
    background: var(--header-bg);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-name {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.live-count {
    color: #4CAF50;
    font-size: 14px;
}

.live-count::before {
    content: '●';
    margin-right: 5px;
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 10px 45px 10px 15px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    background: #fff;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-blue);
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--dark-blue);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--dark-blue);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

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

/* Gender Navigation */
.gender-nav {
    background: #2a2a2a;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gender-tab {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 15px 30px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.gender-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.gender-tab.active {
    color: #fff;
    border-bottom-color: var(--primary-blue);
    background: rgba(33, 150, 243, 0.1);
}

.gender-nav-mobile {
    display: none;
}

/* Main Layout */
.main-container {
    display: flex;
    height: calc(100vh - 60px - 51px); /* 60px header + 51px gender nav */
    background: var(--bg-light);
}

.video-area {
    flex: 1;
    background: #000;
    position: relative;
    overflow: hidden;
}

.sidebar {
    width: 350px;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.model-info {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.model-avatar {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 15px auto;
}

.model-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.model-username {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 10px;
    cursor: pointer;
}

.model-stats {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-number {
    font-weight: bold;
    color: var(--text-dark);
}

.sidebar-content {
    padding: 20px;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section h3 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.placeholder-text {
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Room Subject */
.room-subject-section {
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.room-subject {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    word-wrap: break-word;
}

/* Model Details (Age, Location) */
.model-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    color: #666;
}

.model-age,
.model-location {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.model-age:before {
    content: '';
}

.model-location:before {
    content: '';
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    background: #f0f0f0;
    color: #555;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    transition: background 0.2s;
}

.tag:hover {
    background: #e0e0e0;
}

/* Sidebar Embed */
.sidebar-embed {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-embed iframe {
    display: block !important;
    width: 320px !important;
    height: 800px !important;
    border: none !important;
    border-radius: 8px;
    margin: 0 auto !important;
}

/* Modal styles */
.modal {
    width: 100%;
    height: 100%;
    background-color: #fff;
}

.modal-content {
    width: 100%;
    height: 100%;
}

.modal-content iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

#wheel-catcher {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    pointer-events: all; /* Capture events for wheel/swipe */
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Desktop only - wheel catcher only in video area */
@media (min-width: 1025px) {
    #wheel-catcher {
        /* Confined to video area, won't overlap header/sidebar */
        pointer-events: all;
    }
}

/* Loading and error states */
#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #333;
    z-index: 2000;
    display: none; /* Hidden by default */
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

#error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ff4444;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    z-index: 2000;
    display: none; /* Hidden by default */
}

/* Info badge (for mobile) */
#info {
    position: fixed;
    top: 70px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 10000;
    pointer-events: none;
}

.close-btn, .nav-arrow {
    display: none;
}

/* Mobile Header */
.mobile-header {
    display: none;
}

/* Mobile Styles */
@media (max-width: 1024px) {
    html, body {
        overflow: hidden;
        position: fixed;
        width: 100vw;
        height: 100vh;
        background: #000;
    }

    .site-header {
        display: none;
    }

    .gender-nav {
        display: none;
    }

    .gender-nav-mobile {
        display: flex;
        justify-content: space-around;
        align-items: center;
        background: #1a1a1a;
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        z-index: 1999;
        padding: 0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    .gender-nav-mobile .gender-tab {
        color: rgba(255,255,255,0.7);
        text-decoration: none;
        padding: 12px 15px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
        border-bottom: 3px solid transparent;
        flex: 1;
        text-align: center;
    }

    .gender-nav-mobile .gender-tab.active {
        color: #fff;
        border-bottom-color: var(--primary-blue);
        background: rgba(33, 150, 243, 0.15);
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #000;
        padding: 10px 15px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 2000;
        height: 50px;
    }

    .mobile-header .hamburger {
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        padding: 5px;
        text-decoration: none;
    }

    .mobile-header .logo {
        color: #fff;
        font-size: 18px;
        font-weight: bold;
        text-decoration: none;
    }

    .mobile-header .search-icon {
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        padding: 5px;
    }

    .main-container {
        height: 100vh;
        padding-top: 95px; /* 50px mobile header + 45px gender nav */
    }

    .video-area {
        width: 100vw;
        height: calc(100vh - 95px); /* Adjusted for both headers */
        background: #000;
        position: relative;
    }

    .sidebar {
        display: none;
    }

    #info {
        display: none; /* Hide the info badge, we'll show username on video */
    }

    .modal {
        position: fixed;
        z-index: 1000;
        top: 95px; /* Mobile header + gender nav */
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: calc(100vh - 95px);
        background: #000;
        overflow: hidden;
    }

    .modal-content {
        position: relative;
        width: 100vw;
        height: calc(100vh - 95px);
        background: #000;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-content iframe {
        width: 100vw;
        height: 56.25vw; /* 16:9 aspect ratio */
        max-height: calc(100vh - 95px);
        border: none;
        background: #000;
        transform: scale(1.25); /* Zoom in to fill more vertical space */
    }

    /* Ensure no horizontal overflow */
    body.mobile-view {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    html {
        overflow-x: hidden !important;
    }

    /* Username overlay on video */
    .video-username-overlay {
        position: absolute;
        bottom: 80px;
        left: 20px;
        right: 20px;
        z-index: 1500;
        pointer-events: none;
    }

    .video-username-overlay .username {
        font-size: 20px;
        font-weight: bold;
        color: #fff;
        text-shadow: 0 2px 4px rgba(0,0,0,0.8);
        margin-bottom: 5px;
        pointer-events: auto;
        cursor: pointer;
    }

    .video-username-overlay .subtitle {
        font-size: 14px;
        color: rgba(255,255,255,0.9);
        text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    }
}

/* Desktop Styles */
@media (min-width: 1025px) {
    #info {
        display: none;
    }

    .search-container {
        display: flex;
    }
}

/* Responsive header */
@media (max-width: 768px) {
    .search-container {
        display: none;
    }

    .btn {
        padding: 8px 15px;
        font-size: 12px;
    }
}
