/* Main Styles for Polo Universitario */

/* CAMBIO: Reset CSS Global para eliminar espacios en blanco */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

/* CAMBIO: Asegurar que el contenido principal esté pegado arriba */
body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Global Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-100%); opacity: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 0.75rem rgba(249, 115, 22, 0.5)); }
    50% { filter: drop-shadow(0 0 2rem rgba(249, 115, 22, 0.8)); }
}

@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-15px); }
    70% { transform: translateY(-10px); }
    90% { transform: translateY(-5px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Logo animations */
@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes logo-glow {
    0%, 100% { filter: drop-shadow(0 0 1rem rgba(59, 130, 246, 0.3)); }
    50% { filter: drop-shadow(0 0 2rem rgba(59, 130, 246, 0.6)); }
}

@keyframes logo-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rotating-floating {
    0% { transform: rotate(0deg) translateY(0px); }
    25% { transform: rotate(90deg) translateY(-10px); }
    50% { transform: rotate(180deg) translateY(0px); }
    75% { transform: rotate(270deg) translateY(10px); }
    100% { transform: rotate(360deg) translateY(0px); }
}

@keyframes pulsing {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Animaciones para el carrusel mejorado */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.4;
    }
}

/* Utility Classes */
.animate-blob {
    animation: blob 7s infinite;
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

.animation-delay-1000 {
    animation-delay: 1s;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-300 {
    animation-delay: 0.3s;
}

.animation-delay-600 {
    animation-delay: 0.6s;
}

.animation-delay-900 {
    animation-delay: 0.9s;
}

.floating-element {
    animation: float 6s ease-in-out infinite;
}

.glow {
    animation: glow 4s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-fadeInUp {
    animation: fadeInUp 1s ease-out;
}

.rotating-floating {
    animation: rotating-floating 3s ease-in-out infinite;
}

.pulsing {
    animation: pulsing 2s ease-in-out infinite;
}

/* Carrusel de Instituciones */
@keyframes carousel-fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes carousel-slide-in {
    from { transform: translateX(100%) scale(0.8); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes institution-hover {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(1deg); }
    100% { transform: scale(1.1) rotate(0deg); }
}

@keyframes logo-shimmer {
    0% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.3); }
    50% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.6), 0 0 30px rgba(245, 158, 11, 0.4); }
    100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.3); }
}

.carousel-institution-card {
    animation: carousel-fade-in 0.5s ease-out;
}

.carousel-institution-card:hover {
    animation: institution-hover 0.6s ease-in-out;
}

.carousel-logo-container {
    animation: logo-shimmer 3s ease-in-out infinite;
}

/* Efectos de transición suaves para el carrusel */
.carousel-slide-enter {
    opacity: 0;
    transform: scale(0.95) translateX(50px);
}

.carousel-slide-enter-active {
    opacity: 1;
    transform: scale(1) translateX(0);
    transition: all 0.7s ease-out;
}

.carousel-slide-exit {
    opacity: 1;
    transform: scale(1) translateX(0);
}

.carousel-slide-exit-active {
    opacity: 0;
    transform: scale(0.95) translateX(-50px);
    transition: all 0.4s ease-in;
}

/* Efectos de hover para botones del carrusel */
.carousel-nav-button {
    position: relative;
    overflow: hidden;
}

.carousel-nav-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    border-radius: 50%;
}

.carousel-nav-button:hover::before {
    width: 100px;
    height: 100px;
}

/* Mejoras para los indicadores de puntos */
.carousel-dot {
    position: relative;
    overflow: hidden;
}

.carousel-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: linear-gradient(45deg, #3B82F6, #8B5CF6);
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    border-radius: 50%;
    opacity: 0;
}

