/* ===== HEADER STYLES ===== */

/* Header General */
.main-header {
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Header superior con logo y búsqueda */
.header-top {
    background-color: #ffffff;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Logo desktop */
.header-logo {
    display: flex;
    align-items: center;
}

.logo-image {
    max-height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

/* Sección derecha del header */
.desktop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Fecha actual */
.header-date {
    display: flex;
    align-items: center;
    color: #555;
    font-size: 0.9rem;
    gap: 5px;
    padding-right: 20px;
    border-right: 1px solid #eee;
}

/* Redes sociales en header */
.header-social {
    display: flex;
    gap: 15px;
    padding-right: 20px;
    border-right: 1px solid #eee;
}

.social-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f5f5f5;
    color: #0b5891;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: #0b5891;
    color: white;
    transform: translateY(-3px);
}

/* Buscador */
.header-search {
    position: relative;
}

.search-form {
    display: flex;
    position: relative;
}

.search-wrapper {
    display: flex;
    position: relative;
    min-width: 200px;
}

.search-input {
    border: none;
    border-bottom: 2px solid #eaeaea;
    padding: 8px 40px 8px 10px;
    width: 100%;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    background-color: #f9f9f9;
    border-radius: 10px; /* Ajustado a 10px como en tu JS original */
}

.search-input:focus {
    border-color: #0b5891;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    outline: none;
    background-color: white;
}

.search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: none;
    border: none;
    width: 40px;
    color: #0b5891;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    color: #053e67;
}

/* Resultados de búsqueda */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

/* Header móvil */
.mobile-header {
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.menu-toggle, .search-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #0b5891;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
}

.mobile-logo img {
    max-height: 40px;
}

/* Búsqueda móvil */
.mobile-search-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 10px 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 1010;
}

.mobile-search-container.active {
    transform: translateY(0);
}

.mobile-search-form {
    display: flex;
    position: relative;
}

.mobile-search-input {
    flex: 1;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    padding: 10px 40px 10px 10px;
    font-size: 0.9rem;
}

.mobile-search-button {
    position: absolute;
    right: 40px;
    top: 0;
    height: 100%;
    background: none;
    border: none;
    width: 40px;
    color: #0b5891;
}

.mobile-search-close {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: none;
    border: none;
    width: 40px;
    color: #dc3545;
}

/* Navegación principal */
.main-nav {
    background-color: #0b5891;
    padding: 0;
}

.nav-container {
    position: relative;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    color: white !important; /* Aseguramos que el texto sea blanco */
    padding: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover, .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

/* Dropdown en navegación */
.dropdown-menu {
    border: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 0;
    min-width: 200px;
    margin-top: 0;
}

.dropdown-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

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

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #f7f7f7;
    color: #0b5891;
}

/* Área de usuario */
.nav-user {
    display: flex;
    align-items: center;
    margin-left: 15px; /* Espacio entre el menú y el botón de login */
}

.user-login, .user-toggle {
    display: flex;
    align-items: center;
    color: white !important; /* Garantizamos contraste */
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 5px;
}

.user-login:hover, .user-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.user-toggle i.fa-chevron-down {
    font-size: 0.7rem;
    margin-left: 5px;
}

/* Menú desplegable de usuario */
.user-account .dropdown-menu {
    margin-top: 5px;
}

.user-account .dropdown-item i {
    width: 20px;
    margin-right: 5px;
    color: #0b5891;
}

/* Offcanvas menú móvil */
.offcanvas {
    background-color: #f9f9f9;
}

.offcanvas-header {
    padding: 15px;
    border-bottom: 1px solid #eaeaea;
}

.offcanvas-logo {
    display: flex;
    justify-content: center;
    width: 100%;
}

.offcanvas-logo img {
    max-height: 40px;
}

/* Navegación móvil */
.mobile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-item {
    border-bottom: 1px solid #eaeaea;
}

.mobile-menu-link {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-menu-link:hover {
    background-color: #f0f0f0;
}

.submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submenu-toggle i {
    transition: transform 0.3s ease;
}

.submenu-toggle[aria-expanded="true"] i {
    transform: rotate(-180deg);
}

/* Submenús móviles */
.mobile-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #f0f0f0;
}

.mobile-submenu-link {
    display: block;
    padding: 10px 15px 10px 30px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #e5e5e5;
}

.mobile-submenu-link:hover {
    background-color: #e5e5e5;
}

/* Sección de usuario en móvil */
.mobile-section-title {
    padding: 15px 15px 5px;
    margin: 0;
    font-size: 1rem;
    color: #666;
    border-top: 1px solid #eaeaea;
    margin-top: 15px;
}

.mobile-user-menu {
    padding: 0 15px;
}

.mobile-user-link {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eaeaea;
}

.mobile-user-link i {
    width: 25px;
    color: #0b5891;
}

.mobile-user-link.logout {
    color: #dc3545;
}

.mobile-login-btn {
    display: block;
    margin: 15px;
    padding: 10px;
    text-align: center;
    background-color: #0b5891;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-login-btn:hover {
    background-color: #084775;
    color: white;
}

/* Redes sociales en móvil */
.mobile-social-links {
    display: flex;
    justify-content: space-around;
    padding: 10px 15px;
}

.mobile-social-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    color: #0b5891;
    background-color: #e9ecef;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mobile-social-links a:hover {
    background-color: #0b5891;
    color: white;
    transform: translateY(-3px);
}

/* Media queries para ajustar diseño */
@media (max-width: 991.98px) {
    /* Ajustes para tablets */
    .logo-image {
        max-height: 50px;
    }

    .search-wrapper {
        min-width: 180px;
    }
}

@media (max-width: 767.98px) {
    /* Ajustes para dispositivos móviles */
    .header-top {
        padding: 10px 0;
    }

    .mobile-header {
        padding: 5px 10px;
    }
}

@media (max-width: 575.98px) {
    /* Ajustes para móviles pequeños */
    .mobile-logo img {
        max-height: 35px;
    }

    .menu-toggle, .search-toggle {
        font-size: 1rem;
    }
}

.header-date {
    display: flex;
    align-items: center;
    color: #555;
    font-size: 0.9rem;
    gap: 5px;
    padding-right: 20px;
    border-right: 1px solid #eee;
}

.header-date i {
    color: #0b5891;
}

#current-time {
    font-weight: 600;
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 2px 5px;
    border-radius: 3px;
}
