/* style.css */

html {
    height: 100%; /* Ensure html element takes full height */
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables de Color para Modo Claro y Oscuro */
:root {
    /* Modo Claro (Predeterminado) */
    --bg-color: #ffffff;
    --text-color: #333;
    --text-muted-color: #555;
    --card-bg: rgba(248, 249, 250, 0.9);
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --primary-btn-bg: #000000;
    --primary-btn-text: #ffffff;
    --primary-btn-hover-bg: #333333;
    --secondary-btn-bg: transparent;
    --secondary-btn-text: #333333;
    --secondary-btn-hover-bg: rgba(0, 0, 0, 0.05);
    --secondary-btn-hover-text: #000000;
    --sidebar-bg: #ffffff;
    --sidebar-link-hover-bg: #f0f0f0;
    --menu-button-bg: rgba(255, 255, 255, 0.8); /* Fondo botón menú hamburguesa */
    --menu-button-hover-bg: rgba(255, 255, 255, 0.95);
    --menu-button-icon-color: #333;
    /* --- NUEVAS/MODIFICADAS Variables para Botón Dark Mode --- */
    --dark-toggle-bg: #000000;            /* FONDO NEGRO para botón en modo claro */
    --dark-toggle-hover-bg: #333333;      /* Hover gris oscuro */
    --dark-toggle-icon-color: #ffffff;    /* ICONO LUNA BLANCO sobre fondo negro */
    /* --- FIN NUEVAS/MODIFICADAS --- */
    --action-button-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    --action-button-hover-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    /* Table Variables - Light Mode */
    --border-color: #e0e0e0;
    --table-header-bg: #f8f9fa;
    --table-stripe-bg: rgba(0, 0, 0, 0.02);
    --table-hover-bg: rgba(0, 0, 0, 0.05);
    --table-footer-bg: #f8f9fa;
}

body.dark-mode {
    /* Modo Oscuro */
    --bg-color: #000000;
    --text-color: #e0e0e0;
    --text-muted-color: #aaaaaa;
    --card-bg: rgba(30, 30, 30, 0.9);
    --card-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
    --primary-btn-bg: #e0e0e0;
    --primary-btn-text: #1c1c1c;
    --primary-btn-hover-bg: #ffffff;
    --secondary-btn-bg: transparent;
    --secondary-btn-text: #c0c0c0;
    --secondary-btn-hover-bg: rgba(255, 255, 255, 0.1);
    --secondary-btn-hover-text: #ffffff;
    --sidebar-bg: #1e1e1e;
    --sidebar-link-hover-bg: #44475a;
    --menu-button-bg: rgba(40, 42, 54, 0.8); /* Fondo botón menú hamburguesa */
    --menu-button-hover-bg: rgba(40, 42, 54, 0.95);
    --menu-button-icon-color: #e0e0e0;
     /* --- NUEVAS/MODIFICADAS Variables para Botón Dark Mode --- */
    --dark-toggle-bg: #ffffff;            /* FONDO BLANCO para botón en modo oscuro */
    --dark-toggle-hover-bg: #f0f0f0;      /* Hover gris claro */
    --dark-toggle-icon-color: #000000;    /* ICONO SOL NEGRO sobre fondo blanco */
     /* --- FIN NUEVAS/MODIFICADAS --- */
    --action-button-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    --action-button-hover-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
    /* Table Variables - Dark Mode */
    --border-color: #44475a;
    --table-header-bg: #2a2a2a;
    --table-stripe-bg: rgba(255, 255, 255, 0.03);
    --table-hover-bg: rgba(255, 255, 255, 0.08);
    --table-footer-bg: #2a2a2a;
}

/* Estilos del Body */
body {
    font-family: 'Manrope', sans-serif;
    min-height: 100vh; /* Ensure body takes at least full height */
    color: var(--text-color);
    /* Remove flex centering from body */
    /* display: flex; */
    /* justify-content: center; */
    /* align-items: center; */
    position: relative;
    overflow-x: hidden; /* Keep horizontal overflow hidden */
    /* overflow: hidden; */ /* Prevent ALL body scrollbars - COMMENTED OUT FOR TOOL SCROLLING */
    background-color: var(--bg-color);
    transition: background-color 0.5s ease, color 0.5s ease;
    margin: 0; /* Ensure no default body margin */
}

/* Wrapper for all views */
#app-views-wrapper {
    width: 100%;
    height: 100vh; /* Occupy full viewport height */
    position: relative;
}


