/* --- Variables y Estilos Base --- */
:root {
    --yachana-red: #b22234;
    --yachana-blue: #004c97;
    --yachana-white: #ffffff;
    --light-gray: #f4f4f9;
    --medium-gray: #e0e0e0;
    --dark-gray: #555;
    --text-color: #333;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --header-bg: #b22234;
    --footer-bg: #2c3e50;
    --footer-text: #ecf0f1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: var(--light-gray); color: var(--text-color); line-height: 1.6; }
.dashboard-container { max-width: 1600px; margin: 20px auto; padding: 20px; }
.dashboard-header { display: flex; justify-content: center; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--yachana-blue); }
.dashboard-header h1 { color: var(--yachana-blue); font-size: 1.8rem; }
#view-toggle-btn { background-color: var(--yachana-red); color: var(--yachana-white); border: none; padding: 10px 15px; border-radius: 5px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; gap: 8px; transition: background-color 0.3s; }
#view-toggle-btn:hover { background-color: #a51a20; }
.filters-container { margin-bottom: 25px; background-color: var(--yachana-white); padding: 15px; border-radius: 8px; box-shadow: var(--shadow); }
.filters-row { display: flex; gap: 15px; margin-bottom: 15px; align-items: center; }
.filters-row:last-child { margin-bottom: 0; }
.filter-select { min-width: 180px; flex: 1; }
#reset-filters-btn { flex-shrink: 0; }
.filter-select { padding: 10px; border: 1px solid var(--medium-gray); border-radius: 5px; background-color: var(--yachana-white); font-size: 0.95rem; }
#reset-filters-btn { background-color: var(--yachana-blue); color: var(--yachana-white); border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-weight: bold; transition: background-color 0.3s; }
#reset-filters-btn:hover { background-color: #003a75; }
.view { display: none; } .view.active { display: block; }
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 25px; }
.card { background: var(--yachana-white); padding: 20px; border-radius: 8px; box-shadow: var(--shadow); text-align: center; border-left: 5px solid var(--yachana-blue); }
.card.card-publica { border-left-color: var(--yachana-red); }
.card-title { display: block; font-size: 0.9rem; color: var(--dark-gray); margin-bottom: 10px; }
.card-value { display: block; font-size: 2.5rem; font-weight: bold; color: var(--yachana-blue); }
.card.card-publica .card-value { color: var(--yachana-red); }
.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, auto); gap: 25px; }
.chart-container { background: var(--yachana-white); padding: 20px; border-radius: 8px; box-shadow: var(--shadow); height: 400px; display: flex; flex-direction: column; }
.chart-container h3 { text-align: center; margin-bottom: 15px; color: var(--dark-gray); font-size: 1rem; flex-shrink: 0; }
.chart-container canvas { flex: 1; min-height: 0; }
.map-grid-interactive { position: relative; height: 66.67vh; width: 50%; margin-left: 10%; }
.map-wrapper { width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--yachana-white); box-shadow: var(--shadow); border-radius: 8px; overflow: hidden; }
.map-header { padding: 10px 15px; border-bottom: 1px solid var(--medium-gray); }
.map-header h2 { font-size: 1.1rem; color: var(--yachana-blue); margin-bottom: 5px; }
.map-header p { font-size: 0.9rem; color: var(--dark-gray); }
#map { width: 100%; height: 100%; flex-grow: 1; background-color: #ffffff; }
#map-sidebar { position: absolute; top: 0; right: 0; width: 350px; height: 100%; background-color: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px); box-shadow: -5px 0 15px rgba(0,0,0,0.2); padding: 20px; overflow-y: auto; transform: translateX(100%); transition: transform 0.3s ease-in-out; z-index: 1001; }
#map-sidebar.show { transform: translateX(0); }
#close-sidebar-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2rem; color: var(--dark-gray); cursor: pointer; }
#sidebar-title { color: var(--yachana-red); margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid var(--yachana-red); }
#sidebar-list { list-style-type: none; }
#sidebar-list li { padding: 8px 0; border-bottom: 1px solid var(--medium-gray); font-size: 0.95rem; }
.province-tooltip { background-color: rgba(0, 0, 0, 0.8); color: white; border: none; border-radius: 4px; font-size: 14px; }
.map-container { position: relative; background-color: #1976d2; padding: 20px; border-radius: 8px; }
.map-overlay { position: absolute; top: 20px; left: 20px; right: 20px; bottom: 20px; background-color: white; border-radius: 4px; z-index: 1; }
#map { position: relative; z-index: 2; }
.table-container { background: var(--yachana-white); padding: 20px; border-radius: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; height: 400px; }
.table-wrapper { overflow-y: auto; flex-grow: 1; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid var(--medium-gray); }
thead th { background-color: var(--light-gray); position: sticky; top: 0; font-size: 0.9rem; color: var(--yachana-blue); }
tbody tr:hover { background-color: #d8e4f3; }
@media (max-width: 1200px) { .filters-container { grid-template-columns: repeat(3, 1fr); } .charts-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .dashboard-header { flex-direction: column; align-items: flex-start; } .filters-container { grid-template-columns: repeat(2, 1fr); } #map-sidebar { width: 90%; } }
@media (max-width: 480px) { .filters-container { grid-template-columns: 1fr; } }

/* Estilos para Búsqueda Especializada */
.specialized-search-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.specialized-search-header {
    text-align: center;
    margin-bottom: 25px;
}

.specialized-search-header h2 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.specialized-search-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin: 0;
}

.specialized-search-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
    justify-content: center;
}

.search-input-group {
    display: flex;
    flex-direction: column;
    min-width: 250px;
}

.search-input-group label {
    color: white;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.career-search-input,
.career-search-select {
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.career-search-input:focus,
.career-search-select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
    background: white;
}

.career-search-select {
    cursor: pointer;
}

.search-actions {
    display: flex;
    gap: 12px;
    align-items: end;
}

.search-btn,
.clear-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-btn {
    background: #4CAF50;
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.search-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.clear-btn {
    background: #f44336;
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.clear-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.6);
}

/* Resultados de búsqueda */
.search-results-container {
    margin-top: 30px;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.search-results-header h3 {
    color: #333;
    margin: 0;
    font-size: 1.5rem;
}

.results-count {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.search-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.institution-result-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.institution-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.institution-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.institution-header h4 {
    color: #333;
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
    flex: 1;
}

.institution-type {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
    white-space: nowrap;
}

.institution-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.detail-value {
    color: #333;
    font-size: 0.9rem;
    text-align: right;
    flex: 1;
    margin-left: 10px;
}

.no-results {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
    grid-column: 1 / -1;
}

/* Autocompletado */
.search-input-container {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Enlaces web en resultados */
.institution-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.web-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.web-link-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.web-link-btn i {
    font-size: 0.9rem;
}

/* === ESTILOS DEL HEADER DE YACHANA === */
.yachana-header {
    background: var(--yachana-red);
    color: white;
    position: relative;
    z-index: 1000;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.header-top {
    background: #b22234;
    padding: 12px 0;
}

.header-top .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.header-contact {
    display: flex;
    gap: 30px;
    font-size: 1.1rem;
    font-weight: 500;
}

.contact-link {
    color: white !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
}

.contact-link:hover {
    opacity: 0.8;
}

.header-social {
    display: flex;
    gap: 15px;
    margin-left: 30px;
}

.social-link {
    color: white;
    text-decoration: none;
    padding: 8px;
    font-size: 1.2rem;
    transition: opacity 0.3s;
}

.social-link:hover {
    opacity: 0.8;
}

.header-main .container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 95px 20px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--yachana-red);
}

.logo {
    position: absolute;
    left: 4.9cm;
    top: 50%;
    transform: translateY(-50%);
}

.logo img {
    height: 180px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -0.5cm;
    right: -0.5cm;
    height: 3px;
    background-color: var(--yachana-red);
}

.header-account {
    position: absolute;
    top: 10px;
    right: 120px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.account-link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.3s;
}

.account-link:hover {
    opacity: 0.8;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #ffcccc;
}

.cart-icon {
    margin-left: 0;
}

.cart-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.2rem;
    position: relative;
}

.cart-count {
    background: var(--yachana-blue);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    margin-left: 15px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* === ESTILOS DEL FOOTER DE YACHANA === */
.yachana-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: 50px;
    width: 100%;
    margin: 50px 0 0 0;
    padding: 0;
    box-sizing: border-box;
}

.footer-content {
    padding: 40px 0 20px;
}

.footer-content .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h3 {
    color: var(--yachana-red);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-column p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-column a {
    color: var(--footer-text);
    text-decoration: none;
}

.footer-column a:hover {
    color: var(--yachana-red);
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 8px;
}

.footer-menu a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-menu a:hover {
    color: var(--yachana-red);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.2);
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
}

.payment-methods {
    display: flex;
    gap: 10px;
    align-items: center;
}

.payment-methods img {
    height: 1.5625rem;
    width: auto;
}

.footer-badge {
    max-height: 1.75rem;
}

.footer-logo {
    max-height: 1.5625rem;
    margin-left: 0.3125rem;
}

/* === AJUSTES PARA EL DASHBOARD === */
.dashboard-container {
    margin-top: 20px;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header-top .container,
    .header-main .container,
    .footer-content .container,
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        width: 100%;
        box-sizing: border-box;
    }

    .header-account {
        position: static;
        order: 3;
        margin-top: 10px;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 15px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--yachana-red);
        padding: 20px;
        display: none;
    }

    .main-nav ul.active {
        display: flex;
    }

    .cart-icon {
        order: 2;
        margin-left: 0;
        margin-right: 15px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .footer-columns {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    .payment-methods {
        justify-content: center;
    }

    .dashboard-container {
        margin-top: 10px;
    }

    .specialized-search-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-group {
        min-width: auto;
    }

    .search-actions {
        justify-content: center;
    }

    .search-results-list {
        grid-template-columns: 1fr;
    }

    .institution-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .institution-type {
        align-self: flex-start;
        margin-left: 0;
    }

    .autocomplete-suggestions {
        max-height: 150px;
    }
}