:root {
    /* --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); */
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --secondary-gradient: linear-gradient(135deg, #00f2fe 0%, #7b2ff7 100%);
    --dark-gradient: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glow-blue: #4facfe;
    --glow-purple: #00f2fe;
    --nav_pantalla: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background: var(--dark-gradient);
    color: white;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
}

/* Animated background particles */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: linear-gradient(45deg, var(--glow-blue), var(--glow-purple));
    border-radius: 50%;
    animation: float 6s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

/* Snowflakes */
#snowflakes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.snowflake {
    position: absolute;
    top: -5%;
    font-size: 20px;
    color: white !important;
    filter: brightness(100) !important;
    animation: fall linear infinite;
    will-change: transform, opacity;
}

@keyframes fall {
    0% {
        transform: translateX(0) translateY(-10vh) rotate(0deg);
    }

    50% {
        transform: translateX(20px) translateY(50vh) rotate(180deg);
    }

    100% {
        transform: translateX(-20px) translateY(110vh) rotate(360deg);
        opacity: 0.5;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 12px;
}
::-webkit-scrollbar {
    background-color: #0c0c0c;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

/* Glass morphism navbar */
nav {
    background: rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: sticky !important;
    top: 0;
    z-index: 20;
    height: calc(var(--nav_pantalla) / 2);
    flex-direction: column;
}

#id_nav {
    height: var(--nav_pantalla);
    flex-direction: column;
}

.nav-link {
    position: relative;
    color: rgba(255, 255, 255, 0.8) !important;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin: 0 4px;
}

.nav-link:hover {
    color: white !important;
    background: var(--glass-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(103, 126, 234, 0.3);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white !important;
    box-shadow: 0 4px 20px rgba(103, 126, 234, 0.4);
}

/* Video player with enhanced styling */
#id_PantallaTV {
    width: 100%;
    height: 55vw;
    display: none;
    position: sticky !important;
    top: calc(var(--nav_pantalla) / 2);
    z-index: 10;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(103, 126, 234, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

#id_PantallaTV:hover {
    /* transform: scale(1.02); */
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(103, 126, 234, 0.3);
}

.Class_PantallaTV {
    top: var(--nav_pantalla) !important;
}

/* Search bar with enhanced styling */
.search-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

#id_BuscardorCanales {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    color: white;
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#id_BuscardorCanales:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--glow-blue);
    box-shadow: 0 0 30px rgba(79, 172, 254, 0.4);
    transform: scale(1.02);
}

#id_BuscardorCanales::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Filter buttons */
.filter-btn,
#id_optPais,
#id_optCanales {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.filter-btn:hover,
#id_optPais:hover,
#id_optCanales:hover {
    background: var(--primary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(103, 126, 234, 0.4);
    color: white;
}

/* Fix for select options visibility */
#id_optCanales option,
#id_optPais option {
    background-color: #212529;
    color: white;
    padding: 8px 12px;
}

#id_optCanales option:hover,
#id_optPais option:hover {
    background-color: #495057;
}

/* Channel buttons with enhanced 3D effect */
.class_CanalBoton {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin: 10px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 0;
}

.class_CanalBoton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.class_CanalBoton:hover::before {
    left: 100%;
}

.class_CanalBoton:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(103, 126, 234, 0.3);
}

.class_CanalBoton:focus {
    background-color: rgb(88, 88, 88) !important;
}

.class_CanalBoton img {
    width: 100px;
    height: 100px;
    border-radius: 15px;
    transition: all 0.3s ease;
    filter: brightness(0.9) drop-shadow(0 0 20px dimgrey);
    /* object-fit: cover; */
    object-fit: contain;
    object-position: center;
}

.class_CanalBoton:hover img {
    filter: brightness(1.1) saturate(1.2) drop-shadow(0 0 20px dimgrey);
}

/* Animation classes */
.mostrarHaciaArriba {
    animation: mostrarArriba 0.5s;
}

@keyframes mostrarArriba {
    0% {
        transform: translateY(60px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Modal improvements */
.modal-content {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

/* Back to top button */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(103, 126, 234, 0.4);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

#backToTop:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 30px rgba(103, 126, 234, 0.6);
    color: white;
}

/* Notification improvements */
#notification-container {
    position: fixed;
    bottom: 10px;
    right: 20px;
    z-index: 9999;
    width: 350px;
}

.notification {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    padding: 15px;
    border-radius: 12px;
    color: white;
    width: 100%;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.5s forwards;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification .message {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

.notification .close-btn {
    margin-top: 10px;
    padding: 5px 15px;
    background-color: transparent;
    border: 1px solid #ffffff;
    color: white;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.notification .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.notification.red {
    background: linear-gradient(45deg, rgba(255, 0, 0, 0.8), rgba(255, 94, 77, 0.8));
}

.notification.yellow {
    background: linear-gradient(45deg, rgba(255, 191, 0, 0.8), rgba(255, 230, 0, 0.8));
}

.notification.green {
    background: linear-gradient(45deg, rgba(0, 255, 125, 0.8), rgba(0, 255, 85, 0.8));
}

.notification.gray {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* Footer enhancements */
footer {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(26, 26, 46, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
}

/* Social links */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
    margin: 0 8px;
}

.social-link:hover {
    color: white;
    transform: translateY(-5px) scale(1.1);
    background: var(--primary-gradient);
    box-shadow: 0 10px 30px rgba(103, 126, 234, 0.4);
}

/* Loading animation */
.loading-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Context menu */
.submenu {
    position: absolute;
    background: rgba(87, 87, 87, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 5px;
    display: none;
    list-style: none;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.submenu li {
    padding: 5px 10px;
    cursor: pointer;
    color: #fff;
    border-radius: 5px;
}

.submenu li:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* NoScript alert */
.noscript-alert {
    max-width: 480px;
    margin: 2rem auto;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    color: #f7fafc;
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    border: 1px solid var(--glass-border);
}

/* Responsive design */
@media (max-width: 768px) {
    #notification-container {
        bottom: 50%;
        right: 50%;
        transform: translate(50%, 50%);
        width: 90%;
        max-width: 350px;
    }

    #id_PantallaTV {
        height: 50vh;
        border-radius: 15px;
    }

    .class_CanalBoton {
        margin: 5px;
        padding: 15px;
    }

    .class_CanalBoton img {
        /* width: 60px;
        height: 60px; */
        /* object-fit: cover; */
        object-position: center;
    }
}

@media (min-width: 800px) {
    nav {
        flex-direction: row;
    }

    #id_nav {
        height: calc(var(--nav_pantalla) / 2);
        flex-direction: row;
    }

    #id_PantallaTV {
        position: relative !important;
        top: 0 !important;
        z-index: 10;
        height: calc(100vh - calc(var(--nav_pantalla)/2));
        transition: all 0.3s ease-in-out;
        cursor: grab;
    }

    #id_PantallaTV.sticky {
        top: calc(var(--nav_pantalla)/2) !important;
        left: 0px;
        z-index: 10;
        width: 450px;
        height: 255px;
        position: fixed !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        border: 3px solid gray;
        background-color: white;
        overflow: hidden;
        border-radius: 0.5em;
    }

    #id_PantallaTV:active {
        cursor: grabbing;
    }

    .search-bar {
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        padding: 2px !important;
        margin: 2px !important;
        border-radius: 8px 8px 0 0;
        width: 100%;
        max-width: 500px;
    }
}