/* --- FONDOS DINÁMICOS Y CAPAS --- */
.bg-matrix-layer {
    position: fixed; top: 0; bottom: 0; width: 50%; z-index: 0;
    pointer-events: none; background-repeat: no-repeat; background-size: cover;
    background-position: center; opacity: 0.15; filter: blur(var(--bg-blur));
    transition: opacity var(--transition-speed) ease, filter var(--transition-speed) ease;
}
.bg-layer-fungyPOP { right: 0; left: 0; width: 100%; background-image: var(--img-fungyPOP); }

body[data-focus="fungy-pop"] .bg-layer-fungyPOP,
body[data-focus="center"] .bg-layer-fungyPOP { opacity: 0.35; filter: blur(4px); }

/* --- QUIZ & TRIAJE --- */
#quiz-layer {
    position: fixed; inset: 0; background: var(--bg-dark); z-index: 500;
    display: flex; justify-content: center; align-items: center; transition: opacity 0.4s ease;
}
.quiz-card {
    background: var(--bg-panel); border: 1px solid #1e293b; padding: 2.5rem;
    border-radius: 16px; width: 90%; max-width: 550px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
    position: relative;
}
.quiz-skip-container {
    position: absolute; top: 1rem; right: 1rem; display: flex; align-items: center; gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.4rem 0.8rem; border-radius: 50px; cursor: pointer; transition: 0.2s;
}
.quiz-skip-container:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); }
.quiz-skip-logo { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.quiz-skip-text { font-size: 0.75rem; color: var(--text-light); font-weight: 500; letter-spacing: 0.5px; }

.quiz-step { display: none; margin-top: 1rem; }
.quiz-step.active { display: block; }
.options-grid { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }

.quiz-btn {
    background: #111827; border: 1px solid #1e293b; color: var(--text-light);
    padding: 1rem; border-radius: 8px; text-align: left; cursor: pointer; transition: 0.2s;
}
.quiz-btn:hover {
    background: #1f2937; border-color: #f3f4f6;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); transform: translateX(5px);
}
.progress-container { height: 6px; background: #111827; border-radius: 10px; margin-top: 2rem; overflow: hidden; }
.progress-bar { height: 100%; width: 20%; background: linear-gradient(90deg, var(--fungyPOP-neon), var(--fungyPOP-neon)); transition: width 0.3s; }

/* --- MAQUETACIÓN DE LA GRID MATRICIAL (menú + panel único Fungy-POP) --- */
#matrix-layer {
    display: none; opacity: 0; min-height: 100vh;
    grid-template-columns: 1fr 420px; transition: opacity 0.4s ease;
    position: relative; z-index: 10; max-width: 1100px; margin: 0 auto;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.side-panel { padding: 3rem 1.5rem; transition: 0.3s; animation: fadeInUp 1s ease-out; }
.panel-fungyPOP { border-left: 1px solid rgba(168, 85, 247, 0.15); background: linear-gradient(180deg, rgba(88, 28, 135, 0.12) 0%, transparent 100%); }

.avatar { width: 120px; height: 120px; object-fit: cover; margin-bottom: 1rem; background: #1f2937; }
.panel-fungyPOP .avatar { border: 2px solid var(--fungyPOP-neon); box-shadow: 0 0 15px var(--fungyPOP-glow); border-radius: 50%; }

.dynamic-view { position: relative; min-height: 250px; }
.pane-data { position: absolute; inset: 0; opacity: 0; transform: translateY(10px); visibility: hidden; transition: all 0.3s ease; }
.pane-data.active { opacity: 1; transform: translateY(0); visibility: visible; }
.pane-data h4 { margin-bottom: 0.8rem; font-size: 1.1rem; color: #fff; }
.pane-data p, .pane-data li { font-size: 0.9rem; color: #9ca3af; line-height: 1.6; }

/* Contenedor del widget de Google Calendar.
   Nota: el contenido interno del iframe vive en el dominio de Google y
   no puede ser re-estilizado desde aquí (cross-origin), así que en vez
   de intentar "oscurecerlo" (imposible), se le da un marco propio sólido
   para que la transición entre el sitio oscuro y el widget claro de
   Google se vea intencional y no como un error visual. */
.calendar-embed {
    width: 100%;
    height: 560px;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.calendar-embed iframe { display: block; background: #ffffff; }

/* --- CONTENEDOR CENTRAL DE FILAS (MENÚ ORIGINAL) --- */
.menu-center { display: grid; grid-template-rows: repeat(5, 1fr); background: rgba(0,0,0,0.2); position: relative; }
.menu-row { display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #111827; position: relative; cursor: pointer; }
.row-label { font-size: 1.1rem; color: #4b5563; transition: 0.3s; z-index: 5; text-transform: uppercase; letter-spacing: 2px; }
.menu-row.row-highlight .row-label { color: var(--text-light); transform: scale(1.1); text-shadow: 0 0 10px rgba(255,255,255,0.3); }

/* Fila específica del Isotipo */
.row-logo { background: transparent; display: flex; justify-content: center; align-items: center; }
.center-logo-img {
    width: 65px; height: 65px; object-fit: cover; border-radius: 50%;
    transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
    border: 2px solid rgba(255, 255, 255, 0.1);
}
.row-logo:hover .center-logo-img {
    transform: scale(1.08);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.35));
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.social-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 1rem; }
.social-icon { background: #111827; padding: 0.6rem; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #6b7280; border: 1px solid transparent; transition: 0.2s; }
.panel-fungyPOP .social-icon:hover { border-color: var(--fungyPOP-neon); color: var(--fungyPOP-neon); }
.social-icon svg { width: 18px; height: 18px; fill: currentColor; }

.panel-dimmed { opacity: 0.2; filter: blur(4px); }

/* Switcher Táctil Móvil (una sola columna: Fungy-POP) */
.mobile-switch {
    display: none; grid-template-columns: 1fr; background: #111827; border: 1px solid #1e293b;
    padding: 0.3rem; border-radius: 30px; margin: 0 auto 2rem; max-width: 220px; position: sticky; top: 1rem; z-index: 100;
}
.mobile-switch button { background: transparent; border: none; color: #6b7280; padding: 0.6rem; border-radius: 25px; font-weight: bold; font-size: 0.85rem; cursor: pointer; transition: 0.3s; }
    .mobile-switch button.active-fungy-pop { background: var(--fungyPOP-neon); color: #fff; box-shadow: 0 0 10px var(--fungyPOP-glow); }

/* --- ADAPTACIÓN DISPOSITIVOS GRANDE A PEQUEÑO --- */
@media (max-width: 900px) {
    #matrix-layer { display: block; padding: 2rem 1rem; max-width: 500px; margin: 0 auto; }
    .bg-matrix-layer { width: 100%; opacity: 0.08 !important; }
    .menu-center { display: none; }
    .mobile-switch { display: grid; }
    .side-panel { 
        display: none; border: 1px solid #1e293b; border-radius: 16px; 
        background: rgba(13, 19, 36, 0.85); backdrop-filter: blur(8px);
        padding: 2rem 1.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .side-panel.mobile-active { display: block; animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
    .dynamic-view { display: flex; flex-direction: column; gap: 1.5rem; min-height: auto; }
    .pane-data { 
        position: relative; opacity: 1 !important; visibility: visible !important; 
        transform: none !important; display: block; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 1rem;
    }
    .pane-data:last-child { border-bottom: none; padding-bottom: 0; }
    .pane-data.p-def { display: none; } 
    .panel-dimmed { opacity: 1; filter: none; }
    .calendar-embed { height: 620px; }
}