/* ==========================================
   ANIMACIONES Y TRANSICIONES PROFESIONALES
   Diseño Académico - PUCP X Seminario
   ========================================== */

/* ========================================== */
/* VARIABLES DE ANIMACIÓN */
/* ========================================== */
:root {
    --animation-duration: 0.6s;
    --animation-timing: cubic-bezier(0.4, 0.0, 0.2, 1);
    --hover-transition: all 0.3s ease;
}

/* ========================================== */
/* KEYFRAME ANIMATIONS */
/* ========================================== */

/* Fade In Up - Para elementos que entran desde abajo */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down - Para headers y títulos */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left - Para elementos laterales */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In - Para cards y elementos importantes */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse - Para elementos que requieren atención */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Float - Animación sutil flotante */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Slide In From Bottom */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rotate In */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* Shimmer - Para loading states */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Progress Bar Animation */
@keyframes progressBar {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* Counter Animation (usado con JS) */
@keyframes countUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* ========================================== */
/* CLASES DE ANIMACIÓN REUTILIZABLES */
/* ========================================== */

/* Animaciones de entrada básicas */
.animate-fadeInUp {
    animation: fadeInUp var(--animation-duration) var(--animation-timing) forwards;
    opacity: 0;
}

.animate-fadeInDown {
    animation: fadeInDown var(--animation-duration) var(--animation-timing) forwards;
    opacity: 0;
}

.animate-fadeInLeft {
    animation: fadeInLeft var(--animation-duration) var(--animation-timing) forwards;
    opacity: 0;
}

.animate-fadeInRight {
    animation: fadeInRight var(--animation-duration) var(--animation-timing) forwards;
    opacity: 0;
}

.animate-scaleIn {
    animation: scaleIn var(--animation-duration) var(--animation-timing) forwards;
    opacity: 0;
}

.animate-bounceIn {
    animation: bounceIn 0.8s var(--animation-timing) forwards;
    opacity: 0;
}

/* Delays para animaciones en cascada */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ========================================== */
/* SCROLL PROGRESS BAR */
/* ========================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #D4237A 0%, #C3D600 50%, #003D7A 100%);
    z-index: 10001;
    transition: width 0.1s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========================================== */
/* BACK TO TOP BUTTON */
/* ========================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #D4237A, #E94B93);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(212, 35, 122, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #003D7A, #005A9C);
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 61, 122, 0.5);
}

.back-to-top:active {
    transform: scale(0.95);
}

/* ========================================== */
/* COUNTDOWN TIMER */
/* ========================================== */
.countdown-container {
    background: linear-gradient(135deg, rgba(0, 61, 122, 0.05), rgba(195, 214, 0, 0.05));
    border: 2px solid var(--azul-pucp);
    border-radius: 15px;
    padding: 30px;
    margin: 40px 0;
    text-align: center;
}

.countdown-title {
    font-family: 'Merriweather', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--azul-pucp);
    margin-bottom: 20px;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.countdown-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    min-width: 100px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.countdown-item:hover {
    transform: translateY(-5px);
}

.countdown-number {
    font-family: 'Merriweather', serif;
    font-size: 48px;
    font-weight: 900;
    color: var(--magenta);
    line-height: 1;
    display: block;
    margin-bottom: 5px;
}

.countdown-label {
    font-size: 14px;
    color: var(--gris-medio);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================== */
/* STICKY HEADER CON SCROLL EFFECT */
/* ========================================== */
.header {
    transition: all 0.3s ease;
}

.header.scrolled {
    padding: 5px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header.scrolled .logo-placeholder {
    transform: scale(0.85);
    transition: transform 0.3s ease;
}

/* ========================================== */
/* SKELETON LOADERS */
/* ========================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 10px;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 15px;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

/* ========================================== */
/* IMAGE ZOOM ON HOVER */
/* ========================================== */
.image-zoom-container {
    overflow: hidden;
    border-radius: 10px;
}

.image-zoom {
    transition: transform 0.5s ease;
    will-change: transform;
}

.image-zoom-container:hover .image-zoom {
    transform: scale(1.1);
}

/* ========================================== */
/* TOOLTIP SYSTEM */
/* ========================================== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    background-color: #1A1A1A;
    color: white;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1A1A1A transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================== */
/* LOADING SPINNER */
/* ========================================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(212, 35, 122, 0.2);
    border-top-color: #D4237A;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================== */
/* FORM VALIDATION FEEDBACK */
/* ========================================== */
.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #10B981;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2310B981' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #DC2626;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23DC2626' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.error-message {
    color: #DC2626;
    font-size: 13px;
    margin-top: 5px;
    display: none;
    animation: fadeInDown 0.3s ease;
}

.form-group.error .error-message {
    display: block;
}

.success-message {
    color: #10B981;
    font-size: 13px;
    margin-top: 5px;
    display: none;
    animation: fadeInDown 0.3s ease;
}

.form-group.success .success-message {
    display: block;
}

/* ========================================== */
/* FOCUS INDICATORS (Accesibilidad) */
/* ========================================== */
*:focus {
    outline: 2px solid #C3D600;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 3px solid #C3D600;
    outline-offset: 3px;
}

/* ========================================== */
/* PARALLAX SUBTLE */
/* ========================================== */
.parallax-element {
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========================================== */
/* STAGGER ANIMATIONS */
/* ========================================== */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delays para stagger effect */
.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }
.stagger-item:nth-child(7) { transition-delay: 0.7s; }
.stagger-item:nth-child(8) { transition-delay: 0.8s; }

/* ========================================== */
/* BREADCRUMBS */
/* ========================================== */
.breadcrumbs {
    padding: 15px 0;
    background: rgba(0, 61, 122, 0.03);
    margin-bottom: 20px;
    animation: fadeInDown 0.6s ease;
}

.breadcrumbs-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--gris-medio);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.breadcrumb-item:hover {
    color: var(--azul-pucp);
}

.breadcrumb-item.active {
    color: var(--magenta);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--gris-medio);
    font-size: 12px;
}

/* ========================================== */
/* SMOOTH REVEAL ON SCROLL */
/* ========================================== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================== */
/* ACCESSIBILITY - REDUCED MOTION */
/* ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .parallax-element {
        transform: none !important;
    }
}

/* ========================================== */
/* RESPONSIVE ANIMATIONS */
/* ========================================== */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .countdown-item {
        min-width: 80px;
        padding: 15px;
    }

    .countdown-number {
        font-size: 36px;
    }

    .countdown-label {
        font-size: 12px;
    }
}

/* ========================================== */
/* PRINT STYLES */
/* ========================================== */
@media print {
    .back-to-top,
    .scroll-progress,
    .countdown-container {
        display: none !important;
    }
}
