/* Gallery Section Styles */

.gallery-section {
    background-color: var(--bg-dark);
    min-height: 100vh;
    padding: 25rem 0 5rem 0;
    position: relative;
    /* Ensure smooth scroll animations */
    overflow-x: hidden;
}

.gallery-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.gallery-count {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 3rem;
}

/* Gallery Slideshow Container */
.gallery-slideshow {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    min-height: 600px;
    padding: 2rem 0;
}

/* Thumbnail Styles (Left & Right) */
.gallery-thumbnail {
    position: relative;
    width: 200px;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.gallery-thumbnail-prev {
    transform: translateX(20px);
}

.gallery-thumbnail-next {
    transform: translateX(-20px);
}

.gallery-thumbnail:hover {
    transform: translateX(0) scale(1.05);
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(3px) brightness(0.6);
    transition: var(--transition);
}

.gallery-thumbnail:hover .thumbnail-img {
    filter: blur(1px) brightness(0.8);
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(17, 48, 46, 0.3),
        rgba(17, 48, 46, 0.7)
    );
    z-index: 1;
    pointer-events: none;
}

/* Current Image (Center) */
.gallery-current {
    position: relative;
    width: 700px;
    height: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--accent-color);
    transition: var(--transition);
}

.current-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: var(--primary-dark);
    transition: var(--transition);
}

.current-img.fade-out {
    opacity: 0;
}

/* Gallery Controls */
.gallery-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        to top,
        rgba(17, 48, 46, 0.95),
        rgba(17, 48, 46, 0.7),
        transparent
    );
    padding: 2rem 1rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.gallery-btn {
    background-color: var(--accent-color);
    color: var(--text-light);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.gallery-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--accent-color);
    transform: scale(1.1);
}

.gallery-btn:active {
    transform: scale(0.95);
}

.gallery-counter {
    background-color: rgba(45, 106, 101, 0.8);
    color: var(--text-light);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid var(--accent-color);
}

.current-index {
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: 700;
}

/* Progress Bar */
.gallery-progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 2rem;
    overflow: hidden;
}

.gallery-progress-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--accent-color) 0%,
        var(--primary-color) 100%
    );
    border-radius: 2px;
    transition: var(--transition);
    width: 0%;
}

/* Responsive Design */

/* Large Desktop */
@media (min-width: 1400px) {
    .gallery-current {
        width: 800px;
        height: 600px;
    }

    .gallery-thumbnail {
        width: 250px;
        height: 500px;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .gallery-title {
        font-size: 2.5rem;
    }

    .gallery-slideshow {
        min-height: 500px;
        gap: 1rem;
    }

    .gallery-current {
        width: 500px;
        height: 400px;
    }

    .gallery-thumbnail {
        width: 150px;
        height: 300px;
    }

    .gallery-thumbnail-prev {
        transform: translateX(10px);
    }

    .gallery-thumbnail-next {
        transform: translateX(-10px);
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1199px) {
    .gallery-section {
        padding: 16rem 0 4rem;
    }
}

/* Small Mobile (481px-767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .gallery-section {
        padding: 12rem 0 3rem;
    }
}

/* Extra Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .gallery-section {
        padding: 11rem 0 2.5rem;
    }
}

/* Mobile (공통 스타일) */
@media (max-width: 767px) {

    .gallery-title {
        font-size: 2rem;
    }

    .gallery-subtitle {
        font-size: 1rem;
    }

    .gallery-slideshow {
        flex-direction: column;
        min-height: auto;
        gap: 1rem;
        padding: 1rem 0;
    }

    .gallery-current {
        width: 100%;
        max-width: 400px;
        height: 350px;
        order: 1;
    }

    .gallery-thumbnail {
        width: 100%;
        max-width: 300px;
        height: 200px;
        transform: none !important;
    }

    .gallery-thumbnail-prev {
        order: 0;
    }

    .gallery-thumbnail-next {
        order: 2;
    }

    .thumbnail-img {
        filter: blur(2px) brightness(0.7);
    }

    .gallery-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .gallery-counter {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }

    .current-index {
        font-size: 1.1rem;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .gallery-title {
        font-size: 1.5rem;
    }

    .gallery-current {
        max-width: 100%;
        height: 300px;
    }

    .gallery-thumbnail {
        max-width: 250px;
        height: 150px;
    }

    .gallery-controls {
        padding: 1.5rem 0.5rem 0.5rem;
    }

    .gallery-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .gallery-counter {
        padding: 0.3rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Loading Animation */
.gallery-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-color);
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Fade animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-current.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Thumbnail Navigation List */
.gallery-thumbnail-list-container {
    position: relative;
    margin-top: 3rem;
    padding: 0 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gallery-thumbnail-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1rem 0;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.gallery-thumbnail-list::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.gallery-thumbnail-item {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
}

.gallery-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(4px) brightness(0.5);
    transition: var(--transition);
}

.gallery-thumbnail-item:hover img {
    filter: blur(2px) brightness(0.7);
}

.gallery-thumbnail-item:hover {
    transform: translateY(-5px);
    border-color: rgba(45, 106, 101, 0.5);
}

/* Active thumbnail (current image) */
.gallery-thumbnail-item.active {
    border-color: var(--accent-color);
    box-shadow: 0 5px 20px rgba(45, 106, 101, 0.6);
    transform: scale(1.1);
}

.gallery-thumbnail-item.active img {
    filter: blur(0) brightness(1);
}

/* Thumbnail scroll buttons */
.thumbnail-scroll-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.thumbnail-scroll-btn:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

.thumbnail-scroll-btn:active {
    transform: scale(0.95);
}

.thumbnail-scroll-btn i {
    font-size: 1rem;
}

/* Responsive adjustments for thumbnail list */
@media (max-width: 991px) {
    .gallery-thumbnail-list-container {
        padding: 0 2rem;
    }

    .gallery-thumbnail-item {
        width: 100px;
        height: 70px;
    }

    .thumbnail-scroll-btn {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 767px) {
    .gallery-thumbnail-list-container {
        padding: 0 1rem;
        margin-top: 2rem;
    }

    .gallery-thumbnail-item {
        width: 80px;
        height: 60px;
    }

    .thumbnail-scroll-btn {
        width: 30px;
        height: 30px;
    }

    .thumbnail-scroll-btn i {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .gallery-thumbnail-list-container {
        padding: 0 0.5rem;
    }

    .gallery-thumbnail-item {
        width: 70px;
        height: 50px;
    }
}
