/* ===== LUNATA BASE - Estructura y componentes comunes ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Las variables se definen en los temas (home, plex, etc.). 
   Aquí solo definimos variables de respaldo genéricas. */
:root {
    --primary: #888;
    --primary-light: #aaa;
    --primary-dark: #666;
    --accent: #ccc;
    --accent-warm: #ddd;
    --bg-light: #fff;
    --surface: #fff;
    --text-dark: #111;
    --text-muted: #555;
    --border-light: #ccc;
    --shadow-color: rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ---------- SPLASH ---------- */
.logo-splash {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-light);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; pointer-events: none; opacity: 1;
    will-change: transform, opacity;
}
.splash-content { display: flex; align-items: center; justify-content: center; }
.splash-logo-img { width: 150px; height: auto; }

/* Header logo inicialmente oculto */
.logo-area { opacity: 0; transition: opacity 0.3s ease; text-decoration: none; color: inherit; display: flex; align-items: center; }
.logo-area.visible { opacity: 1; }
.header-logo-img { height: 60px; width: auto; }

/* Ondas decorativas */
.bg-waves { position: fixed; bottom: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: 0.4; }
.bg-waves svg { position: absolute; bottom: 0; width: 100%; height: auto; fill: var(--primary-light); opacity: 0.15; }

/* Header */
.stream-header {
    position: relative; z-index: 10; padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
}
.header-container { max-width: 1300px; margin: 0 auto; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 20px 40px; }
.header-titles { flex: 1; min-width: 280px; }
.main-title { font-size: 2.2rem; font-weight: 700; color: var(--text-dark); line-height: 1.2; margin-bottom: 0.5rem; }
.sub-title { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Contenedor principal */
.main-container { max-width: 1300px; margin: 2rem auto; padding: 0 1.5rem; position: relative; z-index: 5; }

/* Grid de selección */
.selection-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem; margin: 2rem 0; }
.feature-card {
    background: var(--surface); border-radius: 40px; padding: 2.5rem 2rem;
    box-shadow: 0 20px 30px -10px var(--shadow-color); border: 1px solid var(--border-light);
    transition: all 0.25s ease; cursor: pointer; text-align: center; position: relative; overflow: hidden;
    text-decoration: none; color: inherit; display: block;
}
.feature-card.small { padding: 2rem 1.5rem; }
.feature-card:hover { transform: translateY(-8px); box-shadow: 0 30px 40px -15px rgba(0,0,0,0.1); border-color: var(--primary-light); }
.card-illustration { font-size: 4rem; color: var(--primary); margin-bottom: 1.5rem; position: relative; }
.feature-card.small .card-illustration { font-size: 3rem; }
.floating-dots {
    position: absolute; width: 100%; height: 100%; top: 0; left: 0;
    background: radial-gradient(circle at 30% 40%, var(--accent-warm) 2px, transparent 2px);
    background-size: 30px 30px; opacity: 0.15; pointer-events: none;
}
.feature-card h2 { font-size: 2rem; font-weight: 700; margin-bottom: 0.8rem; color: var(--text-dark); }
.feature-card p { color: var(--text-muted); margin-bottom: 2rem; }
.cta-link { font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 8px; transition: gap 0.2s; }
.feature-card:hover .cta-link { gap: 15px; }

/* Paneles y vistas */
.main-panel { display: none; animation: fadeSlide 0.4s ease; }
.main-panel.active { display: block; }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.back-btn {
    background: var(--surface); border: 1px solid var(--border-light); padding: 0.8rem 2rem; border-radius: 50px;
    font-weight: 600; color: var(--text-dark); margin-bottom: 2rem; cursor: pointer; transition: all 0.25s ease;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); display: inline-flex; align-items: center; gap: 8px;
}
.back-btn.secondary { padding: 0.5rem 1.5rem; font-size: 0.9rem; }
.back-btn:hover { background: var(--primary); color: white; border-color: var(--primary); transform: translateX(-4px); }

/* Subselección Jellyfin */
.subselection-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; margin-bottom: 2rem; }
.jellyfin-view { display: none; }
.jellyfin-view.active { display: block; }

/* Mensajes */
.recomendacion-message, .important-note {
    background: #fff9e6; border-left: 6px solid var(--accent-warm); padding: 1rem 1.8rem; border-radius: 18px;
    margin-bottom: 2rem; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); border: 1px solid #ffe6b3;
}
.recomendacion-message i, .important-note i { font-size: 1.8rem; color: var(--accent-warm); }

/* Grid instrucciones */
.instructions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.8rem; }
.device-card {
    background: var(--surface); border-radius: 28px; padding: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); border: 1px solid var(--border-light);
    transition: all 0.25s ease;
}
.device-card:hover { box-shadow: 0 20px 30px -10px var(--shadow-color); border-color: var(--primary-light); }
.device-header { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.device-icon { font-size: 2.2rem; color: var(--primary); min-width: 40px; text-align: center; }
.device-card h3 { font-size: 1.4rem; font-weight: 600; flex: 1; }
.device-arrow { color: var(--text-muted); transition: transform 0.3s; }
.device-body { margin-top: 1.2rem; }
.store-badge {
    display: inline-block; background: #f1f3f5; padding: 0.4rem 1rem; border-radius: 30px; font-size: 0.9rem;
    text-decoration: none; color: var(--text-dark); margin-bottom: 1rem; border: 1px solid var(--border-light);
}
.steps, .step-list { list-style: none; margin-top: 0.5rem; }
.steps li, .step-list li { margin-bottom: 0.6rem; padding-left: 1.8rem; position: relative; font-size: 0.95rem; }
.steps li::before, .step-list li::before { content: "▹"; position: absolute; left: 0; color: var(--primary); font-weight: bold; }

/* Grupos de método */
.method-group { margin-top: 1rem; padding-top: 0.5rem; border-top: 1px dashed var(--border-light); }
.method-group:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.method-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--primary); }

