/* ==========================================================================
   INICIO DE ESTILOS PARA EL LOGIN Y ELEMENTOS FIJOS (VERSIÓN CORREGIDA)
   ========================================================================== */
#login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1; 
    overflow: hidden;
    pointer-events: none;
}

#skyBG { 
    position: absolute;
    z-index: 1; 
    width: 100%;
    height: 100%;
    transition: opacity 2s ease-in-out; /* Transición suave para la opacidad de las nubes */
}

/* NUEVO: Contenedor para el conjunto del mástil y la bandera */
#flag-wrapper {
    position: fixed;
    top: 0;
    left: 5%; /* <-- ¡AQUÍ CONTROLAS LA POSICIÓN! Ajústala como desees */
    height: 100%;
    width: 250px; /* Un ancho suficiente para el mástil y la bandera ondeando */
    z-index: 2; /* Por encima del cielo */
}

/* El SVG de la bandera ahora solo necesita llenar su nuevo contenedor */
.flagpole { 
    width: 100%; 
    height: 100%; 
}

/* NUEVO: Estilos para las estrellas */
#stars circle {
    fill: white;
    animation: twinkle 4s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
/* FIN NUEVO */

body.logged-in #login-background,
body.logged-in .github-link { 
    display: none; 
}
body.logged-out { background-image: none !important; }

.github-link {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s;
}
.github-link:hover {
    background-color: rgba(255, 255, 255, 0.7);
    color: black;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.github-link svg {
    width: 20px;
    height: 20px;
    fill: #2c3e50;
    transition: fill 0.3s;
}
 .github-link:hover svg {
    fill: black;
 }

/* NUEVO: Estilos para el overlay de carga */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    visibility: hidden;
}
#loader-overlay.visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}
.loader {
    border: 8px solid var(--panel-border);
    border-top: 8px solid var(--primary-accent);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
}
/* FIN NUEVO */

/* ==========================================================================
   FIN DE ESTILOS PARA EL LOGIN Y ELEMENTOS FIJOS
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES GLOBALES Y KEYFRAMES
   ========================================================================== */