/* Wrapper for centered views */
#centered-views-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Use min-height to allow content growth */
    width: 100%;
    padding: 20px; /* Add some padding around centered content */
    box-sizing: border-box; /* Include padding in width/height */
}

/* Hide centered wrapper when not needed */
#centered-views-wrapper:not(.active) {
    display: none;
}


/* Botón Modo Oscuro/Claro */
.dark-mode-button {
    position: fixed;
    top: 20px;
    right: 20px;
    /* --- MODIFICACIÓN AQUÍ: Usa las nuevas variables --- */
    background: var(--dark-toggle-bg);
    color: var(--dark-toggle-icon-color);
    /* --- FIN MODIFICACIÓN --- */
    border: none;
    padding: 10px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 1001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Sombra un poco más visible */
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dark-mode-button:hover {
    /* --- MODIFICACIÓN AQUÍ: Usa la nueva variable hover --- */
    background-color: var(--dark-toggle-hover-bg);
    /* --- FIN MODIFICACIÓN --- */
}

/* Common Header Button Styles */
.header-button {
    position: fixed;
    top: 20px;
    background: var(--menu-button-bg); /* Use similar background */
    color: var(--menu-button-icon-color); /* Use similar text color */
    border: none;
    padding: 10px 15px;
    font-size: 16px; /* Adjust font size */
    cursor: pointer;
    border-radius: 8px;
    z-index: 1001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1;
    font-family: inherit; /* Ensure correct font */
    white-space: nowrap; /* Prevent text wrapping */
}

.header-button:hover {
    background-color: var(--menu-button-hover-bg);
}

/* Specific positioning for header buttons (right to left) */
#header-donar-btn {
    right: 75px; /* Next to dark mode toggle */
}
#header-contacto-btn {
    right: 185px; /* Adjust based on Donar width + gap */
}
#header-informacion-btn {
    right: 315px; /* Adjust based on Contacto width + gap */
}
#header-novedades-btn {
    right: 465px; /* Adjust based on Informacion width + gap */
}


/* Botón Menú Lateral - REMOVED */


/* Barra Lateral (Sidebar) - REMOVED */

/* Contenido Principal */
/* Styles for the card-like views INSIDE #centered-views-wrapper */
#centered-views-wrapper .main-content {
    text-align: center;
    padding: 30px 40px;
    max-width: 600px;
    background-color: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    z-index: 10;
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
    /* Ensure it doesn't inherit full height */
    height: auto;
    width: 100%; /* Take width within the centered wrapper */
}

/* Ensure view-container class doesn't conflict */
.view-container {
    width: 100%; /* Default width */
    display: none; /* Hidden by default, JS controls visibility */
}
.view-container.active {
    display: block; /* Or flex, handled by specific rules/JS */
}


.welcome-container h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 700;
    transition: color 0.5s ease;

}

.welcome-container p {
    font-size: 1.2em;
    color: var(--text-muted-color);
    margin-bottom: 40px;
    transition: color 0.5s ease;
}

/* Contenedor de Botones */
.button-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Estilo Base Botones de Acción */
.action-button {
    padding: 12px 20px;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--action-button-shadow);
    text-align: center;
    text-decoration: none; /* Remove underline from links styled as buttons */
}
/* Nueva regla para asegurar estilo del texto dentro del botón */
.action-button .button-text {
    font-weight: inherit; /* Hereda el font-weight del botón padre (.action-button) */
    line-height: inherit; /* Hereda line-height por si acaso */

}
/* Botón Primario */
.action-button.primary {
    background-color: var(--primary-btn-bg);
    color: var(--primary-btn-text);
}

.action-button.primary:hover {
    background-color: var(--primary-btn-hover-bg);
    box-shadow: var(--action-button-hover-shadow);
    transform: translateY(-2px);
}

/* Botón Secundario */
.action-button.secondary {
    background-color: var(--secondary-btn-bg);
    color: var(--secondary-btn-text);
    border: 1px solid transparent;
    box-shadow: none;
}

.action-button.secondary:hover {
    background-color: var(--secondary-btn-hover-bg);
    color: var(--secondary-btn-hover-text);
}

/* Media Query para pantallas más grandes */
@media (min-width: 600px) {
    .button-container {
        flex-direction: row;
        justify-content: center;
    }
     .main-content {
        padding: 40px 50px;
    }
}
/* Regla para que el icono ignore eventos del ratón */
.action-button i.fa-solid,
.action-button i.fa-regular,
.action-button i.fas, /* Clases comunes de FontAwesome v5/v6 */
.action-button i.far {
    pointer-events: none; /* El icono no interceptará clics ni hovers */
}
/* --- AÑADIR ESTAS NUEVAS REGLAS --- */

