/* General Body & Fullscreen Container */
body {
    margin: 0;
    padding: 0;
    background-color: #000; /* Fallback for browsers */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden; /* Prevent scrollbars on the body */
}

.fullscreen-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    color: #f0f0f0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

/* Back Link */
.back-link {
    position: absolute;
    top: 25px;
    right: 30px;
    color: #c8a97e;
    text-decoration: none;
    font-size: 1rem;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #FFD700;
    transition: background-color 0.3s;
}
.back-link:hover {
    background-color: #FFD700;
    color: #000;
}


/* Header Styles */
.gallery-header {
    text-align: center;
    padding: 20px;
    flex-shrink: 0; /* Prevents header from shrinking */
    position: relative; /* Needed for z-index context */
    z-index: 5;
}
.gallery-header h1 {
    font-size: 2rem;
    color: #c8a97e;
    margin: 0 0 5px 0;
}
.gallery-header p {
    font-size: 1rem;
    color: #cccccc;
    margin: 0;
}

/* Main Slider Wrapper & Image */
.slider-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1; /* Allows this container to take up available space */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.main-image-container {
    width: 100%;
    height: 100%;
}
.slider-image {
    width: 100%;
    height: 100%;
    display: none;
    object-fit: contain; /* CRITICAL: Keeps aspect ratio without cropping */
    animation: fadeIn 0.7s ease-in-out;
}
.slider-image.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* Main Slider Navigation Arrows */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.3s;
}
.slider-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}
.slider-nav svg {
    width: 30px;
    height: 30px;
    fill: #c8a97e;
}
.prev-btn { left: 20px; }
.next-btn { right: 20px; }


/* Thumbnail Carousel */
.thumbnail-carousel-wrapper {
    position: relative;
    width: 100%;
    padding: 20px 0;
    flex-shrink: 0; /* Prevents carousel from shrinking */
    box-sizing: border-box;
}
.thumbnail-track-container {
    width: 75%; /* Adjust width to make space for arrows */
    margin: 0 auto;
    overflow: hidden;
}
.thumbnail-track {
    display: flex;
    gap: 12px;
    transition: transform 0.5s ease-in-out;
}
.thumbnail-image {
    width: 130px;
    height: 85px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 3px solid transparent;
    opacity: 0.6;
    flex-shrink: 0; /* Prevents thumbnails from shrinking */
    transition: all 0.3s ease;
}
.thumbnail-image:hover {
    opacity: 1;
    transform: scale(1.05);
}
.thumbnail-image.active {
    opacity: 1;
    border-color: #FFD700;
    transform: scale(1.1);
}

/* Thumbnail Navigation */
.thumb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(20, 20, 20, 0.8);
    border: 1px solid #444;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: opacity 0.3s;
}
.thumb-nav svg { fill: #c8a97e; width: 24px; height: 24px; }
.thumb-prev-btn { left: 5%; }
.thumb-next-btn { right: 5%; }
.thumb-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


/* --- Responsive Design --- */

/* For Tablets */
@media (max-width: 768px) {
    .gallery-header h1 { font-size: 1.5rem; }
    .gallery-header p { font-size: 0.9rem; }
    .back-link { top: 15px; right: 15px; padding: 6px 12px; font-size: 0.9rem; }
    .slider-nav { width: 45px; height: 45px; }
    .thumbnail-track-container { width: 70%; }
    .thumb-prev-btn { left: 2%; }
    .thumb-next-btn { right: 2%; }
    .thumbnail-image { width: 100px; height: 67px; }
}


/* For Mobile Phones */
@media (max-width: 480px) {
    /* --- CHANGE 1: Give header padding to prevent overlap with status bar and "Go Back" link --- */
    .gallery-header {
        padding: 60px 15px 15px 15px; /* Added 60px padding at the top */
    }
    .gallery-header h1 {
        font-size: 1.2rem; /* Made font smaller to fit better */
    }
    .back-link {
        top: 15px; /* Ensure "Go Back" link stays at the very top */
    }

    /* --- CHANGE 2: Make the main image much larger on mobile screens --- */
    .slider-wrapper {
        flex-grow: 0; /* Disable flex-grow */
        aspect-ratio: 4 / 3; /* Force a 4:3 aspect ratio, making it much taller */
        margin-bottom: 20px; /* Add some space between image and thumbnails */
    }

    /* --- CHANGE 3: Adjust thumbnail carousel for small screens --- */
    .thumbnail-carousel-wrapper {
        padding: 0; /* Remove padding to save space */
    }
    .thumbnail-track-container {
        width: 75%; /* Increase track width to show more thumbnails */
    }
    .thumbnail-image {
        width: 80px;
        height: 54px;
    }
    .thumb-prev-btn {
        left: 2%;
    }
    .thumb-next-btn {
        right: 2%;
    }
}