:root {
    --bg-color: #f4f7f9;
    --note-color: #fffde7;
    --note-shadow: rgba(0, 0, 0, 0.1);
    --primary-accent: #5a7dcb;
    --primary-accent-dark: #405b9b;
    --panel-bg: rgba(255, 255, 255, 0.6);
    --panel-border: rgba(255, 255, 255, 0.8);
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --zone-bg: rgba(90, 125, 203, 0.1);
    --zone-border: rgba(90, 125, 203, 0.4);
    --highlight-color: #ffc107;
    --danger-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --modal-bg: white;
    --input-bg: white;
    --input-border: #ccc;
    --control-btn-icon-color: white;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(39, 174, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

body.dark-mode {
    --bg-color: #1a1a2e;
    --note-color: #2c3e50;
    --note-shadow: rgba(0, 0, 0, 0.3);
    --primary-accent: #7a9dff;
    --primary-accent-dark: #5a7dcb;
    --panel-bg: rgba(44, 62, 80, 0.7);
    --panel-border: rgba(74, 98, 128, 0.8);
    --text-dark: #e0e0e0;
    --text-light: #9a9a9a;
    --zone-bg: rgba(122, 157, 255, 0.1);
    --zone-border: rgba(122, 157, 255, 0.3);
    --modal-bg: #2c3e50;
    --input-bg: #1a1a2e;
    --input-border: #4a4a6a;
    --control-btn-icon-color: #e0e0e0;
}

body.dark-mode .github-link { background-color: rgba(10, 10, 20, 0.4); border-color: rgba(40, 40, 60, 0.6); color: #e0e0e0; }
body.dark-mode .github-link:hover { background-color: rgba(10, 10, 20, 0.7); color: white; }
body.dark-mode .github-link svg { fill: #e0e0e0; }
/* ==========================================================================
   2. ESTILOS BASE Y DE LAYOUT
   ========================================================================== */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23dce3eb" fill-opacity="0.4"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    color: var(--text-dark);
}
body.dark-mode {
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%233a4a6b" fill-opacity="0.4"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

#google-signin-btn { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 15px 30px; font-size: 18px; font-weight: 600; color: white; background-color: #DB4437; border: none; border-radius: 8px; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.2); z-index: 10000; }
.logged-in #google-signin-btn { display: none; }
.logged-out .main-content { display: none; }
.main-content { opacity: 0; transition: opacity 0.5s ease-in-out; }
.logged-in .main-content { opacity: 1; }

#app { 
    position: relative; 
    width: 100%; 
    box-sizing: border-box; 
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 70px 20px 20px 20px; 
    cursor: grab; /* Cursor para indicar que se puede mover el fondo */
}

/* NUEVO: Cursor cuando se está moviendo el fondo */
#app.panning {
    cursor: grabbing;
}

/* NUEVO: Contenedor para todo el contenido que se puede mover y ampliar */
#workspace {
    position: relative; /* Para ser el contexto de posicionamiento de notas y zonas */
    width: 100%;
    height: 100%;
    transform-origin: 0 0; /* El zoom se origina en la esquina superior izquierda */
}

.draggable { position: absolute; z-index: 10; cursor: move; }
.dragging { z-index: 999 !important; }

/* ==========================================================================
   3. COMPONENTES: CONTROLES SUPERIORES Y PERFIL
   ========================================================================== */
#top-controls { position: fixed; top: 15px; left: 20px; right: 20px; z-index: 1001; display: flex; gap: 12px; align-items: center; }
#workspace-title { font-size: 24px; font-weight: 600; color: var(--text-dark); flex-grow: 1; }
#save-status { font-size: 14px; color: var(--text-light); transition: opacity 0.3s ease; margin-right: 10px; }

.control-btn { padding: 10px 22px; font-size: 14px; font-weight: 600; color: white; background-color: var(--primary-accent); border: none; border-radius: 50px; cursor: pointer; box-shadow: 0 5px 15px rgba(90, 125, 203, 0.3); transition: all 0.3s ease; }
.control-btn:hover { background-color: var(--primary-accent-dark); transform: translateY(-2px); }
.control-btn.secondary { background-color: #95a5a6; }
.control-btn.secondary:hover { background-color: #7f8c8d; }
#sidebar-toggle-btn { display: none; }

.profile-menu-container { position: relative; }
.profile-avatar { width: 45px; height: 45px; border-radius: 50%; cursor: pointer; border: 2px solid var(--panel-border); box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: transform 0.2s ease; }
.profile-avatar:hover { transform: scale(1.05); }
.profile-dropdown { position: absolute; top: 120%; right: 0; width: 220px; background-color: white; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); padding: 15px; box-sizing: border-box; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 1005; }
.profile-dropdown { background-color: var(--modal-bg); }
.profile-menu-container:hover .profile-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.profile-dropdown .user-info { text-align: center; padding-bottom: 15px; border-bottom: 1px solid var(--panel-border); margin-bottom: 10px; }
.profile-dropdown .user-name { font-weight: 600; color: var(--text-dark); margin: 0; font-size: 16px; }
.profile-dropdown .signout-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: none; background-color: transparent; font-size: 14px; font-weight: 500; color: var(--danger-color); border-radius: 8px; cursor: pointer; transition: background-color 0.2s ease; }
body:not(.dark-mode) .profile-dropdown .signout-btn:hover { background-color: #fef2f2; }
body.dark-mode .profile-dropdown .signout-btn:hover { background-color: rgba(231, 76, 60, 0.1); }

#theme-toggle-btn {
    padding: 10px;
    width: 44px;
    height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}
#theme-toggle-btn svg { width: 20px; height: 20px; stroke: var(--control-btn-icon-color); fill: none; }
.moon-icon { display: none; }
body.dark-mode .moon-icon { display: block; }
body.dark-mode .sun-icon { display: none; }

/* ==========================================================================
   4. COMPONENTES: NOTAS Y ZONAS
   ========================================================================== */
.note {
    box-shadow: 0 8px 25px var(--note-shadow);
    border-radius: 8px;
    background-color: var(--note-color);
    overflow: hidden;
    padding: 0;
    display: flex;
}
.note textarea {
    font-family: 'Caveat', cursive;
    font-size: 22px;
    line-height: 1.5;
    color: var(--text-dark);
    border: none;
    background: transparent;
    outline: none;
    resize: none;
    width: 100%;
    padding: 0;
    margin: 0;
}
.zone { 
    background-color: var(--zone-bg); 
    backdrop-filter: blur(5px); 
    border: 1px solid var(--zone-border); 
    border-radius: 12px; 
    box-sizing: border-box; 
    overflow: hidden; /* Oculta cualquier desbordamiento de las líneas de la cuadrícula */
    transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
    padding: 45px 15px 15px 15px; 
    min-width: 250px; 
    min-height: 200px;
}
.zone-title { position: absolute; top: 12px; left: 15px; font-weight: 600; font-size: 16px; color: var(--primary-accent-dark); border: none; background: transparent; width: calc(100% - 60px); outline: none; margin: 0; padding: 0; }
/* NUEVO: Estilo para simular placeholder en elementos contenteditable */
.zone-title:empty::before {
    content: attr(data-placeholder);
    color: var(--text-light);
    cursor: text;
}

/* NUEVO: Estilos para la cuadrícula de la zona */
.zone-grid-container {
    position: absolute;
    top: 45px; /* Empieza debajo del título/padding superior */
    left: 15px; /* Empieza después del padding izquierdo */
    width: calc(100% - 30px); /* Ancho completo menos padding izquierdo/derecho */
    height: calc(100% - 60px); /* Alto completo menos padding superior/inferior */
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columnas */
    grid-template-rows: repeat(2, 1fr);    /* 2 filas */
    gap: 0;
    pointer-events: none; /* Permite que los eventos de ratón pasen a los elementos subyacentes */
    z-index: 0; /* Asegura que esté detrás de las notas */
}

.zone-grid-cell {
    box-sizing: border-box;
    border-right: 1px dashed rgba(0, 0, 0, 0.1);
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
    transition: background-color 0.1s ease-in-out;
}

/* Eliminar borde derecho de las celdas de la última columna */
.zone-grid-cell:nth-child(4n) {
    border-right: none;
}
/* Eliminar borde inferior de las celdas de la última fila (celdas 5, 6, 7, 8) */
.zone-grid-cell:nth-child(n + 5) {
    border-bottom: none;
}
/* NUEVO: Estilo para resaltar la zona cuando una nota se arrastra sobre ella */
.zone.drop-target {
    box-shadow: 0 0 0 3px var(--primary-accent), 0 8px 25px rgba(90, 125, 203, 0.4);
    border-color: var(--primary-accent-dark);
}
.add-note-in-zone-btn, .view-full-zone-btn { display: none; }
/* NUEVO: Estilo para resaltar la celda de la cuadrícula */
.zone-grid-cell.highlight {
    background-color: rgba(90, 125, 203, 0.1);
}
.delete-btn { width: 24px; height: 24px; text-align: center; line-height: 24px; font-size: 20px; border-radius: 50%; cursor: pointer; user-select: none; transition: background-color 0.2s, color 0.2s; color: var(--text-light); }
.delete-btn:hover { background-color: var(--danger-color); color: white; }

/* ==========================================================================
   4.1 COMPONENTES: NOTAS DENTRO DE ZONAS (NUEVO)
   ========================================================================== */
/* El contenedor de notas de la zona ya no usa grid, ya que las notas son absolutas */
.zone-notes-container-desktop {
    width: 100%;
    height: 100%;
}
/* Una nota en una zona ahora es solo visualmente distinta, pero sigue siendo posicionada absolutamente. */
.note.is-in-zone {
    /* Se eliminan los overrides de position, left, top, width, height. */
    /* Se añade un efecto visual para indicar que pertenece a una zona. */
    box-shadow: 0 0 0 2px var(--primary-accent-dark), 0 8px 25px var(--note-shadow);
    border: 1px solid var(--primary-accent);
}
/* La redimensión ahora está habilitada para todas las notas, por lo que la regla que la ocultaba se elimina. */
/* ==========================================================================
   5. COMPONENTES: DASHBOARD INFERIOR Y WIDGETS
   ========================================================================== */
#bottom-dashboard { 
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--dashboard-bg, rgba(239, 243, 245, 0.7)); backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.05); 
    display: flex; align-items: flex-start; justify-content: center; 
    padding: 30px 20px; box-sizing: border-box; 
    z-index: 1002; gap: 25px; 
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); 
}
.dashboard-widget { height: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; color: var(--text-dark); text-align: center; background-color: var(--panel-bg); border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.07); padding: 15px; border: 1px solid var(--panel-border); transition: all 0.3s ease; transform: translateY(0); }
.dashboard-widget:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.dashboard-widget h3 { margin: 0 0 12px 0; padding-bottom: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-light); letter-spacing: 0.8px; width: 100%; border-bottom: 1px solid rgba(0,0,0,0.08); }
/* NUEVO: Estilos para el widget de notas clickeable */
.dashboard-widget.clickable {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.dashboard-widget.clickable:hover {
    background-color: var(--panel-bg); /* El hover se gestiona con el :hover general */
    transform: translateY(-8px); /* More pronounced hover effect */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
/* FIN NUEVO */
#dashboard-toggle { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); width: 60px; height: 30px; background-color: var(--primary-accent); border: none; border-radius: 15px 15px 0 0; box-shadow: 0 -4px 12px rgba(0,0,0,0.1); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.3s ease; z-index: 1003; }
#dashboard-toggle:hover { background-color: var(--primary-accent-dark); }
#dashboard-toggle svg { width: 20px; height: 20px; stroke: white; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

body.dashboard-hidden #bottom-dashboard { transform: translateY(calc(100% - 30px)); }
body:not(.dashboard-hidden) #app { height: calc(100vh - 230px); }
body.dashboard-hidden #app { height: calc(100vh - 30px); }
body:not(.dashboard-hidden) #dashboard-toggle svg { transform: rotate(180deg); }

/* INICIO: Estilos mejorados para el widget de notas */
#stats-widget .stats-container {
    display: flex;
    justify-content: space-around;
    align-items: baseline;
    width: 100%;
    margin-top: 5px;
    gap: 15px;
}

#stats-widget .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

#stats-widget .stat-value {
    font-size: 28px;
    font-weight: 600;
}