/* Contenedor Botón Tutorial (para centrarlo) */
.tutorial-button-container {
    margin-top: 30px; /* Espacio sobre el botón */
    text-align: center; /* Centra el botón inline-block */
}

/* Botón Tutorial */
.tutorial-button {
    display: inline-flex; /* Para alinear icono y texto */
    align-items: center;
    gap: 8px;
    padding: 8px 16px; /* Más pequeño que los botones principales */
    font-size: 0.9em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--primary-btn-bg); /* Usa variables del primario */
    color: var(--primary-btn-text);
    border: none;
    box-shadow: var(--action-button-shadow);
}

.tutorial-button:hover {
    background-color: var(--primary-btn-hover-bg);
    box-shadow: var(--action-button-hover-shadow);
    transform: translateY(-1px); /* Pop sutil */
}

.tutorial-button .button-text { /* Asegurar herencia */
     font-weight: inherit;
     line-height: inherit;
}

.tutorial-button i { /* Prevenir interferencia icono */
     pointer-events: none;
}

/* Estilos Base del Pop-up del Tutorial */
.tutorial-popup {
    position: fixed; /* Usamos fixed para posicionar relativo a la ventana */
    background-color: var(--card-bg); /* Reutilizamos el fondo de la tarjeta */
    color: var(--text-color);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1010; /* Encima de otros elementos */
    max-width: 350px; /* Ancho máximo */
    font-size: 0.95em;
    border: 1px solid rgba(0, 0, 0, 0.1); /* Borde sutil */
    transition: background-color 0.5s ease, color 0.5s ease, opacity 0.3s ease; /* Transiciones */
    opacity: 1; /* Visible por defecto cuando display != none */
}

/* Añadir estilos específicos en modo oscuro si es necesario */
body.dark-mode .tutorial-popup {
     border-color: rgba(255, 255, 255, 0.1);
     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}


/* Botón de cerrar dentro del pop-up */
.tutorial-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-muted-color);
    cursor: pointer;
    transition: color 0.2s ease;
}
.tutorial-close:hover {
    color: var(--text-color);
}

/* Texto del pop-up */
.tutorial-text {
    margin-bottom: 15px;
    line-height: 1.5;
}

/* Botón "Siguiente" del pop-up */
.tutorial-next {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 10px;
    background-color: var(--primary-btn-bg); /* Estilo similar a botones primarios */
    color: var(--primary-btn-text);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-align: center;
}
.tutorial-next:hover {
     background-color: var(--primary-btn-hover-bg);
}

/* Clases de Posicionamiento (Aproximadas - ajustar según sea necesario) */
/* Usaremos JS para añadir/quitar estas clases al popup */
.tutorial-popup.pos-step-1 {
    top: 10%; /* Ajustar */
    left: 50%;
    transform: translateX(-50%); /* Centrar horizontal */
    /* Podríamos añadir un :after para la flecha si se desea */
}
.tutorial-popup.pos-step-2 {
    top: 50%;
    left: 20%; /* Ajustar */
    transform: translateY(-50%);
}
.tutorial-popup.pos-step-3 {
    top: 50%;
    right: 20%; /* Ajustar */
    transform: translateY(-50%);
    left: auto; /* Resetear left si se usa right */
}
.tutorial-popup.pos-step-4 {
    top: 70px; /* Debajo del botón menú */
    left: 20px;
}
.tutorial-popup.pos-step-5 {
    top: 70px; /* Debajo del botón dark mode */
    right: 20px;
    left: auto; /* Resetear left */
}

/* --- Estilos para #nueva-atencion-view --- */

#nueva-atencion-view h2 {
    font-size: 2em; /* Ajustar tamaño si es necesario */
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 700;
    text-align: center; /* Asegurar centrado */
}

#nueva-atencion-view .form-description {
    font-size: 1.1em; /* Ajustar tamaño si es necesario */
    color: var(--text-muted-color);
    margin-bottom: 30px; /* Más espacio antes del form */
    text-align: center; /* Asegurar centrado */
}

#nueva-atencion-form {
    width: 100%; /* Ocupar el ancho del contenedor .main-content */
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Grid responsivo */
    gap: 20px; /* Espacio entre elementos del grid */
    margin-bottom: 25px; /* Espacio antes del campo de notas */
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left; /* Alinear texto a la izquierda dentro del grupo */
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-muted-color);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1); /* Borde sutil */
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit; /* Usar la fuente del body */
    background-color: var(--bg-color); /* Fondo que se adapta al modo */
    color: var(--text-color); /* Texto que se adapta al modo */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    resize: none; /* Deshabilitar redimensionamiento */
}

