/* Enhanced Gallery Styles for Seikai Education */

/* Main Gallery Container */
.gallery-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.main-gallery {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

/* Gallery Images */
.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.gallery-image.active {
    opacity: 1;
}

.nav-prev,
.nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: all;
    z-index: 3;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-prev {
    left: 15px;
}

.nav-next {
    right: 15px;
}

.nav-prev:hover,
.nav-next:hover {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Gallery Info */
.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px 15px 15px;
    z-index: 2;
}

.gallery-info h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.gallery-info p {
    margin: 0 0 10px 0;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

.gallery-info span {
    font-size: 12px;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 10px;
}

   /* 在 gallery-info 之後添加 */
    .gallery-dots {
        display: none;
        justify-content: center;
        gap: 8px;
        padding: 10px 0;
        position: absolute;
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 3;
    }

    .gallery-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        transition: all 0.3s ease;
    }

    .gallery-dot.active {
        background: rgba(255, 255, 255, 1);
        transform: scale(1.3);
    }

/* Modal Gallery Styles */
.modal-gallery {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    border-radius: 12px;
}

.modal-gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal-gallery-image.active {
    opacity: 1;
}

.modal-gallery-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.modal-nav-prev,
.modal-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: all;
    z-index: 3;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-nav-prev {
    left: 10px;
}

.modal-nav-next {
    right: 10px;
}

.modal-nav-prev:hover,
.modal-nav-next:hover {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
}

.modal-gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 3;
}

/* Program Carousel Styles */
.program-main-gallery {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.program-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.program-slide.active {
    display: block;
    opacity: 1;
}

.program-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20; 
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.program-nav-prev {
    left: 20px;
}

.program-nav-next {
    right: 20px;
}

.program-nav:hover {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.program-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(5px); 
}

/* Program Dots Navigation */
.program-dots-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    position: relative;
    z-index: 5;
}

.program-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(102, 126, 234, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.program-dot.active {
    background: #667eea;
    transform: scale(1.2);
}

.program-dot:hover {
    background: #667eea;
    transform: scale(1.1);
}

/* Program Info Panel */
.program-info-panel {
    text-align: center;
    padding: 20px;
    background: #f8faff;
    border-radius: 12px;
    margin-top: 20px;
}

.program-info-panel h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.program-info-panel p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-prev,
    .nav-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .nav-prev {
        left: 10px;
    }
    
    .nav-next {
        right: 10px;
    }
    
    .program-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .program-nav-prev {
        left: 15px;
    }
    
    .program-nav-next {
        right: 15px;
    }
    
    .gallery-info h4 {
        font-size: 16px;
    }
    
    .gallery-info p {
        font-size: 13px;
    }

    .gallery-dots {
        display: flex;
    }

    /* 為 gallery 添加滾動提示 */
    .gallery-container::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 60px;
        background: linear-gradient(to right, rgba(0,0,0,0.3), transparent);
        pointer-events: none;
        z-index: 1;
    }
    
    .gallery-container::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 60px;
        background: linear-gradient(to left, rgba(0,0,0,0.3), transparent);
        pointer-events: none;
        z-index: 1;
    }
}

@media (max-width: 480px) {
    .nav-prev,
    .nav-next {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .program-nav {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .gallery-info {
        padding: 15px 10px 10px;
    }
    
    .gallery-info h4 {
        font-size: 14px;
    }
    
    .gallery-info p {
        font-size: 12px;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gallery-image.active,
.modal-gallery-image.active {
    animation: fadeIn 0.5s ease-in-out;
}

/* Hover effects for better UX */
.gallery-container:hover .nav-prev,
.gallery-container:hover .nav-next {
    opacity: 1;
}

.modal-gallery:hover .modal-nav-prev,
.modal-gallery:hover .modal-nav-next {
    opacity: 1;
}

/* Focus styles for accessibility */
.nav-prev:focus,
.nav-next:focus,
.modal-nav-prev:focus,
.modal-nav-next:focus,
.program-nav:focus,
.program-dot:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading state */
.gallery-image:not(.active) {
    opacity: 0;
}

/* Ensure proper stacking */
.gallery-container,
.modal-gallery,
.program-main-gallery {
    position: relative;
    z-index: 1;
}