/* General Body and Main Container Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column; /* Stacks children vertically */
    align-items: center; /* Centers children horizontally in the flex container */
    min-height: 100vh; /* Ensures body takes at least full viewport height */
    box-sizing: border-box; /* Includes padding in element's total width and height */
    overflow-x: hidden; /* Prevents horizontal scrollbar if content overflows */
}

h1 {
    text-align: center;
    color: #007bff;
    margin-bottom: 20px;
}

#galleryView, #adminView {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%; /* Takes full width of its centered parent */
    max-width: 960px; /* Maximum width for the main content area */
    box-sizing: border-box;
    margin-bottom: 20px; /* Adds space below the main container */
}

/* Message Area Styling */
#message {
    text-align: center;
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 5px;
    color: #333;
    background-color: #e2e3e5;
    border: 1px solid #d6d8db;
    width: 100%;
    max-width: 960px;
    box-sizing: border-box;
    font-size: 0.9em;
}

#message.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Album Selection Buttons */
#albumButtonsContainer {
    text-align: center;
    margin-top: 20px;
}

.album-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    min-width: 150px;
}

.album-button:hover {
    background-color: #0056b3;
}

/* Slideshow Container */
#slideshow-container {
    position: relative;
    width: 100%;
    max-width: 960px; /* Max width for consistency */
    aspect-ratio: 16 / 9; /* Common video aspect ratio */
    background-color: #000;
    margin: 20px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex; /* Use flex to center content */
    justify-content: center;
    align-items: center;
}

#current-slide-image, #current-slide-video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Fit without cropping */
    display: block;
    opacity: 1; /* Default state */
    transition: opacity 1s ease-in-out; /* Fade effect */
    position: absolute; /* Allow overlay on top */
}

/* Navigation Buttons (Prev/Next) */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 2em; /* Bigger for icons */
    transition: background-color 0.3s ease;
    border-radius: 5px;
    z-index: 10;
}

#prevSlide {
    left: 10px;
}

#nextSlide {
    right: 10px;
}

.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Description Overlay */
#description-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 15px;
    box-sizing: border-box;
    text-align: center;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 1;
    transform: translateY(0);
    z-index: 5; /* Below nav buttons */
}

#description-overlay.hidden {
    transform: translateY(100%);
    opacity: 0;
}

#slide-short-description {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    font-weight: bold;
}

#slide-full-description {
    margin: 0;
    font-size: 0.9em;
    display: none; /* Hidden by default, toggled by JS */
    white-space: pre-wrap; /* Preserve whitespace and breaks */
}

/* Slideshow Controls (Top Buttons) */
#slideshowControls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.control-btn {
    background-color: rgba(40, 167, 69, 0.7); /* Greenish background */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    text-wrap: nowrap; /* Prevent text wrapping on smaller buttons */
}

.control-btn:hover {
    background-color: rgba(40, 167, 69, 0.9);
}

/* Thumbnail Container */
#thumbnailContainer {
    width: 100%;
    max-width: 960px; /* Padankan dengan max-width galeri utama */
    overflow-x: auto; /* Benarkan scroll horizontal */
    padding: 10px 0; /* Padding menegak */
    background-color: #f0f0f0; /* Latar belakang untuk bekas thumbnail */
    border-radius: 8px;
    margin-top: 20px; /* Jarak di atas thumbnail */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    white-space: nowrap; /* Pastikan thumbnail tidak melipat */
    display: none; /* Sembunyi secara lalai, akan dipaparkan oleh JS */
}

#thumbnailStrip {
    display: flex; /* Gunakan flexbox untuk menyusun thumbnail */
    gap: 10px; /* Jarak antara thumbnail */
    padding: 5px; /* Padding dalaman untuk jalur thumbnail */
    align-items: center; /* Jajar secara menegak di tengah */
}

.thumbnail-item {
    flex-shrink: 0; /* Elakkan thumbnail mengecil */
    width: 100px; /* Lebar tetap thumbnail */
    height: 75px; /* Tinggi tetap thumbnail (nisbah 4:3 contohnya) */
    border: 2px solid transparent; /* Border lalai */
    border-radius: 5px;
    overflow: hidden; /* Sembunyikan kandungan yang melimpah */
    cursor: pointer;
    transition: all 0.2s ease-in-out; /* Animasi lembut untuk hover/aktif */
    background-color: #ccc; /* Latar belakang placeholder */
    display: flex;
    justify-content: center;
    align-items: center;
}

.thumbnail-item:hover {
    border-color: #007bff; /* Highlight pada hover */
    transform: translateY(-2px); /* Angkat sedikit pada hover */
}

.thumbnail-item.active {
    border-color: #28a745; /* Border hijau untuk thumbnail aktif */
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.5); /* Cahaya hijau */
}

.thumbnail-media {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Pangkas media untuk mengisi ruang, kekalkan nisbah aspek */
    display: block; /* Buang ruang tambahan di bawah imej/video */
}

/* Media Query for smaller screens */
@media (max-width: 768px) {
    #galleryView {
        padding: 15px;
    }

    .album-button {
        padding: 10px 15px;
        font-size: 1em;
        margin: 5px;
    }

    #slideshow-container {
        border-radius: 0;
        box-shadow: none;
        width: 100%;
        margin: 0;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 1.5em; /* Adjusted icon size for smaller screens */
    }

    #slideshowControls {
        top: 5px;
        left: 5px;
        gap: 3px;
    }

    .control-btn {
        padding: 6px 10px;
        font-size: 0.8em;
        min-width: auto; /* Allow buttons to shrink */
        text-wrap: wrap; /* Allow text wrapping for very small buttons */
    }

    #description-overlay {
        padding: 10px;
        font-size: 0.9em;
    }

    #slide-short-description {
        font-size: 1em;
    }

    #slide-full-description {
        font-size: 0.8em;
    }

    #thumbnailContainer {
        padding: 5px 0;
        margin-top: 10px;
    }
    #thumbnailStrip {
        padding: 2px;
        gap: 5px;
    }
    .thumbnail-item {
        width: 80px;
        height: 60px;
    }
}





/* Description Overlay */
#description-overlay {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 100%;
    /*background-color: rgba(0, 0, 0, 0.6);*/
    color: #00ffff;
    padding: 15px;
    box-sizing: border-box;
	text-shadow: 3px 3px 3px #000;
    text-align: center;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0.7;
    transform: translateY(0);
    z-index: 5; /* Below nav buttons */
}

#description-overlay.hidden {
    transform: translateY(100%);
    opacity: 0;
}

#slide-short-description {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    font-weight: bold;
	font-style: italic;
}

#slide-full-description {
    margin: 0;
    font-size: 0.9em;
    display: none; /* Hidden by default, toggled by JS */
    white-space: pre-wrap; /* Preserve whitespace and breaks */
}