#stats-widget .stat-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
}
/* FIN: Estilos mejorados para el widget de notas */

/* INICIO ESTILOS WIDGET RELOJ */
#clock-widget {
    cursor: pointer;
    user-select: none;
}
#clock-greeting {
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.8px;
    width: 100%;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.time-display-wrapper {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: 'Poppins', monospace;
}
#clock-widget #current-time {
    font-size: 36px;
    font-weight: 600;
    line-height: 1;
}
#clock-widget #current-seconds {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-light);
    transition: opacity 0.3s ease;
    opacity: 1;
}
#clock-widget #current-seconds.hidden {
    opacity: 0;
}
#clock-widget #current-date {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
    cursor: pointer;
    transition: color 0.2s ease;
}
#clock-widget #current-date:hover {
    color: var(--primary-accent);
}
/* FIN ESTILOS WIDGET RELOJ */

#calendar-widget { min-width: 270px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 8px; }
.calendar-header h3 { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.calendar-header button { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--primary-accent); }
#month-year { font-size: 14px; font-weight: 600; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; width: 100%; }
.calendar-grid span { text-align: center; padding: 2px; font-size: 12px; position: relative; }
.day-name { font-weight: 600; color: var(--text-light); }
.day { cursor: pointer; border-radius: 50%; transition: background-color 0.2s; }
body:not(.dark-mode) .day:hover { background-color: #e0e0e0; }
body.dark-mode .day:hover { background-color: #3a4a6b; }
.day.current-day { background-color: var(--highlight-color); color: white; font-weight: 600; }
.day.selected-day { box-shadow: 0 0 0 2px var(--primary-accent); }
.day.has-notes::after { content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background-color: var(--primary-accent); border-radius: 50%; }

/* ==========================================================================
   5.1 COMPONENTES: CONTROLES DE ZOOM (NUEVO)
   ========================================================================== */
#zoom-controls {
    position: fixed;
    bottom: 250px; /* Sobre el dashboard (230px) + 20px de margen */
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dashboard-hidden #zoom-controls {
    bottom: 50px; /* Sobre el dashboard colapsado (30px) + 20px de margen */
}

#zoom-controls button {
    width: 44px;
    height: 44px;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: var(--text-dark);
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

#zoom-controls button:hover {
    background-color: var(--primary-accent);
    color: white;
    border-color: var(--primary-accent);
    transform: scale(1.05);
}

