/* ============================================
   Emerald Academy Events Microsite — Styles
   ============================================ */

/* ---- Smooth Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f6f2ff;
}
::-webkit-scrollbar-thumb {
    background: #c0c7d4;
    border-radius: 9999px;
    transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
    background: #707784;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #c0c7d4 #f6f2ff;
}


/* ============================================
   Timeline
   ============================================ */

/* Scroll reveal */
.timeline-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.timeline-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Center line */
.timeline-line::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(to bottom, #a1c9ff, #f3c000, #ffb688);
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .timeline-line::before {
        left: 24px;
    }
}


/* ============================================
   Modal
   ============================================ */

.modal-active {
    overflow: hidden;
}

#gallery-modal.showing {
    display: flex;
}
#gallery-modal.open {
    opacity: 1;
}
#gallery-modal.open #modal-container {
    transform: scale(1);
}


/* ============================================
   Fullscreen Image Viewer
   ============================================ */

#fullscreen-viewer.showing {
    display: flex;
}

/* Loading Spinner */
.fs-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #a1c9ff;
    border-radius: 50%;
    animation: fs-spin 0.8s linear infinite;
}
.fs-loader {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.fs-loader.loading {
    opacity: 1;
}

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

/* Image fade */
#fs-image {
    transition: opacity 0.3s ease;
}
#fs-image.loading {
    opacity: 0;
}

/* Swipe hint on mobile */
@media (max-width: 768px) {
    #fullscreen-viewer::after {
        content: '';
        position: absolute;
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 9999px;
        background: rgba(255, 255, 255, 0.25);
        animation: swipe-hint 2s ease-in-out infinite;
    }
}

@keyframes swipe-hint {
    0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 0.3; }
    50%      { transform: translateX(-50%) scaleX(1.5); opacity: 0.6; }
}

/* Nav buttons hover pulse */
#fs-prev:hover,
#fs-next:hover {
    transform: translateY(-50%) scale(1.1);
}
#fs-prev:active,
#fs-next:active {
    transform: translateY(-50%) scale(0.95);
}


/* ============================================
   Upcoming Events Section
   ============================================ */

.upcoming-section {
    border-top: 1px solid rgba(192, 199, 212, 0.3);
    border-bottom: 1px solid rgba(192, 199, 212, 0.3);
}

/* Pulse dot in badge */
.upcoming-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    animation: pulse-dot 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
}

@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Badge shimmer */
.upcoming-badge {
    position: relative;
    overflow: hidden;
}
.upcoming-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: badge-shimmer 3s ease-in-out infinite;
}

@keyframes badge-shimmer {
    0%   { left: -100%; }
    50%  { left: 100%; }
    100% { left: 100%; }
}

/* Upcoming card placeholder gradient */
.upcoming-placeholder {
    background: linear-gradient(135deg, #005ea4 0%, #0077cd 40%, #a1c9ff 100%);
}

/* Upcoming card entrance stagger */
.upcoming-card {
    opacity: 0;
    transform: translateY(20px);
    animation: card-enter 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.upcoming-card:nth-child(1) { animation-delay: 0.1s; }
.upcoming-card:nth-child(2) { animation-delay: 0.25s; }
.upcoming-card:nth-child(3) { animation-delay: 0.4s; }
.upcoming-card:nth-child(4) { animation-delay: 0.55s; }
.upcoming-card:nth-child(5) { animation-delay: 0.7s; }
.upcoming-card:nth-child(6) { animation-delay: 0.85s; }

@keyframes card-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============================================
   Gallery Thumbnail Grid Hover
   ============================================ */

.gallery-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    cursor: pointer;
    aspect-ratio: 1;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-thumb:hover img {
    transform: scale(1.08);
}
.gallery-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.35), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.gallery-thumb:hover::after {
    opacity: 1;
}
.gallery-thumb .thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}
.gallery-thumb:hover .thumb-overlay {
    opacity: 1;
}
.gallery-thumb .thumb-overlay span {
    background: rgba(255, 255, 255, 0.9);
    color: #005ea4;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-thumb:hover .thumb-overlay span {
    transform: scale(1);
}

/* Staggered grid entrance */
.gallery-thumb {
    opacity: 0;
    transform: scale(0.92);
    animation: thumb-enter 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes thumb-enter {
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* ============================================
   Empty State
   ============================================ */

.empty-state {
    animation: empty-float 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes empty-float {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.empty-state-icon {
    animation: icon-breathe 3s ease-in-out infinite;
}

@keyframes icon-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,94,164,0.1); }
    50%      { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(0,94,164,0); }
}


/* ============================================
   No-Image Placeholder Gradient
   ============================================ */

.no-image-placeholder {
    background: linear-gradient(135deg, #707784 0%, #404752 50%, #c0c7d4 100%);
    position: relative;
    overflow: hidden;
}
.no-image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(255,255,255,0.03) 20px,
        rgba(255,255,255,0.03) 40px
    );
}


/* ============================================
   Full-Width Footer Fix
   ============================================ */

.full-width {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}


/* ============================================
   Micro-Animation Utilities
   ============================================ */

/* Button press feedback */
button:active,
a:active {
    transition-duration: 0.1s;
}

/* Focus visible for accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #005ea4;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Smooth link underline transitions */
a {
    transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

/* Image loading shimmer placeholder */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.img-loading {
    background: linear-gradient(90deg, #eae5fd 25%, #f0ebff 50%, #eae5fd 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}


/* ============================================
   Responsive Tweaks
   ============================================ */

@media (max-width: 768px) {
    .timeline-reveal .flex-1:first-child {
        text-align: left !important;
        align-items: flex-start !important;
    }
}

/* Print friendly */
@media print {
    nav, #gallery-modal, #fullscreen-viewer, .upcoming-badge, .gallery-btn {
        display: none !important;
    }
    .timeline-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
    .timeline-line::before {
        background: #333 !important;
    }
}
