/* ==========================================================================
   DASHBOARD PRO WORKSTATION STYLESHEET - LA CUEVA DEL GÜERO
   admin.lacuevadelguero.com
   Optimizaciones para Pantallas Grandes (Desktop / Ultrawide)
   Arquitectura Coexistente: 100% Mobile-First y Soporte iPhone Duo Preservado
   ========================================================================== */

/* Variables y Tokens de Diseño Pro */
:root {
    --ws-bg-base: #06060c;
    --ws-bg-card: rgba(14, 14, 24, 0.82);
    --ws-bg-card-hover: rgba(20, 20, 34, 0.92);
    --ws-cyan-glow: 0 0 15px rgba(0, 255, 255, 0.25);
    --ws-magenta-glow: 0 0 15px rgba(255, 0, 255, 0.25);
    --ws-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   REGLAS DESKTOP Y PANTALLAS GRANDES (>= 1200px)
   ========================================================================== */
@media (min-width: 1200px) {

    /* --- 1. NAVBAR / HEADER OPTIMIZADO --- */
    header,
    .dashboard-header {
        padding: 14px 36px !important;
        background: rgba(8, 8, 16, 0.94) !important;
        border-bottom: 1px solid rgba(0, 255, 255, 0.2) !important;
        backdrop-filter: blur(14px) !important;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
        min-height: 68px;
        box-sizing: border-box;
    }

    .header-brand-wrap {
        display: flex !important;
        align-items: center !important;
        gap: 16px !important;
    }

    #view-header-title {
        font-size: clamp(1.2rem, 1.35vw, 1.55rem) !important;
        font-weight: 800 !important;
        letter-spacing: 0.5px !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    .desktop-workstation-badge {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 4px 12px !important;
        font-size: 0.72rem !important;
        font-weight: 800 !important;
        letter-spacing: 1px !important;
        color: var(--neon-cyan) !important;
        background: rgba(0, 255, 255, 0.08) !important;
        border: 1px solid rgba(0, 255, 255, 0.35) !important;
        border-radius: 20px !important;
        text-shadow: 0 0 8px rgba(0, 255, 255, 0.4) !important;
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.1) !important;
        text-transform: uppercase;
    }

    .header-actions-bar {
        display: flex !important;
        gap: 10px !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .header-actions-bar .btn-neon {
        padding: 7px 15px !important;
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        transition: var(--ws-transition) !important;
        background: rgba(10, 10, 18, 0.6) !important;
        backdrop-filter: blur(8px) !important;
    }

    .header-actions-bar .btn-neon:hover {
        transform: translateY(-2px) !important;
    }

    .admin-badge {
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 6px 14px !important;
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        background: rgba(0, 255, 255, 0.08) !important;
        border: 1px solid var(--neon-cyan) !important;
        border-radius: 20px !important;
        white-space: nowrap !important;
        letter-spacing: 0.5px;
    }

    .admin-badge::before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #39FF14;
        box-shadow: 0 0 8px #39FF14, 0 0 15px rgba(57, 255, 20, 0.6);
        display: inline-block;
        animation: pulseLiveDot 2s infinite ease-in-out;
    }

    @keyframes pulseLiveDot {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.6; transform: scale(0.85); }
    }

    /* --- 2. CONTENEDOR PRINCIPAL Y VISTAS --- */
    .view-section {
        padding: 24px 36px !important;
        height: calc(100vh - 68px) !important;
        box-sizing: border-box !important;
    }

    /* --- 3. EPISODIOS Y FICHAS (#view-episodios) --- */
    .episodios-layout {
        display: flex !important;
        gap: 24px !important;
        height: 100% !important;
        align-items: stretch !important;
    }

    /* Lista fija y ergonómica en desktop (360px) en lugar de porcentaje 32% */
    .subpanel-lista {
        width: 360px !important;
        min-width: 340px !important;
        max-width: 380px !important;
        flex-shrink: 0 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        border: 1px solid rgba(0, 255, 255, 0.2) !important;
        background: rgba(12, 12, 22, 0.8) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    }

    /* Detalle expandido con el resto del viewport (flex: 1) */
    .subpanel-detalle {
        flex: 1 !important;
        width: auto !important;
        max-width: calc(100% - 384px) !important;
        height: 100% !important;
        padding: 26px 32px !important;
        border: 1px solid rgba(255, 0, 255, 0.2) !important;
        background: rgba(12, 12, 22, 0.8) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    }

    /* Criterios de curaduría (33 preguntas) en grid multirrenglón armonioso */
    #ponderacion-criterios {
        grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) !important;
        gap: 12px !important;
        max-height: 480px !important;
    }

    /* --- 4. EDITOR CANVA PRO (#view-canva) --- */
    .canva-editor-workspace {
        display: grid !important;
        grid-template-columns: 390px minmax(520px, 1fr) !important;
        gap: 24px !important;
        align-items: stretch !important;
        height: calc(100vh - 165px) !important;
        min-height: 580px !important;
    }

    .canva-controls-card {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        background: rgba(12, 12, 22, 0.85) !important;
        border: 1px solid rgba(0, 255, 255, 0.25) !important;
        border-radius: 16px !important;
        padding: 20px !important;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5) !important;
    }

    .canva-viewport-card {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        background: 
            radial-gradient(circle at center, rgba(16, 16, 30, 0.9) 0%, rgba(6, 6, 12, 0.98) 100%) !important;
        border: 1px solid rgba(0, 255, 255, 0.25) !important;
        border-radius: 16px !important;
        padding: 24px !important;
        box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 255, 255, 0.08) !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .canva-viewport-card::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: 
            linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
        background-size: 30px 30px;
        pointer-events: none;
    }

    #canvaCanvas {
        max-width: 100% !important;
        max-height: calc(100vh - 240px) !important;
        object-fit: contain !important;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 255, 255, 0.2) !important;
        border: 1px solid rgba(0, 255, 255, 0.3) !important;
        position: relative;
        z-index: 2;
    }

    /* --- 5. EDITOR DE VIDEO (#view-video) --- */
    .video-editor-workspace {
        display: grid !important;
        grid-template-columns: 280px minmax(460px, 1fr) 340px !important;
        gap: 20px !important;
        height: min(530px, calc(100vh - 380px)) !important;
        min-height: 460px !important;
        margin-bottom: 20px !important;
        align-items: stretch !important;
    }

    .video-panel-assets,
    .video-panel-inspector {
        height: 100% !important;
        overflow-y: auto !important;
        background: rgba(12, 12, 22, 0.85) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    }

    .video-panel-preview {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        background: #030308 !important;
        border: 1px solid rgba(0, 255, 255, 0.25) !important;
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 255, 255, 0.1) !important;
        border-radius: 14px !important;
    }

    #preview-wrapper-box {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    #editor-preview-video {
        max-height: 100% !important;
        max-width: 100% !important;
        border-radius: 8px !important;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.9) !important;
    }

    .video-timeline-card {
        background: #0d0d16 !important;
        border: 1px solid rgba(0, 255, 255, 0.2) !important;
        border-radius: 14px !important;
        padding: 16px 20px !important;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5) !important;
    }

    #timeline-tracks-wrapper {
        min-height: 155px !important;
        gap: 10px !important;
    }

    /* --- 6. HOOKS Y BLOG (#view-hooks, #view-blog) --- */
    .hooks-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
        gap: 24px !important;
    }

    .blog-content-view {
        max-width: 1300px !important;
        margin: 0 auto !important;
    }

    #blog-content {
        min-height: 380px !important;
        font-size: 0.98rem !important;
        line-height: 1.7 !important;
    }
}