#zoom-reset-btn {
    font-size: 20px;
}

/* INICIO ESTILOS WIDGET CRONÓMETRO */
#timer-widget.timer-running {
    animation: pulse-green 2s infinite ease-out;
}
#timer-widget.timer-running #timer-display,
#timer-widget.timer-running #edit-timer-btn {
    color: var(--success-color);
}
#timer-widget.timer-paused #timer-display,
#timer-widget.timer-paused #edit-timer-btn {
    color: var(--warning-color);
}
/* INICIO: Estilos para el anillo de progreso del cronómetro */
.timer-display-container { position: relative; display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; margin-bottom: 5px; }
.timer-progress-ring { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.timer-progress-ring__background { stroke: var(--panel-border); }
.timer-progress-ring__progress { stroke: var(--primary-accent); stroke-linecap: round; transition: stroke-dashoffset 0.3s linear, stroke 0.4s ease; }
#timer-widget.timer-running .timer-progress-ring__progress { stroke: var(--success-color); }
#timer-widget.timer-paused .timer-progress-ring__progress { stroke: var(--warning-color); }
/* FIN: Estilos para el anillo de progreso del cronómetro */

/* INICIO: Contenedor para el valor del cronómetro y el botón de edición */
.timer-value-wrapper {
    position: relative; /* Para que el contenido esté por encima del SVG */
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
/* FIN: Contenedor para el valor del cronómetro */

#timer-display {
    font-size: 32px;
    font-weight: 600;
    font-family: 'Poppins', monospace;
    letter-spacing: 2px;
    color: var(--text-dark);
    transition: color 0.4s ease;
    line-height: 1.1; /* Ajuste para que no esté tan pegado al botón */
}
#edit-timer-btn { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-light); padding: 2px; margin-top: 2px; border-radius: 50%; transition: color 0.2s, background-color 0.2s; }
body:not(.dark-mode) #edit-timer-btn:hover { background-color: #e0e0e0; }
body.dark-mode #edit-timer-btn:hover { background-color: #3a4a6b; }
.timer-buttons { margin-top: 5px; display: flex; gap: 15px; }
.timer-control-btn {
    width: 40px; height: 40px; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 1px solid var(--input-border); border-radius: 50%; background: var(--input-bg);
    color: var(--text-dark);
    transition: all 0.2s ease;
}
.timer-control-btn:hover { border-color: var(--primary-accent); color: var(--primary-accent); }
.timer-control-btn svg { width: 18px; height: 18px; fill: currentColor; }
.timer-presets { display: flex; gap: 8px; margin-top: 12px; }
.preset-btn {
    font-size: 12px; font-weight: 600; color: var(--text-light);
    padding: 4px 10px; border-radius: 20px; border: 1px solid var(--input-border); background: transparent;
    cursor: pointer; transition: all 0.2s ease;
}
.preset-btn:hover, .preset-btn.active {
    background-color: var(--primary-accent); color: white; border-color: var(--primary-accent);
}
/* FIN ESTILOS WIDGET CRONÓMETRO */

#youtube-widget input { border: 1px solid var(--input-border); border-radius: 4px; padding: 6px 8px; width: 180px; font-size: 12px; margin-bottom: 0; background-color: var(--input-bg); color: var(--text-dark); }
#youtube-player-container { position: relative; width: 200px; height: 112px; background: #000; border-radius: 8px; overflow: hidden; margin-top: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
#youtube-player-container iframe { width: 100%; height: 100%; border: none; }
#youtube-controls { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background-color: rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
#youtube-player-container:hover #youtube-controls, #youtube-player-container.paused #youtube-controls { opacity: 1; pointer-events: all; }
.yt-control-btn { background-color: rgba(255, 255, 255, 0.9); border: none; border-radius: 50%; width: 50px; height: 50px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,0.3); transition: transform 0.2s ease, background-color 0.2s ease; }
.yt-control-btn:hover { transform: scale(1.1); background-color: #fff; }
.yt-control-btn svg { width: 24px; height: 24px; fill: var(--text-dark); }

/* NUEVO: Estilos para el indicador de carga de YouTube */
.yt-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
    display: none; /* Oculto por defecto, se muestra con la clase .loading */
}
#youtube-player-container.loading .yt-loader {
    display: block;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* FIN NUEVO */

/* ==========================================================================
   6. COMPONENTES: MODALES
   ========================================================================== */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.visible { opacity: 1; pointer-events: auto; }