.carousel-dot.active::after,
.carousel-dot:hover::after {
    width: 20px;
    height: 20px;
    opacity: 0.3;
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hero Gradient */
.hero-gradient {
    background: linear-gradient(130deg, #404040 0%, #f97316 50%, #fbbf24 100%);
}

.hero-slide {
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

/* Navigation Effects */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: linear-gradient(90deg, #f97316, #fbbf24);
    transition: all 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
}

/* Carousel Effects */
.carousel-item {
    transition: all 0.5s ease-in-out;
}

.carousel-item.active {
    animation: slideIn 0.5s forwards;
}

.carousel-item.inactive {
    animation: slideOut 0.5s forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #f97316, #fbbf24);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #ea580c, #f59e0b);
}

/* Hover Effects */
.hover-scale {
    transition: transform 0.3s ease-in-out;
}

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

.hover-glow {
    transition: filter 0.3s ease-in-out;
}

.hover-glow:hover {
    filter: drop-shadow(0 0 1rem rgba(37, 99, 235, 0.5));
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6, #F59E0B);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Interactive Elements */
.interactive-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.interactive-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.interactive-card:hover::before {
    left: 100%;
}

.interactive-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Emoji Animations */
.emoji-bounce {
    display: inline-block;
    animation: bounce 2s infinite;
}

.emoji-spin {
    display: inline-block;
    animation: spin 3s linear infinite;
}

.emoji-pulse {
    display: inline-block;
    animation: pulse 2s infinite;
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-gradient {
        background: linear-gradient(180deg, #404040 0%, #f97316 50%, #fbbf24 100%);
    }

    .floating-element {
        animation: none;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus States */
*:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #f97316;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Mejoras de accesibilidad para el carrusel */
.carousel-container:focus-within .carousel-nav-button {
    opacity: 1;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .carousel-slide-enter-active,
    .carousel-slide-exit-active {
        transition: opacity 0.3s ease;
        transform: none;
    }

    .animate-pulse-slow,
    .animate-pulse,
    .animate-bounce {
        animation: none;
    }
}

/* Mejoras para dispositivos móviles */
@media (max-width: 768px) {
    .carousel-nav-button {
        width: 40px;
        height: 40px;
    }

    .carousel-nav-button svg {
        width: 20px;
        height: 20px;
    }

    .carousel-container {
        margin: 0 -1rem;
    }
}

/* Efectos de partículas flotantes */
@keyframes float-particles {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

.floating-particles::before,
.floating-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #3B82F6, #8B5CF6);
    border-radius: 50%;
    animation: float-particles 6s ease-in-out infinite;
}

.floating-particles::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-particles::after {
    bottom: 20%;
    right: 10%;
    animation-delay: 3s;
}

/* Logo utility classes */
.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

.animate-logo-glow {
    animation: logo-glow 2s ease-in-out infinite;
}

.animate-logo-pulse {
    animation: logo-pulse 2s ease-in-out infinite;
}

/* Utilidades de opacidad extendidas */
.opacity-2 { opacity: 0.02; }
.opacity-3 { opacity: 0.03; }
.opacity-4 { opacity: 0.04; }
.opacity-5 { opacity: 0.05; }
.opacity-6 { opacity: 0.06; }
.opacity-7 { opacity: 0.07; }
.opacity-8 { opacity: 0.08; }
.opacity-18 { opacity: 0.18; }
.opacity-20 { opacity: 0.20; }
.opacity-22 { opacity: 0.22; }
.opacity-25 { opacity: 0.25; }
.opacity-28 { opacity: 0.28; }
.opacity-30 { opacity: 0.30; }
.opacity-35 { opacity: 0.35; }
.opacity-38 { opacity: 0.38; }
.opacity-40 { opacity: 0.40; }
.opacity-42 { opacity: 0.42; }
.opacity-45 { opacity: 0.45; }
.opacity-50 { opacity: 0.50; }
.opacity-55 { opacity: 0.55; }
.opacity-60 { opacity: 0.60; }

/* Utility para w-68 h-68 */
.w-68 { width: 17rem; }
.h-68 { height: 17rem; }

/* Estilos para el fondo animado Lottie */
#fondo-lottie {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
    background: transparent;
    overflow: hidden;
}

.lottie-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Optimizaciones para dispositivos móviles */
@media (max-width: 768px) {
    #fondo-lottie {
        opacity: 0.4;
        transform: scale(1.1);
    }
}

/* Animaciones adicionales para mejorar la experiencia */
@keyframes lottie-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 0.6;
        transform: scale(1);
    }
}

#fondo-lottie.loaded {
    animation: lottie-fade-in 1s ease-out forwards;
}

/* Soporte para modo oscuro */
@media (prefers-color-scheme: dark) {
    #fondo-lottie {
        opacity: 0.4;
        filter: brightness(0.8);
    }
}

/* Animaciones para transiciones suaves */
#fondo-lottie {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Prevenir interferencia con el contenido */
#fondo-lottie svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    user-select: none;
    pointer-events: none;
}