/* ==========================================================================
   OPTIMIZACIONES ULTRA-WIDE & MONITOR PRO (>= 1600px)
   ========================================================================== */
@media (min-width: 1600px) {
    /* Canva: Mayor espacio y nitidez */
    .canva-editor-workspace {
        grid-template-columns: 420px minmax(650px, 1fr) !important;
        gap: 28px !important;
    }

    #canvaCanvas {
        max-height: calc(100vh - 220px) !important;
    }

    /* Video: Mayor vista previa NLE y timeline espacioso */
    .video-editor-workspace {
        grid-template-columns: 310px minmax(560px, 1fr) 370px !important;
        height: min(600px, calc(100vh - 360px)) !important;
        min-height: 520px !important;
    }

    /* Hooks: Distribución 3 columnas perfectas */
    .hooks-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 28px !important;
    }
}

/* ==========================================================================
   NUEVA ARQUITECTURA UI/UX DASHBOARD PRO (REDESIGN COMPLETO)
   - Cabecera Estática Fija con "La Cueva del Güero Pro"
   - Menú Hamburguesa Desplegable Ajustado a la Pantalla (Drawer Offcanvas)
   - Hub de Tarjetas Flotantes Magnéticas con Luz Neón Cyan
   - Navegación con Flecha Volver en Todo Momento
   - Modales Translúcidos Glassmorphism
   ========================================================================== */

/* 1. Reset de layout: El contenido principal toma 100% de ancho */
.main-content {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 2. Menú Hamburguesa Desplegable (Drawer Offcanvas) */
.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 330px !important;
    max-width: 88vw !important;
    height: 100vh !important;
    z-index: 2500 !important;
    transform: translateX(-105%) !important;
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.38s ease !important;
    background: rgba(9, 9, 18, 0.96) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    border-right: 1px solid rgba(0, 255, 255, 0.3) !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
}