.modal-content { background-color: var(--modal-bg); padding: 40px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); text-align: center; max-width: 90%; width: 450px; transform: scale(0.9); transition: transform 0.3s ease, background-color 0.3s ease; }
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-content h2 { margin-top: 0; color: var(--text-dark); font-size: 28px; }
.modal-content p { font-size: 16px; color: var(--text-light); margin-bottom: 25px; }
.modal-content .action-btn { padding: 12px 30px; font-size: 16px; font-weight: 600; color: white; background-color: var(--primary-accent); border: none; border-radius: 50px; cursor: pointer; transition: background-color 0.2s; }
.modal-content .action-btn:hover { background-color: var(--primary-accent-dark); }
.set-timer-inputs { display: flex; justify-content: center; gap: 15px; margin-bottom: 30px; }
.set-timer-inputs input { width: 70px; padding: 10px; font-size: 24px; text-align: center; border: 1px solid var(--input-border); border-radius: 8px; font-weight: 600; background-color: var(--input-bg); color: var(--text-dark); }
.set-timer-inputs input::-webkit-outer-spin-button, .set-timer-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.set-timer-inputs input[type=number] { -moz-appearance: textfield; }
.modal-actions { display: flex; justify-content: center; gap: 15px; }
.modal-actions .confirm-btn { background-color: var(--primary-accent); color: white; }
.modal-actions .confirm-btn:hover { background-color: var(--primary-accent-dark); }
body:not(.dark-mode) .modal-actions .cancel-btn { background-color: #ecf0f1; color: var(--text-dark); }
body:not(.dark-mode) .modal-actions .cancel-btn:hover { background-color: #bdc3c7; }
body.dark-mode .modal-actions .cancel-btn { background-color: #4a4a6a; color: var(--text-dark); }
body.dark-mode .modal-actions .cancel-btn:hover { background-color: #5a5a7a; }

/* NUEVO: Estilos para el modal de lista de notas */
.modal-content.large-modal {
    width: 600px; /* Tamaño más grande para la lista */
    max-width: 95%;
    max-height: 80vh; /* Para que sea scrollable si hay muchas notas */
    display: flex;
    flex-direction: column;
}

#note-list-modal-title {
    margin-bottom: 20px;
}

.note-list-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px; /* Espacio para el scrollbar */
    margin-bottom: 20px;
    border-top: 1px solid var(--panel-border);
    padding-top: 15px;
    text-align: left; /* Alineación del contenido de la lista */
}

.note-list-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 8px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
body:not(.dark-mode) .note-list-item:hover {
    background-color: #eef2f5; 
    transform: translateX(3px);
}
.note-list-item-date {
    font-size: 12px;
    color: var(--text-light);
    margin-right: 15px;
    flex-shrink: 0;
    min-width: 100px; /* Para que la fecha tenga un ancho consistente */
}
.note-list-item-content {
    flex-grow: 1;
    font-size: 14px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Para cortar el texto largo */
}
.note-list-item-active-icon {
    margin-left: 10px;
    color: var(--primary-accent);
    font-size: 18px;
    display: none; /* Oculto por defecto */
    flex-shrink: 0;
}
.note-list-item.is-active .note-list-item-active-icon {
    display: block; /* Visible si la nota está activa */
}
.note-list-container .no-notes-message {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 20px;
}
/* FIN NUEVO */

/* NUEVO: Estilos para el slider lateral de notas de zona */
.slider-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.slider-active .slider-overlay {
    opacity: 1;
    visibility: visible;
}

.slider-panel {
    position: fixed;
    top: 0;
    right: -90vw; /* Oculto fuera de la pantalla (un poco más para asegurar) */
    width: 85vw;
    max-width: 1200px;
    height: 100vh;
    background-color: var(--bg-color);
    box-shadow: -5px 0 25px rgba(0,0,0,0.2);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.slider-active .slider-panel {
    right: 0; /* Lo hace visible */
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--panel-border);
    gap: 20px; /* Espacio entre título, botón y cierre */
    flex-shrink: 0;
}

.slider-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--text-dark);
    flex-grow: 1; /* Ocupa el espacio sobrante */
}

/* NUEVO: Estilo para el botón de añadir nota en el slider */
#slider-add-note-btn {
    padding: 8px 20px;
    font-size: 14px;
    flex-shrink: 0; /* Evita que se encoja */
}

.slider-close-btn {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.slider-close-btn:hover {
    color: var(--danger-color);
}

.slider-body {
    flex-grow: 1;
    display: flex;
    overflow: hidden; /* Evita que el contenido se desborde */
}

.slider-notes-list {
    width: 30%; /* Un poco más estrecho en % para dar más espacio al contenido */
    max-width: 320px; /* Pero con un máximo un poco mayor */
    border-right: 1px solid var(--panel-border);
    overflow-y: auto;
    padding: 15px 0;
    flex-shrink: 0;
}

.slider-note-item {
    padding: 15px 25px;
    cursor: pointer;
    border-bottom: 1px solid var(--panel-border);
    transition: background-color 0.2s ease;
    font-size: 15px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slider-note-item:last-child {
    border-bottom: none;
}

.slider-note-item:hover {
    background-color: var(--panel-bg);
}

.slider-note-item.active {
    background-color: var(--primary-accent);
    color: white;
    font-weight: 600;
}

.slider-note-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 0; /* El padding se manejará internamente */
    background-color: var(--note-color);
    position: relative; /* Para el posicionamiento del panel de "no seleccionada" */
}

/* NUEVO: Estilos para cuando no hay nota seleccionada */
.slider-no-note-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-light);
    font-size: 18px;
    padding: 30px;
}

/* NUEVO: Estilos para las pestañas dentro del slider */
.slider-note-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background-color: rgba(0,0,0,0.03);
    flex-shrink: 0;
}

.slider-note-tab {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    border-right: 1px solid rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    position: relative;
}

/* NUEVO: Estilos para la edición del nombre de la pestaña */
.slider-note-tab[contenteditable="true"]:focus {
    outline: 1px dashed var(--primary-accent);
    background-color: var(--panel-bg);
    color: var(--text-dark);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
    cursor: text;
}