/* Estilos específicos modo oscuro para inputs */
body.dark-mode .form-group input[type="text"],
body.dark-mode .form-group input[type="number"],
body.dark-mode .form-group input[type="date"],
body.dark-mode .form-group input[type="tel"],
body.dark-mode .form-group input[type="email"],
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    border-color: rgba(255, 255, 255, 0.2);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-btn-bg); /* Resaltar borde con color primario */
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1); /* Sombra sutil al enfocar */
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    border-color: var(--primary-btn-bg); /* Color primario del modo oscuro */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.form-group select {
    appearance: none; /* Quitar estilo nativo */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23${encodeURIComponent(getComputedStyle(document.documentElement).getPropertyValue('--text-muted-color').trim().substring(1))}' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E"); /* Flecha SVG dinámica */
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    padding-right: 35px; /* Espacio para la flecha */
}

/* Actualizar color flecha select en modo oscuro (requiere JS o variables CSS más complejas) */
/* Simplificación: Usar un color gris que funcione en ambos modos o dejarlo como está */

.form-group.full-width {
    grid-column: 1 / -1; /* Ocupar todas las columnas */
}

.form-button-container {
    display: flex;
    flex-direction: column; /* Apilados por defecto */
    gap: 15px;
    align-items: center; /* Centrar botones */
    margin-top: 30px; /* Espacio sobre los botones */
}

/* Heredar estilos de .action-button para los botones del form */
.form-button-container .action-button {
    width: 100%; /* Ancho completo en móvil */
    max-width: 300px; /* Ancho máximo para que no sean gigantes */
}

/* Media Query para botones del form en pantallas más grandes */
@media (min-width: 600px) {
    .form-button-container {
        flex-direction: row; /* Lado a lado */
        justify-content: center; /* Centrar horizontalmente */
    }
    .form-button-container .action-button {
        width: auto; /* Ancho automático */
        min-width: 200px; /* Ancho mínimo razonable */
    }
}

/* --- Estilos para #atencion-proceso-view --- */

/* --- Styles for #atencion-proceso-view (Full Screen Layout) --- */

/* --- Styles for #atencion-proceso-view (Full Screen Layout) --- */
/* This rule now primarily controls visibility via JS */
#atencion-proceso-view {
    /* Inherits width/height from #app-views-wrapper when active */
    /* display: flex; is set when active by JS */
    background-color: var(--bg-color);
    overflow: hidden;
    /* Remove properties handled by wrapper or layout */
    /* width: 100%; */
    /* height: 100vh; */
    /* padding: 0; */
    /* box-shadow: none; */
    /* border-radius: 0; */
    /* max-width: none; */
}

/* Ensure it's displayed as flex when active */
#atencion-proceso-view.active {
    display: flex;
}


.atencion-layout {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 0; /* No gap between sidebar and main content */
}

/* Sidebar (Fixed Left, Full Height) */
.atencion-sidebar {
    width: 260px; /* Slightly narrower */
    flex-shrink: 0;
    height: 100vh; /* Full viewport height */
    background-color: var(--bg-color); /* Match main background */
    padding: 20px 15px; /* Adjust padding */
    overflow-y: auto;
    border-right: 1px solid rgba(0, 0, 0, 0.1); /* Subtle separator */
    transition: background-color 0.5s ease, border-color 0.5s ease;
    /* Remove old border, radius, card-bg */
    border: none;
    border-radius: 0;
}

body.dark-mode .atencion-sidebar {
    border-right-color: rgba(255, 255, 255, 0.15); /* Dark mode separator */
    background-color: var(--bg-color);
}

.sidebar-category {
    margin-bottom: 25px; /* Increased spacing */
}

.category-title {
    font-size: 0.85em; /* Slightly smaller */
    font-weight: 600; /* Less bold */
    color: var(--text-muted-color);
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-left: 5px;
    border-bottom: none; /* Remove bottom border */
    padding-bottom: 0;
}

/* Remove dark mode override for category title border as it's gone */
/* body.dark-mode .category-title { ... } */

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    padding: 9px 12px; /* Adjust padding */
    font-size: 0.9em; /* Slightly smaller */
    color: var(--text-color);
    border-radius: 4px; /* Slightly less rounded */
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item:hover {
    background-color: var(--sidebar-link-hover-bg);
}

