:root { --bg-main: #050505; --bg-panel: #111111; --accent: #00ff88; --text-main: #eeeeee; --border: #333333; --font-ui: 'Inter', sans-serif; --font-code: 'Fira Code', monospace; }
* { box-sizing: border-box; outline: none; margin: 0; padding: 0; }
body { background: var(--bg-main); color: var(--text-main); font-family: var(--font-ui); overflow-x: hidden; }

/* INPUTS */
input, textarea, select { background-color: #000 !important; color: #fff !important; border: 1px solid #333 !important; padding: 12px; border-radius: 4px; font-family: var(--font-ui); font-size: 0.9rem; transition: 0.3s; }
input:focus { border-color: var(--accent) !important; box-shadow: 0 0 10px rgba(0,255,136,0.1); }
button { cursor: pointer; border: none; font-family: var(--font-ui); transition: 0.2s; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: var(--bg-main); } ::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* LAYOUT */
.layout-wrapper { display: flex; height: 100vh; width: 100vw; }
.vscode-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; background: var(--bg-panel); border-right: 1px solid var(--border); z-index: 100; display: flex; flex-direction: column; }
.vscode-main { margin-left: 260px; flex: 1; height: 100%; min-height: 100vh; padding: 30px; background: radial-gradient(circle at top right, #1a1a1a 0%, #000 80%); padding-bottom: 120px; /* Espacio para visualizador */ }

/* HEADER & NAV */
.vscode-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 30px; }
.header-left h1 { font-size: 1.4rem; color: #fff; margin: 0; text-transform: uppercase; letter-spacing: 1px; }
.btn-subscribe { background: #cc0000 !important; color: #fff !important; padding: 10px 24px; font-weight: bold; border-radius: 4px; text-transform: uppercase; }
.brand-box { padding: 30px; text-align: center; border-bottom: 1px solid var(--border); }
.brand-img { width: 50px; margin-bottom: 10px; filter: drop-shadow(0 0 5px var(--accent)); }
.v-item { padding: 15px 25px; color: #888; cursor: pointer; display: flex; gap: 10px; border-left: 3px solid transparent; font-weight: 500; align-items: center; transition: 0.2s; }
.v-item:hover, .v-item.active { background: #1a1a1a; color: #fff; border-left-color: var(--accent); text-shadow: 0 0 8px rgba(0,255,136,0.3); }

/* VISUALIZADOR DE AUDIO */
#audio-visualizer { position: fixed; bottom: 0; left: 0; width: 100%; height: 60px; pointer-events: none; z-index: 50; opacity: 0.6; mix-blend-mode: screen; }

/* TOAST NOTIFICATIONS */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.toast-msg { background: rgba(10,10,10,0.95); border: 1px solid var(--accent); border-left: 4px solid var(--accent); color: #fff; padding: 15px 20px; border-radius: 4px; font-family: var(--font-code); font-size: 0.85rem; animation: slideIn 0.3s ease-out forwards; box-shadow: 0 5px 15px rgba(0,0,0,0.5); display: flex; align-items: center; gap: 10px; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* GAMIFICACION (XP) */
.xp-bar-bg { width: 100%; height: 6px; background: #222; border-radius: 3px; overflow: hidden; }
.xp-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #0088ff); transition: width 0.5s ease; box-shadow: 0 0 10px var(--accent); }

/* VIDEO PLAYER */
.integrated-player-box { background: #000; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 40px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.video-frame { background: #000; display: flex; justify-content: center; }
.video-frame video { width: 100%; aspect-ratio: 16/9; max-height: 75vh; }
.video-controls-bar { padding: 20px; background: #0a0a0a; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.actions-row { display: flex; gap: 10px; align-items: center; }
.btn-code { background: #181818 !important; color: #ccc !important; padding: 10px 15px; border-radius: 6px; font-weight: bold; display: flex; align-items: center; gap: 8px; border: 1px solid #333 !important; }
.btn-code:hover { border-color: var(--accent) !important; color: var(--accent) !important; box-shadow: 0 0 8px rgba(0,255,136,0.1); }

/* COMENTARIOS & CHAT */
.terminal-comments-integrated { background: #080808; border-top: 1px solid var(--border); }
.term-input { display: flex; padding: 10px; gap: 10px; border-bottom: 1px solid var(--border); }
.term-input input { flex: 1; border: none !important; background: #000 !important; }
.term-input button { background: var(--accent) !important; color: #000 !important; padding: 0 20px; font-weight: bold; border-radius: 6px; }
.comment-block { margin-bottom: 15px; border-bottom: 1px solid #222; padding-bottom: 10px; font-size: 0.9rem; }
.comment-actions { display: flex; gap: 15px; margin-top: 5px; }
.btn-action-mini { background: none !important; color: #666 !important; font-size: 0.8rem; cursor: pointer; padding: 0; font-weight: bold; }
.sub-reply { margin-left: 20px; padding-left: 10px; border-left: 2px solid #333; margin-top: 8px; font-size: 0.85rem; color: #ccc; }
.reply-input-box { display: none; margin-top: 10px; gap: 5px; }
.reply-input-box input { flex: 1; background: #111 !important; border: 1px solid #333 !important; }
.reply-input-box button { background: var(--accent) !important; color: #000 !important; width: 40px; font-weight: bold; }

/* CHAT WINDOW */
.chat-window { position: fixed; bottom: 90px; right: 30px; width: 350px; height: 500px; background: rgba(10, 10, 10, 0.9); backdrop-filter: blur(12px); border: 1px solid #444; border-radius: 12px; z-index: 2000; display: none; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,0.8); }
.chat-header { padding: 15px; background: rgba(17,17,17,0.95); color: #fff; font-weight: bold; display: flex; justify-content: space-between; border-bottom: 1px solid #333; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: transparent; }

/* MENSAJES */
.msg-bubble { padding: 10px 14px; border-radius: 8px; font-size: 0.9rem; max-width: 85%; word-wrap: break-word; position: relative; animation: popIn 0.2s; }
@keyframes popIn { from{transform:scale(0.9);opacity:0} to{transform:scale(1);opacity:1} }
@keyframes rainbow-border-anim { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.msg-artist { align-self: flex-end; color: #fff; background: linear-gradient(#000, #000) padding-box, linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #00ff88, #0000ff, #8b00ff) border-box; border: 3px solid transparent; border-radius: 8px; background-size: 100% 100%, 400% 400%; animation: rainbow-border-anim 3s ease infinite; box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); }
.msg-artist small { display: block; color: #00ffff; font-weight: 900; text-transform: uppercase; font-size: 0.7rem; margin-bottom: 4px; }
.msg-self { align-self: flex-end; background: var(--accent); color: #000; font-weight: bold; border-bottom-right-radius: 2px; }
.msg-self small { display: none; }
.msg-other { align-self: flex-start; background: #222; color: #eee; border-bottom-left-radius: 2px; border: 1px solid #333; }
.msg-other small { display: block; font-size: 0.7rem; color: var(--accent); margin-bottom: 3px; font-weight: bold; }

.chat-input-container { padding: 12px; border-top: 1px solid #333; display: flex; gap: 8px; background: rgba(17,17,17,0.9); }
.chat-input-container input { background: #000 !important; border: 1px solid #333 !important; border-radius: 20px !important; }
.chat-input-container button { width: 40px; height: 40px; border-radius: 50%; padding: 0; background: var(--accent) !important; color: #000 !important; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.chat-launcher { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background: #000; border: 2px solid var(--accent); color: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; cursor: pointer; z-index: 1500; box-shadow: 0 0 15px rgba(0,255,136,0.3); transition: 0.3s; }
.chat-launcher:hover { transform: scale(1.1); box-shadow: 0 0 25px rgba(0,255,136,0.5); }

/* EXTRAS */
.protected-content { display: none; }
body.is-vip .protected-content { display: block; }
body.is-vip .code-block-lock { display: none; }
.code-block-lock { padding: 50px; text-align: center; border: 2px dashed #333; margin: 20px 0; background: #0d0d0d; }
.btn-green-glow { background: transparent !important; border: 1px solid var(--accent) !important; color: var(--accent) !important; padding: 10px; width: 100%; font-weight: bold; margin-top: 10px; }
.btn-green-glow:hover { background: var(--accent) !important; color: #000 !important; }
.profile-panel { background: #111; padding: 40px; border-radius: 12px; border: 1px solid #333; text-align: center; max-width: 450px; margin: 0 auto; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.profile-panel img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.admin-input { width: 100%; margin-bottom: 10px; }
.app-page { display: none !important; animation: fadeIn 0.3s; }
.app-page.active { display: block !important; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.code-card { background: #111; border: 1px solid #222; border-radius: 8px; cursor: pointer; transition: 0.2s; overflow: hidden; }
.code-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 5px 15px rgba(0,255,136,0.1); }
.card-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: 0.3s; }
.code-card:hover .card-thumb img { transform: scale(1.05); }
.card-text { padding: 15px; font-size: 0.9rem; font-weight: 600; }
.section-label { color: #fff; font-size: 1.2rem; margin: 40px 0 20px 0; border-left: 4px solid var(--accent); padding-left: 15px; }

@media (max-width: 900px) {
    .vscode-sidebar { left: -260px; transition: 0.3s; } .vscode-sidebar.open { left: 0; }
    .vscode-main { margin-left: 0; padding-top: 80px; }
    .mobile-menu-btn { display: block; position: fixed; top: 15px; left: 15px; z-index: 2000; background: #000 !important; border: 1px solid var(--accent); color: var(--accent); padding: 8px 12px; font-size: 1.2rem; }
    .menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 90; display: none; } .menu-overlay.open { display: block; }
    .chat-window { width: 95%; right: 2.5%; bottom: 100px; height: 60vh; }
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* EFECTO GLITCH */
.glitch-effect { position: relative; display: inline-block; }
.glitch-effect:hover { animation: glitch-anim 0.3s cubic-bezier(.25, .46, .45, .94) both infinite; color: var(--accent); }
.glitch-effect:hover::before, .glitch-effect:hover::after { display: block; content: attr(data-text); position: absolute; top: 0; left: 0; height: 100%; width: 100%; opacity: 0.8; }
.glitch-effect:hover::before { color: #f0f; z-index: -1; transform: translate(-2px, -2px); }
.glitch-effect:hover::after { color: #0ff; z-index: -2; transform: translate(2px, 2px); }

@keyframes glitch-anim {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}
/* === REPRODUCTOR DE MÚSICA PRO V2 === */

/* Contenedor de cada canción: Efecto Vidrio + Borde Neón suave */
.music-item-pro {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Hover: Se ilumina y levanta */
.music-item-pro:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 255, 136, 0.1);
    background: rgba(30, 30, 30, 0.8);
}

/* Estado ACTIVO (Cuando suena la canción) */
.music-item-pro.active-track {
    border-color: var(--accent);
    background: linear-gradient(90deg, rgba(0,255,136,0.05) 0%, rgba(0,0,0,0) 100%);
    box-shadow: inset 4px 0 0 var(--accent);
}

/* Botón de Play Rediseñado */
.music-item-pro .btn-code {
    border-radius: 50% !important; /* Redondo */
    width: 45px;
    height: 45px;
    padding: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    background: #000 !important;
    border: 2px solid #444 !important;
    color: #fff !important;
    transition: 0.3s;
}

.music-item-pro .btn-code:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    transform: scale(1.1);
}

/* Animación de latido cuando suena */
.playing-pulse {
    animation: pulse-green 1.5s infinite;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    box-shadow: 0 0 15px var(--accent);
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

/* Barra de progreso más gruesa y moderna */
.progress-container {
    height: 6px;
    background: #222;
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #00ccff);
    box-shadow: 0 0 10px var(--accent);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* Texto del título más grande */
.music-item-pro span[style*="font-weight:bold"] {
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}
/* === YOUTUBE MUSIC STYLE PLAYER === */
.ytm-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

/* El Player Principal */
.ytm-player-card {
    background: linear-gradient(180deg, rgba(30,30,30,0.9) 0%, rgba(10,10,10,0.95) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid #333;
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    margin-bottom: 30px;
}

/* Carátula Giratoria (opcional) o Estática Grande */
.ytm-cover {
    width: 250px;
    height: 250px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.ytm-player-card.playing .ytm-cover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 255, 136, 0.2);
}

/* Info de la canción */
.ytm-info h2 { font-size: 1.5rem; color: #fff; margin-bottom: 5px; }
.ytm-info p { color: #aaa; font-size: 0.9rem; }

/* Controles */
.ytm-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 25px;
}
.btn-control {
    background: none !important;
    font-size: 2rem;
    color: #fff !important;
    padding: 0;
    transition: 0.2s;
}
.btn-control:hover { color: var(--accent) !important; transform: scale(1.2); }
.btn-play-big {
    width: 70px;
    height: 70px;
    background: #fff !important;
    color: #000 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}
.btn-play-big:hover { transform: scale(1.1); background: var(--accent) !important; }

/* Barra de progreso */
.ytm-progress-area { width: 100%; margin-top: 25px; cursor: pointer; }
.ytm-time-row { display: flex; justify-content: space-between; font-size: 0.75rem; color: #666; margin-top: 5px; }

/* Panel de Letras (Lyrics) */
.ytm-lyrics-overlay {
    position: absolute;
    top: 100%; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    padding: 30px;
    transition: 0.3s ease-in-out;
    overflow-y: auto;
    text-align: left;
    white-space: pre-wrap; /* Respeta los saltos de línea */
    font-family: var(--font-ui);
    line-height: 1.6;
    color: #ddd;
    z-index: 10;
}
.ytm-lyrics-overlay.show { top: 0; }
.btn-lyrics-toggle {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid #444 !important;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 20px;
    z-index: 20;
}

/* La lista de abajo (Cola) */
.ytm-queue { width: 100%; }
.queue-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #222;
    cursor: pointer;
    transition: 0.2s;
    border-radius: 8px;
}
.queue-item:hover { background: #111; }
.queue-item.active { background: #1a1a1a; border-left: 3px solid var(--accent); }
.queue-thumb { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; margin-right: 15px; }
.queue-info h4 { font-size: 0.95rem; color: #fff; }
.queue-info span { font-size: 0.8rem; color: #666; }
/* === NUEVA BARRA DE ACCIONES YTM === */
.ytm-action-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.btn-ytm-action {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-ytm-action:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: #fff;
    border-color: #fff;
}

/* Efecto cuando das Like */
.btn-ytm-action.liked {
    color: #ff4d4d;
    border-color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
}