.slider-note-tab:hover {
    background-color: rgba(0,0,0,0.05);
}

.slider-note-tab.active {
    background-color: var(--note-color);
    color: var(--primary-accent);
}

.slider-note-content-panels {
    flex-grow: 1;
    position: relative;
}

.slider-note-content-panel {
    position: absolute;
    width: 100%;
    height: 100%;
    flex-grow: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 30px;
    font-family: 'Caveat', cursive;
    font-size: 24px;
    line-height: 1.6;
    background-color: transparent;
    color: var(--text-dark);
    display: none; /* Oculto por defecto */
}

.slider-note-content-panel.active {
    display: block; /* Visible si está activo */
}

/* ==========================================================================
   7. MEDIA QUERIES (VISTAS DE MÓVIL Y ESCRITORIO)
   ========================================================================== */

/* --------------------------------------------------------------------------
   7.1 VISTA DE ESCRITORIO (min-width: 769px)
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {
    body.general-view #workspace-title {
        visibility: hidden;
    }

    .note {
        flex-direction: row;
    }
    .note .resize-handle, .zone .resize-handle {
        position: absolute;
        bottom: 0; right: 0;
        width: 20px; height: 20px;
        cursor: nwse-resize;
        z-index: 12;
    }
    .note .resize-handle::after, .zone .resize-handle::after {
        content: '';
        position: absolute;
        right: 5px; bottom: 5px;
        width: 8px; height: 8px;
        border-bottom: 2px solid var(--primary-accent-dark);
        border-right: 2px solid var(--primary-accent-dark);
        opacity: 0.6;
    }
    .note-tabs {
        flex-shrink: 0;
        width: 30px;
        background-color: rgba(0, 0, 0, 0.03);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        border-right: 1px solid rgba(0, 0, 0, 0.06);
    }
    .note-tab-btn {
        width: 14px;
        height: 14px;
        background-color: transparent;
        border: 2px solid var(--text-light);
        opacity: 0.5;
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.2s ease;
        padding: 0;
    }
    .note-tab-btn:hover {
        opacity: 1;
        transform: scale(1.1);
    }
    .note-tab-btn.active {
        background-color: var(--primary-accent);
        border-color: var(--primary-accent);
        opacity: 1;
    }
    .note-main-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        padding: 10px 15px 15px 15px;
        position: relative;
    }
    .note-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 5px;
    }
    /* NUEVO: Estilo para la "etiqueta de color" que controla el zoom */
    .note-zoom-handle {
        width: 40px; /* Ampliado para que sea más fácil hacer clic */
        height: 8px; /* Un poco más plano para un look de "asa" */
        background-color: var(--primary-accent);
        opacity: 0.5;
        border-radius: 10px; /* Más redondeado */
        cursor: pointer;
        transition: all 0.2s ease;
        margin: 0 8px; /* Espacio a ambos lados para separarlo del título y el botón de borrar */
        flex-shrink: 0;
    }
    .note-zoom-handle:hover {
        opacity: 1;
        transform: scale(1.1);
    }
    .tab-name-display {
        margin: 0;
        font-family: 'Poppins', sans-serif;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-dark);
        flex-grow: 1;
        padding: 5px;
        border-radius: 4px;
    }
    .tab-name-display:focus {
        outline: 1px dashed var(--primary-accent); 
        background-color: var(--panel-bg);
    }
    .note .delete-btn {
        position: static;
        flex-shrink: 0;
    }
    .note-content-panels {
        flex-grow: 1;
        position: relative;
    }
    .note-content-panel {
        display: none;
        width: 100%;
        height: 100%;
    }
    .note-content-panel.active { 
        display: block; 
    }
    .note .note-content-panel textarea {
        height: 100%;
        resize: none; 
    }
}

/* NUEVO: Estilos para la vista de nota en pantalla completa (zoom) */
/* Se ha modificado para usar 'filter: blur' en los elementos de fondo en lugar de 'backdrop-filter',
   para evitar problemas de renderizado que pueden causar que la nota activa se vea borrosa. */
body.note-view-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Un poco más oscuro para compensar la falta de blur */
    z-index: 1050;
    pointer-events: none; /* PERMITE que los clics lleguen a la nota con zoom, ignorando este fondo para eventos de ratón. */
}