.file-item.active {
    background-color: var(--primary-btn-bg);
    color: var(--primary-btn-text);
    font-weight: 500; /* Less bold active state */
}


/* Main Content Area (Takes Remaining Space, Full Height) */
.atencion-main-content {
    flex-grow: 1;
    height: 100vh; /* Full viewport height */
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color); /* Match main background */
    overflow: hidden; /* Add overflow hidden here to contain children */
    /* Remove old border, radius, card-bg */
    border: none;
    border-radius: 0;
    transition: background-color 0.5s ease;
}

/* Remove dark mode override for main content border as it's gone */
/* body.dark-mode .atencion-main-content { ... } */


/* Tab Container (Minimalistic) */
.tab-container {
    display: flex;
    flex-shrink: 0;
    background-color: var(--bg-color); /* Match background */
    padding: 5px 10px 0 10px; /* Adjust padding */
    border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* Keep bottom border */
    overflow-x: auto;
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

body.dark-mode .tab-container {
     background-color: var(--bg-color);
     border-bottom-color: rgba(255, 255, 255, 0.15); /* Adjust dark mode border */
}

/* Individual Tab Styling (Minimalistic) */
.tab-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px; /* Adjust padding */
    background-color: transparent;
    border: none; /* Remove border */
    border-bottom: 2px solid transparent; /* Use bottom border for active state */
    margin-right: 8px; /* Adjust spacing */
    margin-bottom: -1px; /* Overlap bottom border */
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-muted-color);
    transition: color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    position: relative;
    /* Remove max-width and add flex properties */
    /* max-width: 180px; */
    flex: 0 1 auto; /* Don't grow, shrink if needed, basis is auto */
    min-width: 60px; /* Add a minimum width to prevent excessive shrinking */
    border-radius: 0;
}

.tab-item .tab-text {
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 15px;
}

.tab-item:hover {
    color: var(--text-color);
    background-color: transparent; /* No background hover */
}

/* Remove dark mode hover style */
/* body.dark-mode .tab-item:hover { ... } */

.tab-item.active {
    color: var(--text-color);
    font-weight: 500; /* Less bold active state */
    border-bottom-color: var(--primary-btn-bg); /* Highlight with primary color */
    background-color: transparent; /* No background for active */
    /* Remove old active styles */
    border-color: transparent transparent var(--primary-btn-bg) transparent;
    top: 0; /* Reset top positioning */
}

body.dark-mode .tab-item.active {
    border-bottom-color: var(--primary-btn-bg); /* Use primary color from dark mode */
    /* Remove old dark mode active styles */
    border-color: transparent transparent var(--primary-btn-bg) transparent;
    background-color: transparent;
}


.tab-close {
    font-size: 1.2em; /* Slightly larger */
    line-height: 1;
    margin-left: 5px; /* Adjust spacing */
    padding: 1px 3px; /* Adjust padding */
    border-radius: 4px; /* Slightly rounded */
    transition: background-color 0.2s ease, color 0.2s ease;
    position: absolute;
    right: 4px; /* Adjust position */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted-color); /* Match muted text */
}

.tab-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color); /* Darken on hover */
}

body.dark-mode .tab-close:hover {
     background-color: rgba(255, 255, 255, 0.2);
     color: var(--text-color);
}


/* Content Display Area */
.content-container {
    flex-grow: 1;
    padding: 25px; /* Adjust padding */
    overflow-y: auto;
    background-color: var(--bg-color); /* Ensure background matches */
}

/* Placeholder for content - adjust as needed */
.content-container > div {
    display: none;
}

.content-container > div.active {
    display: block;
}

/* === Added Styles for Modo Libre Tools === */

/* Simple Fade-in Animation */
@keyframes fadeInView {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Style for the tools section container */
#modo-libre-tools {
    /* Inherits .view-container styles (display: none initially) */
    padding: 40px 20px; /* Add padding */
    text-align: center;
    overflow-y: auto; /* Allow scrolling if content overflows */
    height: 100vh; /* Take full height */
    width: 100%;
    box-sizing: border-box;
}

/* Apply animation when active */
#modo-libre-tools.active {
    display: block; /* Show the section */
    animation: fadeInView 0.5s ease-out forwards;
}

/* Container within the tools section */
#modo-libre-tools .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

#modo-libre-tools h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem; /* Increased margin */
    color: var(--text-color); /* Use variable */
    font-weight: 700;
}

/* Grid for the tool cards */
#modo-libre-tools .tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Slightly larger minmax */
    gap: 2rem;
    text-align: left;
}

