/* Event Detail Modal Styles */

.event-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.event-detail-modal.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.event-detail-modal.closing {
    animation: fadeOut 0.3s ease;
}

.event-detail-modal.closing .modal-container {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.4s ease;
}

.event-detail-modal.show .modal-overlay {
    animation: fadeIn 0.4s ease;
}

.event-detail-modal.show .modal-container {
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(80px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* Autoplay Toggle Button */
.autoplay-toggle {
    position: absolute;
    top: 20px;
    right: 70px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.autoplay-toggle:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.autoplay-toggle.playing {
    background: rgba(102, 126, 234, 0.8);
}

.autoplay-toggle.playing:hover {
    background: rgba(102, 126, 234, 1);
}

/* Autoplay Progress Bar */
.autoplay-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 5;
}

.autoplay-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.1s linear;
}

.autoplay-progress-bar.animating {
    animation: progressBar 4s linear;
}

@keyframes progressBar {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.modal-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-content-wrapper h3 {
    padding: 25px 30px;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5rem;
    text-align: center;
}

/* Flyer Slider */
.flyer-slider {
    flex: 1;
    position: relative;
    background: #f8f9fa;
    overflow: hidden;
}

.flyer-slider-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Zoomed state */
.flyer-slider-container.zoomed {
    overflow: auto;
    cursor: grab;
}

.flyer-slider-container.zoomed:active {
    cursor: grabbing;
}

.flyer-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.85) translateX(100px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.flyer-slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateX(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    animation: slideInFromRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: scale(0.85) translateX(100px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: scale(0.85) translateX(-100px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

/* Direction-based animations */
.flyer-slide.active[data-direction="next"] {
    animation: slideInFromRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flyer-slide.active[data-direction="prev"] {
    animation: slideInFromLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulse animation for navigation buttons */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    }
}

.slider-nav {
    animation: pulse 2s ease-in-out infinite;
}

.flyer-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Zoom hint */
.flyer-slide img:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
    transform: scale(1.03);
    filter: brightness(1.05);
}

/* Navigation Buttons */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 20px;
    color: #667eea;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.slider-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: #764ba2;
}

.slider-nav:active {
    transform: translateY(-50%) scale(1.05);
}

.slider-nav.prev {
    left: 20px;
}

.slider-nav.next {
    right: 20px;
}

/* Thumbnails */
.flyer-thumbnails {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid #e9ecef;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}

.flyer-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.flyer-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.flyer-thumbnails::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.flyer-thumb {
    position: relative;
    flex-shrink: 0;
    width: 100px;
    height: 75px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.flyer-thumb:hover {
    border-color: #667eea;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.flyer-thumb.active {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

.flyer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-number {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* Flyer Title and Counter */
.flyer-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.flyer-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.flyer-counter {
    font-size: 0.9rem;
    color: #666;
    background: #f8f9fa;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 500;
}

/* Zoom hint badge */
.zoom-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 3;
    pointer-events: none;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        height: 95vh;
        margin: 2.5vh auto;
        border-radius: 15px;
    }
    
    .modal-content-wrapper h3 {
        padding: 20px 15px;
        font-size: 1.2rem;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .autoplay-toggle {
        top: 15px;
        right: 60px;
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .slider-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .slider-nav.prev {
        left: 10px;
    }
    
    .slider-nav.next {
        right: 10px;
    }
    
    .flyer-slide {
        padding: 10px;
    }
    
    .flyer-thumbnails {
        padding: 10px 15px;
        gap: 8px;
    }
    
    .flyer-thumb {
        width: 80px;
        height: 60px;
    }
    
    .flyer-info-bar {
        flex-direction: column;
        gap: 10px;
        padding: 12px 20px;
        align-items: flex-start;
    }
    
    .flyer-title {
        font-size: 1rem;
    }
    
    .flyer-counter {
        font-size: 0.85rem;
        padding: 4px 12px;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .autoplay-toggle {
        top: 12px;
        right: 55px;
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .modal-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .flyer-thumb {
        width: 64px;
        height: 48px;
    }
}