body.note-view-active .note:not(.note-zoomed),
body.note-view-active .zone:not(.parent-of-zoomed) {
    pointer-events: none;
    filter: blur(5px); /* Aplicamos el desenfoque directamente a los elementos del fondo */
    opacity: 0.5; /* Aumentamos un poco la opacidad para que se vean mejor a través del desenfoque */
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* NUEVO: Estilo para la zona padre de una nota ampliada, para mantener el contexto visual */
body.note-view-active .zone.parent-of-zoomed {
    filter: none; /* Anula el desenfoque */
    opacity: 1; /* Anula el oscurecimiento */
    z-index: 1050; /* Se posiciona justo debajo de la nota ampliada (1051) */
    box-shadow: 0 0 0 3px var(--highlight-color), 0 8px 30px rgba(0,0,0,0.25);
    transform: scale(1.02); /* La hace resaltar un poco */
    transition: all 0.3s ease;
}

.note.note-zoomed {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    /* MEJORA: Se añade translateZ(0) para forzar la aceleración por hardware en su propia capa de renderizado.
       Esto previene el desenfoque que puede ocurrir en algunos navegadores cuando hay transformaciones (scale/zoom) en elementos padres. */
    transform: translate(-50%, -50%) translateZ(0) !important;
    width: 80vw !important;
    height: 80vh !important;
    z-index: 1051;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, width, height; /* Pista de optimización para el navegador */
}

/* MEJORA: Estilos internos de la nota cuando está en modo zoom */
.note.note-zoomed {
    /* Asegura que el layout interno se recalcule correctamente */
    display: flex !important;
    flex-direction: row !important;
}

.note.note-zoomed .note-content-panel textarea {
    /* MEJORA: Cambiamos a una fuente más robusta para la vista ampliada, evitando distorsión. */
    font-family: 'Poppins', sans-serif;
    font-size: 20px; /* Poppins es muy legible, no necesita ser tan grande */
    line-height: 1.6;
    padding: 20px; /* Más padding para que el texto respire en la vista grande */
}

    /* --------------------------------------------------------------------------
       7.2 VISTA MÓVIL (max-width: 768px) - VERSIÓN CORREGIDA Y MEJORADA
       -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    body { overflow-y: auto; overflow-x: hidden; height: auto; }
    body.sidebar-active, body.zone-view-active { overflow: hidden; }


    /* NUEVO: Ocultar controles de zoom en móvil */
    #zoom-controls {
        display: none;
    }

    #app {
        display: block;
        padding: 75px 15px 100px 15px;
        height: auto;
    }

    /* NUEVO: Estilos para las secciones de layout en móvil */
    .mobile-layout-section {
        margin-bottom: 30px;
    }
    .mobile-layout-section:last-child {
        margin-bottom: 0;
    }
    .mobile-section-title {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding-bottom: 8px;
        margin-bottom: 20px;
        border-bottom: 1px solid var(--panel-border);
    }
    .mobile-notes-container, .mobile-zones-container {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    #bottom-dashboard { display: none !important; }
    #dashboard-toggle { display: none; }
    #addZoneBtn, #addNoteBtn { display: none; }
    #notesContainer, #zonesContainer { display: none; }
    .resize-handle { display: none !important; }

    #top-controls {
        height: 60px;
        padding: 0 10px;
        gap: 8px;
        background: var(--dashboard-bg, rgba(239, 243, 245, 0.8));
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.9);
        border-bottom: 1px solid var(--panel-border);
    }
    
    #workspace-title { 
        font-size: 16px; 
        text-align: left; 
        white-space: nowrap; 
        overflow: hidden; 
        text-overflow: ellipsis;
        transition: color 0.2s ease;
    }
    #workspace-title:hover {
        cursor: pointer;
        color: var(--primary-accent);
    }

    #sidebar-toggle-btn { display: block; padding: 8px 12px; font-size: 18px; line-height: 1; }
    .profile-avatar { width: 40px; height: 40px; }
    /* MEJORA RESPONSIVA: Ajustamos el botón "General" para que se vea bien con el icono y texto corto */
    .control-btn.secondary { 
        padding: 6px 12px; /* Un poco más de padding horizontal */
        font-size: 13px; 
        display: flex; 
        align-items: center; /* Centrar icono y texto verticalmente */
        gap: 6px; /* Espacio entre icono y texto */
    }
    
    #mobile-sidebar-container { display: block; }
    .sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 1099; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
    #mobile-sidebar { position: fixed; top: 0; left: -300px; width: 300px; max-width: 85%; height: 100%; background: var(--modal-bg); z-index: 1100; box-shadow: 5px 0 15px rgba(0,0,0,0.1); transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease; display: flex; flex-direction: column; }
    body.sidebar-active .sidebar-overlay { opacity: 1; visibility: visible; }
    body.sidebar-active #mobile-sidebar { left: 0; }
    .sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #e0e0e0; }
    .sidebar-header h3 { margin: 0; font-size: 18px; color: var(--text-dark); }
    #close-sidebar-btn { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--text-light); padding: 0 5px; }
    .sidebar-content { overflow-y: auto; flex-grow: 1; }
    .sidebar-content .dashboard-widget { border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--panel-border); background: transparent; padding: 20px 15px; }
    .sidebar-content #stats-widget .stat-value { font-size: 24px; }
    .sidebar-content #stats-widget .stat-label { font-size: 9px; }
    .sidebar-content #stats-widget .stats-container { gap: 10px; }
    .sidebar-content .timer-display-container { width: 100px; height: 100px; }
    .sidebar-content #timer-display { font-size: 26px; }
    .sidebar-content #clock-widget #current-time { font-size: 28px; }
    .sidebar-content #clock-widget #current-seconds { font-size: 16px; }
    .sidebar-content .timer-display-container { justify-content: flex-start;}
    .sidebar-content #youtube-widget input { width: calc(100% - 16px); }
    .sidebar-content #youtube-player-container { width: 100%; height: 140px; }
    .sidebar-content .yt-control-btn { width: 45px; height: 45px; }
    .sidebar-content .yt-control-btn svg { width: 20px; height: 20px; }
    .sidebar-content .calendar-header { padding: 0 5px; }
    .sidebar-content .calendar-grid { gap: 1px; }
    .sidebar-content .day { padding: 4px 0; }

    .note, .zone { position: relative; width: 100% !important; height: auto !important; transform: none !important; cursor: default !important; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
    .zone { padding: 15px; padding-top: 55px; background: var(--zone-bg); }
    
    .zone .delete-btn {
        position: absolute;
        top: 14px;
        right: 15px;
        z-index: 5;
    }
    
    .note { flex-direction: column-reverse; min-height: 180px; }
    .note .delete-btn { position: absolute; top: 8px; right: 8px; z-index: 5; }
    .note-main-content, .note-header { display: contents; }
    .note-tabs { display: flex; flex-direction: row; width: 100%; border-top: 1px solid rgba(0, 0, 0, 0.08); }
    .note-tab-btn { background-color: transparent; border: none; border-right: 1px solid rgba(0, 0, 0, 0.08); flex-grow: 1; padding: 10px 5px; cursor: pointer; text-align: center; font-family: 'Poppins', sans-serif; font-size: 12px; color: var(--text-light); transition: all 0.2s ease; position: relative; }
    .note-tab-btn::after { content: attr(title); }
    .note-tab-btn:last-child { border-right: none; }
    .note-tab-btn.active { background-color: var(--note-color); color: var(--primary-accent); font-weight: 600; }
    .note-tab-btn.active::before { content: ''; position: absolute; width: 100%; height: 3px; background-color: var(--primary-accent); bottom: 0; left: 0; }
    .note-content-panels { padding: 35px 15px 15px 15px; flex-grow: 1; }
    .note-content-panel { position: static; display: none; height: 100%; }
    .note-content-panel.active { display: block; }
    .note textarea {
        min-height: 80px;
        font-size: 18px;
        overflow-y: hidden;
        resize: none;
    }
    
    .zone .add-note-in-zone-btn { display: flex; align-items: center; justify-content: center; position: absolute; top: 14px; right: 48px; width: 28px; height: 28px; background-color: var(--success-color); color: white; border: none; border-radius: 50%; cursor: pointer; font-size: 22px; line-height: 1; font-weight: 600; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: all 0.2s ease; }
    .zone .add-note-in-zone-btn:hover { background-color: #2ecc71; transform: scale(1.05); }
    .zone .view-full-zone-btn { display: block; position: absolute; top: 14px; right: 85px; padding: 4px 10px; font-size: 11px; font-weight: 600; background-color: var(--primary-accent-dark); color: white; border: none; border-radius: 20px; cursor: pointer; transition: background-color 0.2s; }
    .zone .view-full-zone-btn:hover { background-color: var(--primary-accent); }
    .zone .zone-title { width: calc(100% - 165px) !important; }
    .zone .zone-notes-container-mobile { margin-top: 15px; display: flex; flex-direction: column; gap: 12px; padding-left: 15px; border-left: 3px solid var(--primary-accent); }
    
    body.zone-view-active #app > .zone:not(.zone-fullscreen),
    body.zone-view-active #app > .note,
    body.zone-view-active #mobile-fab-container { display: none !important; }

    .zone.zone-fullscreen { position: fixed !important; top: 60px !important; left: 0 !important; width: 100% !important; height: calc(100vh - 60px) !important; z-index: 1060; overflow-y: auto; background: var(--bg-color); border-radius: 0 !important; border: none !important; padding: 20px !important; padding-top: 60px !important; }
    .zone.zone-fullscreen .zone-title { top: 20px !important; left: 20px !important; width: calc(100% - 180px) !important; }
    .zone.zone-fullscreen .view-full-zone-btn { top: 14px !important; right: 15px !important; width: auto; background-color: var(--danger-color); font-size: 13px; }
    .zone.zone-fullscreen .delete-btn { top: 14px !important; right: 80px !important; }
    .zone.zone-fullscreen .add-note-in-zone-btn { top: 14px !important; right: 115px !important; }

    #mobile-fab-container { display: flex; position: fixed; bottom: 20px; right: 20px; z-index: 1050; flex-direction: column-reverse; align-items: center; gap: 15px; }
    
    /* INICIO DE LA CORRECCIÓN */
    .fab-actions { 
        display: flex; 
        flex-direction: column-reverse; 
        gap: 15px; 
        pointer-events: none; /* Evita que el contenedor invisible capture clics */
    }
    /* FIN DE LA CORRECCIÓN */

    .fab-action { width: 48px; height: 48px; background-color: var(--primary-accent-dark); color: white; border-radius: 50%; border: none; box-shadow: 0 4px 12px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s; transform: scale(0.5); opacity: 0; }
    #fab-toggle-btn { width: 56px; height: 56px; background-color: var(--primary-accent); color: white; border-radius: 50%; border: none; box-shadow: 0 6px 20px rgba(0,0,0,0.25); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.3s ease, background-color 0.3s ease; }
    #fab-toggle-btn svg { transition: transform 0.3s ease; }
    #mobile-fab-container.fab-active #fab-toggle-btn { transform: rotate(45deg); background-color: var(--danger-color); }
    
    /* INICIO DE LA CORRECCIÓN */
    #mobile-fab-container.fab-active .fab-actions {
        pointer-events: auto; /* Permite que el contenedor capture clics SÓLO cuando está activo */
    }
    /* FIN DE LA CORRECCIÓN */

    #mobile-fab-container.fab-active .fab-action { transform: scale(1); opacity: 1; }
    #mobile-fab-container.fab-active .fab-action:nth-child(1) { transition-delay: 0.1s; }
    #mobile-fab-container.fab-active .fab-action:nth-child(2) { transition-delay: 0.05s; }

    .modal-content { padding: 25px 20px; width: 90%; }
    .modal-content h2 { font-size: 22px; }
    .modal-content p { font-size: 14px; }
    .set-timer-inputs input { width: 50px; padding: 8px; font-size: 20px; }
}
