/* ============================================
   event_animations.css
   Animations, Transitions, and Loading States
   ============================================ */

/* ============================================
   Keyframe Animations
   ============================================ */

/* Spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero button entrance animation */
@keyframes heroButtonEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Checkbox pulse animation */
@keyframes checkPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

/* Spinner for buttons */
@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Fade out animation */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Slide up animation */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Wave animation for loading dots */
@keyframes wave {
    0%, 60%, 100% {
        transform: initial;
    }
    30% {
        transform: translateY(-15px);
    }
}

/* ============================================
   Loading States
   ============================================ */

/* Loading Spinner Overlay */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading overlay for sections */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: inherit;
}

.loading-overlay .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.25rem;
}

/* Quick Loading Overlay (from event_uni.js styles) */
.quick-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

.quick-loading-overlay .spinner-container {
    text-align: center;
}

.quick-loading-overlay p {
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
}

/* ============================================
   Quick Notifications
   ============================================ */
.quick-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    min-width: 300px;
    text-align: center;
    display: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    border: none;
    animation: slideDown 0.3s ease-out;
}

.quick-notification.alert-success {
    background: linear-gradient(135deg, #4A7C59 0%, #3A6348 100%);
    color: white;
}

.quick-notification.alert-info {
    background: linear-gradient(135deg, #6C9BD1 0%, #5B7C99 100%);
    color: white;
}

.quick-notification.alert-warning {
    background: linear-gradient(135deg, #F4A261 0%, #E89245 100%);
    color: white;
}

.quick-notification.alert-error {
    background: linear-gradient(135deg, #C1666B 0%, #A85459 100%);
    color: white;
}

/* ============================================
   Animated Elements
   ============================================ */

/* Remove pulse animation from RSVP button for cleaner look */
.btn-rsvp-hero {
    animation: none;
}

/* Add subtle entrance animation instead */
@keyframes heroButtonEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-rsvp-hero {
    animation: heroButtonEntrance 0.6s ease-out;
}

/* ============================================
   Transition Classes
   ============================================ */

/* Fade transitions */
.fade-enter {
    opacity: 0;
}

.fade-enter-active {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.fade-exit {
    opacity: 1;
}

.fade-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Slide transitions */
.slide-enter {
    transform: translateX(100%);
}

.slide-enter-active {
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.slide-exit {
    transform: translateX(0);
}

.slide-exit-active {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

/* ============================================
   Progress Indicators
   ============================================ */

/* Linear progress bar */
.progress-linear {
    height: 4px;
    background: var(--secondary-color);
    position: relative;
    overflow: hidden;
}

.progress-linear::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--primary-color);
    width: 30%;
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% {
        left: -30%;
    }
    100% {
        left: 100%;
    }
}

/* Dots loader */
.dots-loader {
    display: inline-flex;
    gap: 0.25rem;
}

.dots-loader span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: wave 1.3s linear infinite;
}

.dots-loader span:nth-child(2) {
    animation-delay: -1.1s;
}

.dots-loader span:nth-child(3) {
    animation-delay: -0.9s;
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-title {
    height: 2rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-button {
    height: 3rem;
    width: 150px;
    border-radius: 50px;
}

/* ============================================
   Hover Effects
   ============================================ */

/* Smooth hover transitions */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(45, 62, 80, 0.15);
}

/* Glow effect */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(91, 124, 153, 0.4);
}

/* Scale effect */
.hover-scale {
    transition: transform 0.3s ease;
}

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

/* ============================================
   Focus States
   ============================================ */

/* Custom focus outline */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
    outline-offset: 4px;
}

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

/* Scroll padding for fixed headers */
html {
    scroll-padding-top: 80px;
}

/* ============================================
   Timezone Loading - Enhanced Styles
   Optional: Add to event_animations.css for better loading UX
   ============================================ */

/* Shimmer/Skeleton Loading Effect */
.timezone-skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    min-height: 1.5em;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Alternative Pulse Loading */
.timezone-pulse {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Date Badge Loading State */
.event-date-badge.timezone-loading {
    position: relative;
}

.event-date-badge.timezone-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: sweep 1.5s infinite;
    pointer-events: none;
}

@keyframes sweep {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Smooth Content Switch */
.timezone-switch {
    position: relative;
}

.timezone-switch-old {
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.timezone-switch-new {
    opacity: 0;
    transition: opacity 0.3s ease-in 0.15s;
}

.timezone-switch-new.active {
    opacity: 1;
}

/* Loading Dots Animation */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* Prevent Layout Shift */
.timezone-container {
    min-height: var(--timezone-height, auto);
    transition: min-height 0.3s ease;
}

/* Accessibility - Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .timezone-skeleton,
    .timezone-pulse,
    .event-date-badge.timezone-loading::after,
    .loading-dots::after {
        animation: none;
    }

    .timezone-switch-old,
    .timezone-switch-new,
    .timezone-container {
        transition: none;
    }
}
