﻿/* Variables actualizadas para el logo de EMPALME */
:root {
    /* COLORES BASADOS EN EL LOGO DE COMUNA DE BOUQUET */
    --primary-color: #2E86C1; /* Azul principal del logo */
    --primary-hover: #2471A3; /* Azul más oscuro para hover */
    --primary-active: #1F618D; /* Azul aún más oscuro para estado activo */
    
    --secondary-color: #27AE60; /* Verde del logo */
    --secondary-hover: #229954; /* Verde más oscuro para hover */
    --accent-color: #F39C12; /* Amarillo/dorado del logo para acentos */
    
    /* Color de acción/atención */
    --primary-rojo: #E74C3C; 
    
    /* Botón de descarga - usando el verde del logo */
    --boton-descarga: rgba(39, 174, 96, 0.9); 
    
    /* Colores de texto y fondo */
    --text-color: #2C3E50;
    --background-color: #fefefe;
    --border-color: #BDC3C7;
    --texto-menu: #2C3E50;
    --texto-hover: white;
    
    /* Variaciones adicionales para mejor contraste */
    --success-color: #27AE60; /* Verde para mensajes de éxito */
    --warning-color: #F39C12; /* Amarillo para advertencias */
    --info-color: #2E86C1; /* Azul para información */
    --error-color: #E74C3C; /* Rojo para errores */
    
    /* Fondos con transparencia */
    --primary-light: rgba(46, 134, 193, 0.1);
    --secondary-light: rgba(39, 174, 96, 0.1);
    --accent-light: rgba(243, 156, 18, 0.1);
    
    /* Nuevas variables */
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.2);
    --transition-speed: 0.3s;
    --border-radius: 8px;
    --border-color-animate: rgba(255, 255, 255, 0.8);
}

/* Estilos generales */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
}

/* Contenedor principal del menú */
#nav {
    padding: 20px;
    box-sizing: border-box;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

/* Barra de búsqueda */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 20px;
}

.search-container input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 16px;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-container input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(19, 145, 180, 0.2);
}

.search-container .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 20px;
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    background-color: white;
    padding: 30px 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    width: 350px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 500;
}

.loading-subtext {
    color: #777;
    font-size: 14px;
    margin-top: 10px;
}


/* PDF Viewer */
.pdf-viewer {
    width: 100%;
    margin: 20px 0;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: var(--border-radius);
    text-align: center;
}

.pdf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--transition-speed) ease, transform 0.2s ease;
    min-width: 180px;
}

.action-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.action-button i {
    margin-right: 10px;
    font-size: 18px;
}


/* Nuevo estilo de menú con tarjetas */
#menu-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    position: relative;
}

/* Estilo del botón con efecto shadow-float */
.menu-item {
    position: relative;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px 15px;
    min-height: 50px;
    transform: translateY(0);
    border-bottom: 3px solid var(--accent-color); /* Borde inferior con el color acento */
}

/* Efecto shadow-float al pasar el cursor */
.menu-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    background-color: var(--primary-hover);
    border-bottom-color: var(--secondary-color);
}

.menu-text {
    font-size: 16px;
    font-weight: 600;
    color: white;
    position: relative;
}

/* Estilo para cuando un elemento está seleccionado */
.menu-item.selected {
    background-color: var(--primary-active);
    border-left: 4px solid var(--secondary-color);
}

/* Nuevo botón "Mostrar todos" */
.show-all-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    transform: translateY(0);
    border-bottom: 3px solid var(--accent-color);
}

.show-all-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    border-bottom-color: var(--secondary-color);
}

.show-all-button svg {
    width: 20px;
    height: 20px;
}

/* Mensaje de no resultados */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: #666;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px dashed #ddd;
}

/* Estilos para dispositivos móviles */
@media (max-width: 768px) {
    #menu-container {
        grid-template-columns: 1fr;
    }
    
    .menu-item {
        padding: 20px 15px;
    }
    
    .search-container {
        margin-bottom: 15px;
    }
}

/* Estilos para el iframe */
#content-iframe {
    width: 100%;
    height: calc(100vh - 180px);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

/* Animaciones de entrada */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-item {
    animation: fadeIn 0.5s ease forwards;
}

/* Animación para varios elementos con retardo */
.menu-item:nth-child(1) { animation-delay: 0.05s; }
.menu-item:nth-child(2) { animation-delay: 0.1s; }
.menu-item:nth-child(3) { animation-delay: 0.15s; }
.menu-item:nth-child(4) { animation-delay: 0.2s; }
.menu-item:nth-child(5) { animation-delay: 0.25s; }
.menu-item:nth-child(6) { animation-delay: 0.3s; }
.menu-item:nth-child(7) { animation-delay: 0.35s; }
.menu-item:nth-child(8) { animation-delay: 0.4s; }
.menu-item:nth-child(9) { animation-delay: 0.45s; }
.menu-item:nth-child(10) { animation-delay: 0.5s; }
.menu-item:nth-child(n+11) { animation-delay: 0.55s; }

/* Estilo personalizado para el header */
.header-container {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-active));
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    border-bottom: 4px solid var(--accent-color);
}

.logo-column img {
    max-width: 120px;
    height: auto;
    border-radius: 10px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.name-column {
    font-size: 28px;
    font-weight: bold;
    margin-left: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}