@font-face {
    font-family: 'SolanoGothic';
    src: url('font/solanogothicmvbstd-bdcap1.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* Global Styles */
:root {
    /* Functional Colors */
    --primary-color: #183a83;
    --secondary-color: #333;
    --light-color: #f4f4f4;
    --dark-color: #222;
    --text-color: #444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2a52a7;
}

/* Base Utility Classes */
.section {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--light-color);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-family: 'SolanoGothic', sans-serif;
    font-size: 2.5rem;
    color: var(--secondary-color);
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 50%;
    height: 3px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
}

/* Header */
.top-bar {
    background: #183a83;
    color: #fff;
    padding: 10px 0;
    font-size: 0.9rem;
}

.top-links {
    text-align: right;
}

.top-links a {
    color: #fff;
    margin-left: 20px;
}

.main-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo a {
    display: flex;
    flex-direction: column;
}

.logo h1 {
    font-size: 2rem;
    color: var(--primary-color);
    line-height: 1;
}

.logo span {
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--secondary-color);
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav ul li a {
    font-family: 'SolanoGothic', sans-serif;
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-nav ul li a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://via.placeholder.com/1920x800') no-repeat center center/cover;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-slider {
    height: 500px;
    position: relative;
    background: #333;
    /* Fallback */
}

.hero-slide {
    width: 100%;
    height: 100%;
    /* Display handled by JS/Inline */
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-content {
    z-index: 2;
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeInUp 1s ease-out;
}

/* Slider Navigation Buttons */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
    border-radius: 5px;
}

.slider-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.slider-nav.prev {
    left: 20px;
}

.slider-nav.next {
    right: 20px;
}


.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 2px;
}



/* Floating Icons */
.floating-icons-section {
    position: relative;
    margin-top: -80px;
    /* Floating overlap */
    z-index: 10;
    margin-bottom: 60px;
}

.floating-icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.floating-icon-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 4px solid transparent;
}

.floating-icon-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-bottom: 4px solid var(--primary-color);
}

.icon-circle {
    width: 70px;
    height: 70px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(47, 47, 211, 0.477);
}

.floating-icon-card:hover .icon-circle {
    background: #333;
    transform: rotateY(360deg);
    /* 3D effect */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.floating-icon-card h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}



/* Statistics Section */
.stats-section {
    background: url('../img/institution.jpg') no-repeat center center/cover;
    background-attachment: fixed;
    position: relative;
    padding: 80px 0;
    color: white;
    text-align: center;
}

.stats-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7));
}

.stats-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.stat-item {
    padding: 20px;
}

.stat-item i {
    font-size: 3rem;
    color: var(--primary-color);
    /* Bright contrast */
    margin-bottom: 15px;
}

.stat-item h3 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-item p {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 300;
}



/* Gallery Section */
.gallery-masonry {
    columns: 3 300px;
    column-gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    break-inside: avoid;
    transform: translateZ(0);
    /* Fix for webkit rendering */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.gallery-item img {
    width: 100%;
    /* Remove fixed height to allow masonry effect */
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-info {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-info {
    transform: translateY(0);
}

.gallery-info i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
    color: var(--primary-color);
}

.gallery-info h4 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.feature-card {
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.news-body {
    padding: 20px;
}

.news-date {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 10px;
    display: block;
}

.news-card h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.read-more {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

/* Footer */
.main-footer {
    background: #041E42;
    /* Deep Navy Blue similar to reference */
    color: #fff;
    padding-top: 60px;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h3 {
    margin-bottom: 25px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    border: none;
    padding: 0;
}

.footer-col p {
    color: #d1d5db;
    line-height: 1.6;
}

/* Bordered Links (Like 'Ver mapa', 'Cómo llegar') */
.footer-link-bordered {
    display: block;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.05);
    padding-left: 15px;
    margin-bottom: -1px;
    /* Overlap borders */
}

.footer-link-bordered:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
    padding-left: 20px;
}

.footer-link-bordered i {
    margin-right: 10px;
    color: #8da2fb;
}

/* Footer Buttons Grid */
.footer-buttons {
    display: flex;
    gap: 15px;
}

.btn-footer-blue,
.btn-footer-gray {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    color: white;
    text-decoration: none;
    transition: transform 0.2s;
    min-height: 100px;
}

.btn-footer-blue {
    background-color: #1a3c8a;
    /* Lighter blue for button */
    border: 1px solid #2d52a8;
}

.btn-footer-blue:hover {
    background-color: #244cb3;
    transform: translateY(-2px);
    color: white;
}

.btn-footer-gray {
    background-color: #e2e8f0;
    color: #041E42;
    border: 1px solid #cbd5e1;
}

.btn-footer-gray:hover {
    background-color: #fff;
    transform: translateY(-2px);
    color: #041E42;
}

.btn-footer-gray span {
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.2;
}

/* Footer Links List */
.footer-links-list {
    list-style: none;
    padding: 0;
}

.footer-links-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links-list li a {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    color: #fff;
    text-decoration: none;
    transition: padding-left 0.3s;
}

.footer-links-list li a::after {
    content: '\f054';
    /* FontAwesome Chevron Right */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.8em;
    opacity: 0.5;
}

.footer-links-list li a:hover {
    padding-left: 10px;
    color: #8da2fb;
}

/* Footer Bottom */
.footer-bottom {
    background: transparent;
    /* Seamless with main footer */
    padding: 20px 0;
    margin-top: 0;
    border-top: none;
    font-size: 0.85rem;
    color: #9ca3af;
}

.social-links-footer {
    display: flex;
    align-items: center;
}

.social-circle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background: #1e3a8a;
    color: #fff;
    border-radius: 50%;
    margin-left: 10px;
    transition: all 0.3s;
    text-decoration: none;
}

.social-circle:hover {
    background: #fff;
    color: #041E42;
    transform: scale(1.1);
}


.social-icon.youtube:hover {
    background: #ff0000;
}

.social-icon.tiktok:hover {
    background: #000;
    border: 1px solid #444;
}

/* Dropdown Menu Styles */
.dropdown-container {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: block !important;
    /* Override flex from main nav ul */
    padding: 10px 0;
    z-index: 1000;
}

.dropdown-container:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0 !important;
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 0.95rem;
    color: #444;
    text-transform: none;
    /* Subitems usually look better standard case or capitalized */
    transition: all 0.2s;
}

.dropdown-menu li a:hover {
    background: var(--primary-color);
    color: white !important;
    padding-left: 25px;
    /* Subtle slide effect */
}

/* Dropdown Divider */
.dropdown-divider {
    height: 1px;
    margin: 8px 0;
    background-color: #e5e7eb;
    border: none;
}

/* Mobile Only Nav Items - Hidden on Desktop */
.mobile-only-nav-item {
    display: none;
}

/* Chevron Transition */
.dropdown-toggle .fa-chevron-down {
    transition: transform 0.3s ease;
}

/* RESPONSIVE MENU */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 3px 0;
    transition: 0.4s;
}

