/* UFCH - estilos compartidos (base, top-bar, header, navegacion, footer) */

:root {
    --primary-color: #7DC6ED;
    --secondary-color: #F44336;
    --accent-color: #F44336;
    --success-color: #059669;
    --warning-color: #d97706;
    --light-gray: #f8fafc;
    --medium-gray: #d3d3d3;
    --dark-gray: #475569;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    display: flex;
    gap: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    transition: opacity 0.3s;
}

.social-links a:hover {
    opacity: 0.8;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    width: 80px;
    height: 80px;
}

.logo-text h1 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.logo-text p {
    color: var(--secondary-color);
    font-size: 14px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.language-selector {
    padding: 6px 12px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.language-selector:hover {
    border-color: var(--primary-color);
}

.search-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: var(--dark-gray);
    font-size: 18px;
    transition: color 0.3s;
}

.search-btn:hover {
    color: var(--primary-color);
}

.cta-button {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: #e53935;
}

/* Navigation */
nav {
    background-color: var(--primary-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
}

.main-menu {
    display: flex;
    list-style: none;
}

.main-menu li {
    position: relative;
}

.main-menu a {
    display: block;
    color: white;
    padding: 15px 20px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.main-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.has-dropdown::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 5px;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    background-color: white;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
}

.main-menu li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li {
    width: 100%;
}

.dropdown a {
    color: var(--text-primary);
    padding: 12px 20px;
    border-bottom: 1px solid var(--light-gray);
}

.dropdown a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 6px;
}

/* Footer */
footer {
    background-color: #1e293b;
    color: white;
    padding-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #cbd5e1;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.contact-item i {
    color: var(--primary-color);
    font-size: 18px;
    margin-top: 3px;
}

.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    outline: none;
}

.newsletter-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.newsletter-btn:hover {
    background-color: #e53935;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding: 20px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* ===== Botón volver arriba (en includes/footer.php) ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #7DC6ED;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background-color: #F44336;
    transform: translateY(-5px);
}

.scroll-to-top i {
    font-size: 24px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(125, 198, 237, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(125, 198, 237, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(125, 198, 237, 0);
    }
}

.scroll-to-top.pulse {
    animation: pulse 1.5s infinite;
}

/* ===== Responsive compartido ===== */
img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 992px) {
    .logo img {
        width: 60px;
        height: 60px;
    }

    .logo-text h1 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    /* Una sola franja: se oculta la top bar (datos repetidos en el footer) */
    .top-bar {
        display: none;
    }

    /* Header compacto: logo pequeño en fila + CTA + hamburguesa */
    .header-main {
        padding: 8px 0;
        gap: 10px;
    }

    .logo {
        gap: 10px;
        flex: 1;
        min-width: 0;
    }

    /* Nombre de la universidad compacto al lado del logo */
    .logo-text {
        min-width: 0;
    }

    .logo-text h1 {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .logo-text p {
        font-size: 10px;
    }

    .logo img {
        width: 48px;
        height: 48px;
    }

    /* En móvil solo quedan el logo y el botón de menú */
    .language-selector,
    .search-btn,
    .header-actions .cta-button {
        display: none;
    }

    /* Menú hamburguesa (el botón vive en el header; el nav queda sin altura) */
    .mobile-menu-btn {
        display: block;
    }

    .main-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    /* Menú desplegado: fijo bajo el header sticky (top/max-height los pone JS) */
    .main-menu.active {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        background-color: var(--primary-color);
        overflow-y: auto;
        box-shadow: var(--shadow-lg);
        z-index: 99;
    }

    .main-menu > li > a {
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    /* Dropdowns en acordeón (tap en vez de hover) */
    .dropdown {
        display: none;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
        box-shadow: none;
        min-width: 0;
    }

    .main-menu li.open > .dropdown {
        display: block;
    }

    .main-menu li.open > .has-dropdown::after {
        content: '\f106';
    }
}

@media (max-width: 576px) {
    .footer-grid {
        gap: 30px;
    }
}
