/* css/shared_elements.css */

/* Definiciones de color y fuente */
:root {
    --ios-blue: #007aff; /* Azul de iOS para el estado activo */
    --bg-light: #f7f7f7;
    --nav-bg: rgba(255, 255, 255, 0.7);
}

/* --- Estilo de la Barra de Navegación (Dock Flotante) --- */

.nav-bar {
    /* 1. Posición Flotante y Centrado */
    position: fixed;
    bottom: 20px; /* Despegada del borde inferior */
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    transform: none; /* Centra la barra */

    /* 2. Dimensiones y Diseño Flex */
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 90%; /* Ancho responsivo */
    max-width: 340px; /* Reducido */
    height: 60px; /* Reducido */
    padding: 0 10px;

    /* 3. Estilo Glassmorphism (iOS) */
    background: var(--nav-bg); 
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(15px); /* Efecto de cristal clave */
    -webkit-backdrop-filter: blur(15px);
    border-radius: 30px; /* Reducido (la mitad de la altura) */
    border: 1px solid rgba(255, 255, 255, 0.8); /* Borde sutil */
    
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Ajustes para móvil */
@media (max-width: 767px) {
    .nav-bar {
        bottom: 12px !important;
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
        left: 12px !important;
        right: 12px !important;
        margin: 0 !important;
        z-index: 1001 !important; /* Por encima del botón de chat */
        height: 56px !important;
        padding: 0 8px !important;
    }
    
    .nav-bar .nav-item {
        padding: 4px !important;
    }
    
    .nav-bar .nav-item svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .nav-bar .nav-item span {
        font-size: 0.6rem !important;
        margin-top: 2px !important;
    }
}

/* Estilo de cada Elemento (Ítem) */
.nav-bar .nav-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #888; /* Color de icono inactivo */
    transition: all 0.3s ease;
    padding: 5px;
    flex: 1;
    user-select: none; /* Evita que se seleccione el texto */
}

.nav-bar .nav-item span {
    font-size: 0.65rem; /* Reducido */
    margin-top: 2px;
    font-weight: 500;
    white-space: nowrap; /* Evita saltos de línea en el texto */
}

.nav-bar .nav-item svg {
    width: 22px; /* Reducido */
    height: 22px; /* Reducido */
    transition: transform 0.2s ease;
    stroke: currentColor; /* Usa el color del elemento padre */
}

/* Icono de instituciones más grande */
.nav-bar .nav-item[href*="instituciones"] svg,
.nav-bar .nav-item:has(span:contains("Instituciones")) svg {
    width: 26px;
    height: 26px;
}

/* Estado Activo */
.nav-bar .nav-item.active {
    color: var(--ios-blue); /* Color de texto activo */
}

/* Contenedor del ícono activo para el efecto de píldora/fondo */
.nav-bar .nav-item.active .icon-container {
    background-color: rgba(0, 122, 255, 0.1); /* Fondo azul muy claro */
    color: var(--ios-blue); /* Color azul del ícono y texto */
    border-radius: 18px; /* Reducido */
    padding: 4px 10px; /* Reducido */
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.2);
    transition: all 0.3s ease;
}

.nav-bar .nav-item.active svg {
    stroke: var(--ios-blue); /* Color azul del trazo del SVG activo */
    transform: none;
}

/* Estado cuando se presiona el botón (:active) */
.nav-bar .nav-item:active {
    color: var(--ios-blue) !important; /* Azul cuando se presiona */
}

.nav-bar .nav-item:active svg {
    stroke: var(--ios-blue) !important; /* SVG azul cuando se presiona */
    transform: scale(0.95); /* Efecto de presión */
}

/* Estado cuando se presiona un item activo */
.nav-bar .nav-item.active:active {
    color: var(--ios-blue) !important; /* Azul cuando se presiona */
}

.nav-bar .nav-item.active:active svg {
    stroke: var(--ios-blue) !important; /* Azul en lugar de blanco cuando se presiona */
}

.nav-bar .nav-item.active:active .icon-container {
    background-color: rgba(0, 122, 255, 0.2) !important; /* Fondo azul más claro */
    color: var(--ios-blue) !important; /* Texto azul */
}

.nav-bar .nav-item.active:active .icon-container svg {
    stroke: var(--ios-blue) !important; /* SVG azul cuando se presiona el activo */
}

/* Contenedor del ícono para el efecto de píldora */
.nav-bar .icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #888; /* Color de ícono inactivo */
}

/* Anular el efecto hover de lateral_nav.css */
.nav-bar .nav-item:hover {
    background-color: transparent;
    box-shadow: none;
    transform: none;
}

/* Styles for the floating sector buttons (viñetas) */
.fixed.right-0.flex.flex-col.space-y-3.w-48.items-end {
    z-index: 1000;
    top: 80px;
}

.nav-item.group.flex.items-center.flex-row-reverse.space-x-2\.5.space-x-reverse.p-2\.5.rounded-full.liquid-glass.w-12.h-12.hover\:w-48.shadow-lg.duration-300 {
    /* Tailwind classes are used here, but if custom CSS is needed, it would go here */
}

.nav-item.group .icon-wrapper {
    /* Styles for the icon wrapper if needed */
}

.nav-item.group .item-text {
    /* Styles for the text if needed */
}

/* General styles for the search form in index.view.php hero section */
.search-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    max-width: 600px;
    background-color: rgba(255, 255, 255, 0.15); /* Fondo translúcido */
    border-radius: 30px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px); /* Efecto de desenfoque */
    -webkit-backdrop-filter: blur(10px); /* Soporte para Safari */
}

.search-form input[type="search"] {
    flex-grow: 1;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 16px;
    background: transparent;
    outline: none;
}

.search-form button {
    background-color: var(--ios-blue);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #0056b3;
}