@media screen and (max-width: 900px) {
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .main-nav {
        display: none;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        border-top: 1px solid #eee;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
    }

    /* Show Mobile Only Items */
    .mobile-only-nav-item {
        display: block;
    }

    .main-nav ul li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid #f4f4f4;
    }

    .main-nav ul li a {
        display: block;
        padding: 18px 20px;
        width: 100%;
    }

    /* Dropdowns in Mobile */
    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        display: none !important;
        background: #f8f9fa;
        padding: 0;
        border-radius: 0;
    }

    .dropdown-menu li a {
        padding: 10px 20px 10px 40px;
    }

    .dropdown-menu li {
        border-bottom: 1px solid #eee;
    }

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

    .dropdown-menu .dropdown-divider {
        height: 1px;
        margin: 4px 0;
        background-color: #e5e7eb;
        border-bottom: none;
    }

    .dropdown-container.active .dropdown-menu {
        display: block !important;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .dropdown-container.active>.dropdown-toggle {
        background-color: #f0f0f0;
        color: var(--primary-color);
        font-weight: bold;
    }

    .dropdown-container.active>.dropdown-toggle .fa-chevron-down {
        transform: rotate(180deg);
        transition: transform 0.3s ease;
    }

    .top-bar {
        padding: 8px 0;
    }

    .top-links {
        display: none;
    }

    .top-date {
        text-align: center;
        font-size: 0.8rem !important;
    }
}

/* Mobile Hero Font Size */
@media screen and (max-width: 768px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }
}

/* Hamburger Animation */
.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Utilities */
.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.pb-5 {
    padding-bottom: 3rem;
}

.pt-5 {
    padding-top: 3rem;
}

.my-5 {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

.text-center {
    text-align: center;
}

.text-white {
    color: #fff !important;
}

.text-muted {
    color: #6c757d !important;
}

.d-flex {
    display: flex;
}

.justify-content-center {
    justify-content: center;
}

.align-items-center {
    align-items: center;
}

@media screen and (max-width: 768px) {
    .container {
        padding: 0 15px;
        /* Ensure 15px edge padding on small screens */
    }

    .py-5 {
        padding-top: 2rem;
        /* Slightly less vertical padding on mobile if needed, or keep 3rem */
        padding-bottom: 2rem;
    }
}

.justify-content-between {
    justify-content: space-between;
}

/* Chatbot Widget Styles */
#chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Roboto', sans-serif;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color, #183a83);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 24px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s ease;
    visibility: hidden;
}

.chat-window.active {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    background-color: var(--primary-color, #183a83);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.chat-header button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.bot-message {
    background-color: white;
    color: #333;
    border-bottom-left-radius: 2px;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.user-message {
    background-color: var(--primary-color, #183a83);
    color: white;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
}

.user-message a {
    color: #fff;
    text-decoration: underline;
}

.bot-message a {
    color: var(--primary-color, #183a83);
    font-weight: 500;
}

.chat-input-area {
    padding: 10px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-family: inherit;
}

#chat-input:focus {
    border-color: var(--primary-color, #183a83);
}

#chat-send-btn {
    background-color: var(--primary-color, #183a83);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-send-btn:hover {
    background-color: #122b61;
}

/* Loading Dots */
.loading .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #999;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out both;
}

.loading .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-window.active {
        position: fixed;
        z-index: 10000;
    }
}

/* Gallery Group Cards */
.gallery-group-card .card-img-top img {
    transition: transform 0.5s ease;
}

.gallery-group-card:hover .card-img-top img {
    transform: scale(1.1);
}

.gallery-overlay-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-group-card:hover .gallery-overlay-hover {
    opacity: 1;
}