/* Individual tool card */
#modo-libre-tools .tool-card {
    background-color: var(--card-bg); /* Use variable */
    padding: 2rem;
    border-radius: 12px; /* Slightly more rounded */
    box-shadow: var(--card-shadow); /* Use variable */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative; /* Needed for badges */
    color: var(--text-color); /* Use variable */
    backdrop-filter: blur(5px); /* Keep blur effect */
    -webkit-backdrop-filter: blur(5px);
}

#modo-libre-tools .tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); /* Keep specific hover shadow or adapt */
}

body.dark-mode #modo-libre-tools .tool-card:hover {
     box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1); /* Dark mode hover shadow */
}


#modo-libre-tools .tool-card h3 {
    font-size: 1.5rem;
    color: var(--text-color); /* Use variable */
    font-weight: 700;
    margin-bottom: 0.8rem;
}

#modo-libre-tools .tool-card p {
    font-size: 1rem;
    color: var(--text-muted-color); /* Use variable */
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Ensure card takes height */
    line-height: 1.6;
}

/* Button style specifically within tool cards */
#modo-libre-tools .tool-card .button {
    display: inline-block;
    background-color: var(--primary-btn-bg); /* Use variable */
    color: var(--primary-btn-text); /* Use variable */
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 8px; /* Match action-button radius */
    font-weight: 600; /* Match action-button weight */
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    align-self: flex-start; /* Align button to the start */
}

#modo-libre-tools .tool-card .button:hover {
    background-color: var(--primary-btn-hover-bg); /* Use variable */
    transform: translateY(-2px);
}

/* Badge Styles (Copied from style.css, colors kept specific) */
#modo-libre-tools .badge,
#modo-libre-tools .badge1 {
    position: absolute;
    top: 15px; /* Adjusted position */
    right: 15px; /* Adjusted position */
    color: #ffffff;
    padding: 4px 9px; /* Adjusted padding */
    font-size: 0.75rem; /* Adjusted size */
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 6px; /* Adjusted radius */
    line-height: 1;
    z-index: 2;
}

#modo-libre-tools .beta-badge { /* Specific class for beta */
    background-color: #dd3333; /* Red for beta */
}

#modo-libre-tools .good-badge { /* Specific class for clinic-ready */
     background-color: #17ad26; /* Green for ready */
}

/* --- Custom Notification Styles --- */
.notification {
    position: fixed;
    top: 20px; /* Position from the top */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Adjust for centering */
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1050; /* Ensure it's above most other elements */
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px; /* Minimum width */
    max-width: 90%; /* Maximum width */
    opacity: 0; /* Start hidden for transition */
    visibility: hidden; /* Start hidden */
    transition: opacity 0.3s ease, visibility 0.3s ease, top 0.3s ease;
}

.notification.show {
    opacity: 1;
    visibility: visible;
    top: 30px; /* Slide down slightly when shown */
}

/* Error Style (Red) */
.notification.error {
    background-color: #dc3545; /* Bootstrap danger red */
    color: #ffffff;
}

/* Success Style (Green) - Example */
.notification.success {
    background-color: #28a745; /* Bootstrap success green */
    color: #ffffff;
}

/* Info Style (Blue) - Example */
.notification.info {
    background-color: #17a2b8; /* Bootstrap info blue */
    color: #ffffff;
}

.notification span {
    flex-grow: 1;
    margin-right: 15px; /* Space between message and close button */
}

.notification-close {
    background: none;
    border: none;
    color: inherit; /* Inherit color from parent (.notification) */
    font-size: 1.4em;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
}

/* Media query adjustments for tools section */
@media (max-width: 768px) {
    #modo-libre-tools h2 {
        font-size: 1.8rem;
    }
    #modo-libre-tools .tools-grid {
        grid-template-columns: 1fr; /* Single column on smaller screens */
    }
    #modo-libre-tools .tool-card {
        text-align: center;
    }
     #modo-libre-tools .tool-card .button {
        align-self: center; /* Center button on mobile */
        width: 80%;
    }
}

/* === End Added Styles === */

/* --- Modal Styles Re-added --- */
.modal {
    display: none; /* Hide modals by default */
    position: fixed; /* Keep them fixed for overlay behavior */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1005; /* Ensure they appear above other content */
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background overlay */
    /* Use flex to center the modal content */
    justify-content: center;
    align-items: center;
}

/* Style for when the modal should be visible (JS adds this class) */
.modal.is-active {
    display: flex; /* Show the modal using flex */
}