/* Acordeón de categorías */
.categories-accordion { display: flex; flex-direction: column; gap: 1rem; }
.category-item { background: var(--surface); border-radius: 24px; border: 1px solid var(--border-light); overflow: hidden; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); }
.category-header { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.8rem; cursor: pointer; user-select: none; background: white; transition: background 0.2s; }
.category-header:hover { background: #fafbfc; }
.cat-title { display: flex; align-items: center; gap: 15px; }
.cat-title i { font-size: 1.6rem; color: var(--primary); width: 32px; text-align: center; }
.cat-title h3 { font-size: 1.3rem; font-weight: 600; }
.chip { background: var(--primary-light); color: white; padding: 2px 10px; border-radius: 30px; font-size: 0.75rem; font-weight: 600; margin-left: 10px; }
.cat-arrow { color: var(--text-muted); transition: transform 0.3s; }
.category-item.expanded .cat-arrow { transform: rotate(180deg); }
.category-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; background: #fdfdfe; border-top: 1px solid transparent; }
.category-item.expanded .category-content { max-height: 2000px; border-top-color: var(--border-light); }
.channels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 1rem; padding: 1.5rem; }
.channel-tile {
    background: white; border-radius: 18px; padding: 1rem 0.3rem; text-align: center; transition: all 0.25s ease;
    border: 1px solid var(--border-light); cursor: pointer;
}
.channel-tile:hover { transform: scale(1.02); border-color: var(--primary); box-shadow: 0 8px 16px var(--shadow-color); }
.channel-logo-svg { width: 60px; height: 60px; margin: 0 auto 8px; border-radius: 16px; background: #f0f2f5; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.channel-name { font-size: 0.75rem; font-weight: 500; color: var(--text-dark); display: block; line-height: 1.3; }

/* Plex accordion (estructura) */
.plex-accordion { display: flex; flex-direction: column; gap: 1rem; align-items: start; }
.plex-section { width: 100%; background: var(--surface); border-radius: 24px; border: 1px solid var(--border-light); overflow: hidden; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); }
.plex-section-header { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.8rem; cursor: pointer; user-select: none; background: white; transition: background 0.2s; }
.plex-section-header:hover { background: #fafbfc; }
.plex-section-title { display: flex; align-items: center; gap: 15px; }
.plex-section-title i { font-size: 1.8rem; color: var(--primary); width: 32px; text-align: center; }
.plex-section-title h3 { font-size: 1.3rem; font-weight: 600; }
.plex-section .fa-chevron-down { color: var(--text-muted); transition: transform 0.3s; }
.plex-section.expanded .fa-chevron-down { transform: rotate(180deg); }
.plex-section-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; background: #fdfdfe; border-top: 1px solid transparent; padding: 0 1.8rem; }
.plex-section.expanded .plex-section-content { max-height: 2000px; border-top-color: var(--border-light); padding: 1.5rem 1.8rem; }

/* Botones genéricos */
.btn {
    display: inline-flex; align-items: center; padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white !important; border-radius: 25px; text-decoration: none; margin: 8px 0;
    transition: all 0.3s; border: none; font-weight: 500; gap: 8px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px var(--shadow-color); }
.warning-message { background: #fff3e0; border-left: 4px solid #ff9800; padding: 1rem; border-radius: 12px; margin: 1rem 0; display: flex; gap: 10px; align-items: flex-start; }
.whatsapp-btn {
    display: inline-flex; align-items: center; padding: 12px 25px; background: #25D366; color: white !important;
    border-radius: 30px; text-decoration: none; transition: all 0.3s; box-shadow: 0 4px 6px rgba(0,0,0,0.1); gap: 10px;
}
.whatsapp-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 8px rgba(0,0,0,0.2); }
.video-container { text-align: center; margin-top: 20px; }
lite-youtube { width: 100%; max-width: 560px; height: 315px; border-radius: 10px; display: block; margin: 0 auto; }

/* Footer */
.stream-footer {
    text-align: center; padding: 2rem; color: var(--text-muted); border-top: 1px solid var(--border-light);
    margin-top: 3rem; background: rgba(255,255,255,0.5); backdrop-filter: blur(5px); position: relative; z-index: 5;
}

/* Responsive */
@media (max-width: 700px) {
    .selection-grid, .subselection-grid { grid-template-columns: 1fr; }
    .header-container { flex-direction: column; align-items: flex-start; }
    .main-title { font-size: 1.8rem; }
    .instructions-grid { grid-template-columns: 1fr; }
    .device-card { padding: 0; }
    .device-header { padding: 1.2rem 1.5rem; }
    .device-body { display: none; padding: 0 1.5rem 1.5rem; }
    .device-card.expanded .device-body { display: block; }
    .device-card.expanded .device-arrow { transform: rotate(180deg); }
}