* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #050505;
    color: #fff;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Splash Screen */
.splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease-in;
}

.splash-content {
    text-align: center;
    padding: 20px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.splash-image {
    max-width: 400px;
    width: 80%;
    height: auto;
    animation: scaleIn 1s ease-out;
    filter: drop-shadow(0 0 30px rgba(0, 229, 255, 0.5));
}

.splash-logo {
    font-size: 3rem;
    font-weight: bold;
    color: #00e5ff;
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
    animation: pulse 2s infinite;
}

.splash-subtitle {
    color: #00e5ff;
    margin-top: 10px;
    font-size: 1.2rem;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 229, 255, 0.1);
    border-top: 4px solid #00e5ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes scaleIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hidden {
    display: none !important;
}

/* Main App Layout */
.app {
    display: flex;
    height: 100vh;
    width: 100%;
    position: relative;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: rgba(0, 229, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    padding: 12px;
    transition: all 0.3s;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.hamburger {
    display: block;
    width: 26px;
    height: 2px;
    background: #000;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 2px;
    background: #000;
    left: 0;
    transition: all 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.mobile-menu-toggle.active .hamburger {
    background: transparent;
}

.mobile-menu-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: #0b0b0b;
    border-right: 2px solid #00e5ff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #333;
}

.app-logo {
    max-width: 200px;
    width: 80%;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.3));
}

.logo {
    font-size: 1.8rem;
    color: #00e5ff;
    font-weight: bold;
    margin-bottom: 5px;
}

.version {
    color: #888;
    font-size: 0.9rem;
}

/* Controls */
.control-group {
    padding: 10px 15px;
}

.control-group label {
    display: block;
    color: #00e5ff;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.select-box, .search-box {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid #00e5ff;
    color: #00e5ff;
    border-radius: 5px;
    font-size: 1rem;
}

.select-box:focus, .search-box:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* Channel List */
.channel-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    background: #000;
    margin: 0 10px;
    border-radius: 5px;
    -webkit-overflow-scrolling: touch;
}

.channel-item {
    padding: 14px;
    margin-bottom: 8px;
    background: #0b0b0b;
    border: 1px solid #333;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    word-wrap: break-word;
    font-size: 0.95rem;
}

.channel-item:hover, .channel-item:active {
    background: #00e5ff;
    color: #000;
    border-color: #00e5ff;
    transform: translateX(5px);
}

.channel-item.active {
    background: #00e5ff;
    color: #000;
    border-color: #00e5ff;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #888;
}

/* Controls Section */
.controls {
    padding: 15px;
    border-top: 1px solid #333;
}

.playback-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-control {
    background: #000;
    color: #00e5ff;
    border: 1px solid #00e5ff;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    min-width: 50px;
}

.btn-control:hover, .btn-control:active {
    background: #00e5ff;
    color: #000;
    transform: scale(1.05);
}

.btn-secondary {
    width: 100%;
    background: #000;
    color: #00e5ff;
    border: 1px solid #00e5ff;
    padding: 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-secondary:hover, .btn-secondary:active {
    background: #00e5ff;
    color: #000;
}

/* Volume Control */
.volume-control {
    margin-bottom: 10px;
}

.volume-label {
    display: block;
    text-align: center;
    color: #00e5ff;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 1rem;
}

.volume-slider {
    width: 100%;
    margin-bottom: 8px;
    accent-color: #00e5ff;
    height: 8px;
}

/* Video Container */
.video-container {
    flex: 1;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: none;
    transition: opacity 0.3s;
}

.channel-info {
    color: #fff;
}

#currentChannel {
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    padding: 20px 10px 10px;
    justify-content: center;
    gap: 15px;
    z-index: 100;
}

.mobile-btn {
    background: rgba(0, 229, 255, 0.8);
    color: #000;
    border: none;
    padding: 15px 20px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 60px;
    min-height: 60px;
}

.mobile-btn:active {
    background: #00e5ff;
    transform: scale(0.95);
}

/* Modal */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #0b0b0b;
    padding: 30px;
    border: 2px solid #00e5ff;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    color: #fff;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #00e5ff;
    cursor: pointer;
}

.close:hover, .close:active {
    color: #00ffff;
}

.modal-content h2 {
    color: #00e5ff;
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.modal-content hr {
    border: none;
    border-top: 1px solid #333;
    margin: 15px 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #00e5ff;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00ffff;
}

/* Tablet - Portrait */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .splash-logo {
        font-size: 2.5rem;
    }
    
    #currentChannel {
        font-size: 1.3rem;
    }
}

/* Mobile - Landscape */
@media (max-width: 900px) and (orientation: landscape) {
    .app {
        flex-direction: row;
    }
    
    .sidebar {
        width: 300px;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 229, 255, 0.3);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .video-container {
        width: 100%;
    }
    
    .mobile-controls {
        display: flex;
    }
    
    .video-overlay {
        padding: 15px;
    }
    
    #currentChannel {
        font-size: 1.1rem;
    }
}

/* Mobile - Portrait */
@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        width: 100%;
        max-width: 90%;
        height: 100vh;
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        border-right: none;
        border-bottom: 2px solid #00e5ff;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 229, 255, 0.3);
    }
    
    .video-container {
        width: 100%;
        height: 100vh;
    }
    
    .mobile-controls {
        display: flex;
    }
    
    .splash-logo {
        font-size: 2rem;
    }
    
    .splash-subtitle {
        font-size: 1rem;
    }
    
    .video-overlay {
        padding: 10px;
    }
    
    #currentChannel {
        font-size: 1rem;
    }
    
    .channel-item {
        padding: 16px;
        font-size: 1rem;
    }
    
    .btn-control {
        padding: 14px 18px;
    }
    
    .btn-secondary {
        padding: 14px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .splash-logo {
        font-size: 1.8rem;
    }
    
    .splash-image {
        max-width: 280px;
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .app-logo {
        max-width: 150px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .control-group {
        padding: 8px 12px;
    }
    
    .select-box, .search-box {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    .channel-item {
        padding: 14px 12px;
        font-size: 0.95rem;
    }
    
    #currentChannel {
        font-size: 0.95rem;
    }
    
    .mobile-btn {
        padding: 12px 16px;
        font-size: 1.1rem;
        min-width: 50px;
        min-height: 50px;
    }
    
    .modal-content {
        padding: 20px;
    }
}

/* Fullscreen Styles */
.app.fullscreen .sidebar {
    transform: translateX(-100%);
}

.app.fullscreen .mobile-menu-toggle {
    opacity: 0.3;
}

.app.fullscreen .mobile-menu-toggle:hover,
.app.fullscreen .mobile-menu-toggle:active {
    opacity: 1;
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .video-player {
        width: 100%;
        height: 100%;
    }
    
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }
    
    .channel-list {
        -webkit-overflow-scrolling: touch;
    }
}

/* Prevent text selection on mobile */
@media (max-width: 768px) {
    .btn-control, .btn-secondary, .mobile-btn, .channel-item {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-control, .btn-secondary, .mobile-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .channel-item {
        min-height: 48px;
    }
    
    .select-box, .search-box {
        min-height: 44px;
    }
}