/* Basic styling for the modal content box itself */
.modal .modal-content {
    background-color: var(--card-bg);
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    max-width: 500px; /* Limit width */
    width: 90%;
    position: relative; /* For positioning the close button */
    color: var(--text-color);
}

/* Close button styling (reusing existing class potentially) */
.modal .modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--text-muted-color);
    line-height: 1;
}
.modal .modal-close:hover {
    color: var(--text-color);
}
/* --- End Re-added Modal Styles --- */

/* --- Styles for the button inside the Donate Modal --- */
.modal .modal-content .modal-submit-button {
    /* Layout for centering */
    display: block;
    width: auto;
    margin: 1rem auto 0;

    /* Styles from #tools-view .tool-card .button */
    background-color: var(--secondary-btn-hover-bg); /* Use secondary hover bg for subtle look */
    color: var(--secondary-btn-text); /* Use secondary text color */
    padding: 0.7rem 1.3rem; /* Adjust padding */
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    border: 1px solid transparent; /* Add transparent border */
    cursor: pointer;
    /* Remove align-self and margin-top: auto from tool card button */
    font-family: inherit; /* Ensure correct font */
}

.modal .modal-content .modal-submit-button:hover {
    background-color: var(--primary-btn-bg); /* Use primary on hover */
    color: var(--primary-btn-text);
    transform: translateY(-2px);
}
/* --- End Styles for the button inside the Donate Modal --- */

/* --- Novedades Popup Styles (similar to modal but maybe positioned differently) --- */
.novedades-content {
    position: fixed; /* Keep it fixed on the page */
    /* Position below the header button */
    top: 70px; /* Below the header buttons (top: 20px + button height + gap) */
    right: 465px; /* Align with the #header-novedades-btn */
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 20px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1005; /* Same level as modals */
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateY(-10px); /* Start slightly above */
}

.novedades-content.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.novedades-content h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 700;
}

.novedades-content ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 15px;
}

.novedades-content li {
    margin-bottom: 8px;
    font-size: 0.95em;
    color: var(--text-muted-color);
}

.novedades-content p small {
    display: block;
    text-align: right;
    font-size: 0.8em;
    color: var(--text-muted-color);
    margin-top: 10px;
}

/* Use the same modal-close style for Novedades */
.novedades-content .modal-close {
    /* Explicitly define styles copied from .modal .modal-close */
    position: absolute;
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--text-muted-color);
    line-height: 1;
    /* Keep specific positioning */
    top: 8px;
    right: 12px;
}
/* === Styles for New Tools Grid (#tools-view) === */

/* Ensure the tools view takes up space correctly within the centered wrapper */
#centered-views-wrapper #tools-view {
    max-width: 1100px; /* Allow wider content for the grid */
    padding: 40px 20px; /* Adjust padding */
    background-color: transparent; /* Make background transparent */
    box-shadow: none; /* Remove card shadow */
    border-radius: 0; /* Remove border radius */
    text-align: center;
}

#tools-view .welcome-container {
    margin-bottom: 40px; /* Space below welcome text */
}

#tools-view .welcome-container h1 {
    font-size: 2.5em; /* Larger title */
}

#tools-view .welcome-container p {
    font-size: 1.3em; /* Larger subtitle */
}

/* Grid layout for the tools */
#tools-view .tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 2rem; /* Space between cards */
    text-align: left; /* Align text inside cards to the left */
    width: 100%;
}

/* Individual tool card styling */
#tools-view .tool-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    color: var(--text-color);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#tools-view .tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

body.dark-mode #tools-view .tool-card:hover {
     box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

/* Tool icon container */
#tools-view .tool-icon {
    width: 60px; /* Fixed size for the icon background */
    height: 60px;
    border-radius: 10px; /* Rounded corners for the icon background */
    background-color: rgba(0, 0, 0, 0.05); /* Subtle background */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem; /* Space below icon */
}

body.dark-mode #tools-view .tool-icon {
    background-color: rgba(255, 255, 255, 0.1); /* Lighter background in dark mode */
}

/* Icon styling (Font Awesome) */
#tools-view .tool-icon i {
    font-size: 24px; /* Icon size */
    color: var(--text-color); /* Icon color */
    opacity: 0.8;
}

/* Tool card title */
#tools-view .tool-card h3 {
    font-size: 1.4rem; /* Slightly smaller than old cards */
    color: var(--text-color);
    font-weight: 700;
    margin-bottom: 0.8rem;
}

/* Tool card description */
#tools-view .tool-card p {
    font-size: 0.95rem; /* Slightly smaller */
    color: var(--text-muted-color);
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Make text take available space */
    line-height: 1.6;
}