.sidebar.active {
    transform: translateX(0) !important;
    box-shadow: 15px 0 60px rgba(0, 255, 255, 0.22), 0 0 120px rgba(0, 0, 0, 0.95) !important;
}

/* Overlay oscuro con blur para cerrar el menú */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 8, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2490;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Botón cerrar dentro del Drawer */
.sidebar-close-btn {
    position: absolute;
    top: 22px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    color: var(--neon-cyan);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    transform: rotate(90deg);
    box-shadow: 0 0 15px var(--neon-cyan);
}

/* 3. Cabecera Estática Fija */
header.dashboard-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 2000 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 28px !important;
    background: rgba(6, 6, 14, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(0, 255, 255, 0.22) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7), 0 1px 15px rgba(0, 255, 255, 0.08) !important;
    box-sizing: border-box !important;
    min-height: 66px !important;
}

.header-left-cluster {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Botón Hamburguesa Cyberpunk */
.btn-hamburger {
    background: rgba(0, 255, 255, 0.06);
    border: 1px solid rgba(0, 255, 255, 0.35);
    color: var(--neon-cyan);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

.btn-hamburger:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Flecha para Volver en Todo Momento (Cabecera) */
.btn-header-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 0, 255, 0.08);
    border: 1px solid rgba(255, 0, 255, 0.4);
    color: #ff80ff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.1);
}

.btn-header-back:hover {
    background: var(--neon-magenta);
    color: #fff;
    border-color: var(--neon-magenta);
    box-shadow: 0 0 18px rgba(255, 0, 255, 0.5);
    transform: translateX(-3px);
}

.btn-header-back.hidden {
    display: none !important;
}

/* Título Estático Permanente de la Cabecera */
.header-static-title {
    margin: 0;
    font-size: clamp(1.15rem, 1.4vw, 1.45rem);
    font-weight: 900;
    letter-spacing: 0.6px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.header-static-title .badge-pro {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    color: #000;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 14px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.4);
}

.header-active-view-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neon-cyan);
    opacity: 0.9;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-block;
}

/* 4. HUB DE TARJETAS FLOTANTES MAGNÉTICAS */
.hub-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px 20px 60px 20px;
    box-sizing: border-box;
}

.hub-hero {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
}

.hub-hero h2 {
    font-size: clamp(1.6rem, 2.2vw, 2.4rem);
    font-weight: 800;
    margin: 0 0 10px 0;
    color: #fff;
    letter-spacing: 0.5px;
}

.hub-hero h2 span {
    color: var(--neon-cyan);
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.hub-hero p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0 auto;
    max-width: 680px;
}

/* Grid de tarjetas magnéticas */
.magnetic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    perspective: 1200px;
}

/* Tarjeta Flotante Magnética con Sensibilidad de Luz Cyan */
.magnetic-card {
    position: relative;
    background: rgba(12, 12, 24, 0.82);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 255, 255, 0.18);
    border-radius: 18px;
    padding: 28px 24px 24px 24px;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 230px;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1);
    transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1), 
                box-shadow 0.25s ease, 
                border-color 0.25s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    will-change: transform;
}

/* Capa de luz reactiva (Sensibilidad Cyan al contacto con el mouse) */
.magnetic-card .card-spotlight {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(
        420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(0, 255, 255, 0.25),
        transparent 65%
    );
    mix-blend-mode: screen;
    z-index: 1;
}

.magnetic-card:hover {
    border-color: rgba(0, 255, 255, 0.85);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 
                0 0 35px rgba(0, 255, 255, 0.35);
}

.magnetic-card:hover .card-spotlight {
    opacity: 1;
}

/* Contenido de la tarjeta flotante */
.card-content-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.card-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(0, 255, 255, 0.08);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.magnetic-card:hover .card-icon-box {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
    transform: scale(1.08) translateZ(15px);
}

.card-tag {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #bbb;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px 0;
    transition: color 0.2s ease;
}

.magnetic-card:hover .card-title {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

.card-description {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.card-footer-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

.card-footer-action i {
    transition: transform 0.25s ease;
}

.magnetic-card:hover .card-footer-action i {
    transform: translateX(6px);
}

/* 5. Barra de Retorno Superior en cada Sub-sección */
.section-return-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px 18px;
    background: rgba(10, 10, 20, 0.65);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.btn-section-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 7px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-section-back:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 15px var(--neon-cyan);
    transform: translateX(-3px);
}

/* 6. Modales Translúcidos Glassmorphism */
.modal-translucent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 10, 0.8);
    backdrop-filter: blur(20px) saturate(160%);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-translucent-card {
    background: rgba(12, 12, 24, 0.92);
    border: 1px solid rgba(0, 255, 255, 0.35);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 255, 255, 0.18);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    box-sizing: border-box;
    position: relative;
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-modal-close:hover {
    background: #ff4d4d;
    border-color: #ff4d4d;
    color: #fff;
}

