/* RESET Y BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* PALETA CÓSMICA DORADA */
    --space-deep: #0a0a1a;
    --space-dark: #1a1a2e;
    --gold-primary: #ffd700;
    --gold-secondary: #b8860b;
    --gold-glow: rgba(255, 215, 0, 0.3);
    --text-light: #f8f9fa;
    --text-muted: #adb5bd;
    --card-bg: rgba(26, 26, 46, 0.85);
    --card-border: rgba(255, 215, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-light);
    background: var(--space-deep);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* FONDO UNIVERSO */
.universe-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(ellipse at top, var(--space-deep) 0%, #000000 100%),
        radial-gradient(circle at 30% 30%, rgba(255, 215, 0, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(184, 134, 11, 0.05) 0%, transparent 40%);
    animation: subtle-drift 120s infinite linear;
}

@keyframes subtle-drift {
    0% { background-position: 0% 0%, 0px 0px, 0px 0px; }
    100% { background-position: 100% 100%, 100px 100px, -100px -100px; }
}

/* ESTRELLAS */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite alternate;
}

.stars::before {
    width: 1px;
    height: 1px;
    top: 15%;
    left: 20%;
    box-shadow: 
        40px 60px white,
        120px 200px white,
        300px 100px white,
        400px 250px white,
        550px 150px white,
        700px 300px white,
        800px 50px white;
}

.stars::after {
    width: 2px;
    height: 2px;
    top: 30%;
    left: 70%;
    box-shadow: 
        100px 150px white,
        250px 300px white,
        450px 200px white,
        600px 350px white,
        750px 100px white;
    animation-delay: 1.5s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* NEBULOSAS */
.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.1;
}

.nebula-1 {
    width: 300px;
    height: 300px;
    background: var(--gold-primary);
    top: 10%;
    left: 10%;
    animation: float 25s infinite ease-in-out;
}

.nebula-2 {
    width: 400px;
    height: 400px;
    background: var(--gold-secondary);
    bottom: 10%;
    right: 10%;
    animation: float 30s infinite ease-in-out reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, 20px) scale(1.1); }
}

/* CONTENEDOR PRINCIPAL */
.container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    backdrop-filter: blur(2px);
}

/* HEADER */
.header {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 40px;
}

.site-title {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.gold-glow {
    background: linear-gradient(135deg, var(--gold-primary) 0%, #fff 50%, var(--gold-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px var(--gold-glow);
}

.subtitle {
    display: block;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 10px;
}

.channel-description {
    max-width: 600px;
    margin: 30px auto;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* BARRA DE BÚSQUEDA */
.search-bar {
    max-width: 500px;
    margin: 30px auto;
    display: flex;
    gap: 10px;
}

#searchInput {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 25px;
    color: var(--text-light);
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

#searchInput:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 20px var(--gold-glow);
}

#searchBtn {
    padding: 12px 25px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--gold-primary);
    border-radius: 25px;
    color: var(--gold-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

#searchBtn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
}

/* SECCIONES */
.section {
    margin-bottom: 60px;
}

.section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--gold-primary);
    font-weight: 300;
    border-left: 3px solid var(--gold-primary);
    padding-left: 15px;
}

/* GRID DE VIDEOS */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.video-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold-primary);
    box-shadow: 0 10px 30px var(--gold-glow);
}

.video-thumb {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
}

.video-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.video-card:hover .video-thumb img {
    transform: scale(1.05);
}

.video-thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 10px;
}

/* PLAYSLISTS */
.playlists-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.playlist-card {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
}

.playlist-card:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold-primary);
    transform: translateX(5px);
}

.playlist-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.playlist-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--gold-primary);
}

.playlist-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* BOTONES */
.btn-show-all {
    display: block;
    width: 100%;
    padding: 15px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--gold-primary);
    border-radius: 12px;
    color: var(--gold-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
}

.btn-show-all:hover {
    background: rgba(255, 215, 0, 0.2);
    letter-spacing: 1px;
}

/* LOADING */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* FOOTER */
.footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid var(--card-border);
}

.footer-content {
    text-align: center;
}

.footer-quote {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 25px;
    color: var(--text-muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hashtags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 25px 0;
}

.hashtag {
    background: rgba(255, 215, 0, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--gold-primary);
}

.youtube-link {
    display: inline-block;
    padding: 12px 30px;
    background: #ff0000;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    margin: 20px 0;
    transition: var(--transition);
}

.youtube-link:hover {
    background: #cc0000;
    transform: scale(1.05);
}

.copyright {
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--gold-primary);
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--gold-primary);
    transform: scale(1.2);
}

.modal-body {
    padding: 30px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .site-title {
        font-size: 2.2rem;
    }
    
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .playlists-container {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    #searchBtn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .site-title {
        font-size: 1.8rem;
    }
}

/* UTILITIES */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}