/* Button style within tool cards */
#tools-view .tool-card .button {
    display: inline-block;
    background-color: var(--secondary-btn-hover-bg); /* Use secondary hover bg for subtle look */
    color: var(--secondary-btn-text); /* Use secondary text color */
    padding: 0.7rem 1.3rem; /* Adjust padding */
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    border: 1px solid transparent; /* Add transparent border */
    cursor: pointer;
    align-self: flex-start; /* Align button to the start */
    margin-top: auto; /* Push button to the bottom */
}

#tools-view .tool-card .button:hover {
    background-color: var(--primary-btn-bg); /* Use primary on hover */
    color: var(--primary-btn-text);
    transform: translateY(-2px);
}

/* Responsive adjustments for the new tools grid */
@media (max-width: 768px) {
    #centered-views-wrapper #tools-view {
        padding: 30px 15px; /* Less padding on mobile */
    }
    #tools-view .welcome-container h1 {
        font-size: 2em;
    }
    #tools-view .welcome-container p {
        font-size: 1.1em;
    }
    #tools-view .tools-grid {
        grid-template-columns: 1fr; /* Single column */
        gap: 1.5rem;
    }
    #tools-view .tool-card {
        padding: 1.5rem;
    }
     #tools-view .tool-card .button {
        align-self: stretch; /* Full width button on mobile */
        text-align: center;
    }
}

/* === End Styles for New Tools Grid === */
/* Tool Icon Colors */
.tool-icon .alimetra-icon {
    color: #3498db !important; /* Blue */
}

.tool-icon .evalus-icon {
    color: #9b59b6 !important; /* Purple */
}

.tool-icon .memora-icon {
    color: #1abc9c !important; /* Teal */
}

.tool-icon .gramora-icon {
    color: #2ecc71 !important; /* Green */
}

.tool-icon .pondalis-icon {
    color: #7f8c8d !important; /* Grey */
}

.tool-icon .pscvisor-icon {
    color: #e74c3c !important; /* Red */
}
/* Badge "En desarrollo" for tool cards */
.tool-card .dev-badge {
    position: absolute;
    top: 8px; /* Adjust position for card */
    right: 8px; /* Adjust position for card */
    background-color: rgba(255, 165, 0, 0.85); /* Orange, slightly less transparent */
    color: #000; /* Black text */
    padding: 3px 6px; /* Smaller padding */
    font-size: 0.7em; /* Smaller font size */
    font-weight: bold;
    border-radius: 4px;
    z-index: 5; /* Ensure it's above card content but below modals */
    pointer-events: none; /* Prevent interaction */
}

/* Ensure tool-card allows absolute positioning */
.tool-card {
    position: relative; /* Needed for absolute positioning of children */
}

/* Dark mode adjustments for badge */
body.dark-mode .tool-card .dev-badge {
    background-color: rgba(255, 165, 0, 0.75);
    color: #fff; /* White text in dark mode */
}

/* --- Responsive Header Buttons --- */
@media (max-width: 768px) {
    .header-button {
        /* Keep buttons horizontal at the top on mobile */
        position: fixed;
        top: 15px; /* Keep all at the top */
        right: auto; /* Reset right initially */
        width: auto;
        padding: 5px 8px; /* Reduced padding */
        font-size: 12px; /* Reduced font size */
        white-space: nowrap; /* Keep text on one line */
        /* Removed stacking styles: text-align, min-width, white-space: normal */
        z-index: 1002; /* Ensure they are above content */
    }

    #dark-mode-toggle { /* Ensure dark mode button stays top right */
        top: 15px;
        right: 15px;
        z-index: 1003; /* Highest */
    }

    /* New horizontal positioning for mobile */
    #header-donar-btn {
        right: 70px; /* Next to dark mode */
        top: 15px; /* Explicitly set top */
    }
    #header-contacto-btn {
        right: 135px; /* Adjust based on Donar width + gap */
        top: 15px; /* Explicitly set top */
    }
    #header-informacion-btn {
        right: 210px; /* Adjust based on Contacto width + gap */
        top: 15px; /* Explicitly set top */
    }
    #header-novedades-btn {
        right: 295px; /* Adjust based on Informacion width + gap */
        top: 15px; /* Explicitly set top */
    }

    /* Adjust Novedades popup position on mobile */
    .novedades-content {
        right: 15px; /* Align near buttons */
        left: 15px; /* Add left constraint */
        max-width: calc(100% - 30px); /* Prevent overflow */
        top: 70px; /* Position below the row of buttons */
    }
}