/* style.css */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
    /* Light Theme Colors */
    --primary: #887528;
    --secondary: #f9f9f9;
    --accent: #fdb913;
    --text: #333;
    --background-light: #fffbe0;
    --background-white: #fff;
    --nav-bg: #766b41;
    --nav-hover: #887528;
    --submenu-bg: #e6f0ff;
    --submenu-hover: #cde2ff;
    --footer-bg: #887528;
    --footer-text: white;
    --contact-box-bg: #fffbe0;
    --contact-box-border: #887528;
    --tooltip-bg: #887528;
    --tooltip-text: #fff;
    --carousel-button-bg: rgba(0, 0, 0, 0.5);
    --carousel-button-hover: rgba(0, 0, 0, 0.8);
    --lightbox-bg: rgba(0, 0, 0, 0.9);
    --lightbox-close-btn: white;
    --lightbox-close-btn-hover: #bbb;
    --hero-boxed-bg: #fff;
    --hero-boxed-border: #887528;
    --program-item-bg: #fffbe0;
    --program-item-border: #887528;
    --profil-box-bg: white;
    --profil-box-border: #887528;
    --struktur-box-bg: white;
    --struktur-box-border: #887528;
    --fasilitas-item-border: #887528;

    /* New Lightbox Colors */
    --lightbox-nav-bg: rgba(255, 255, 255, 0.2);
    --lightbox-nav-hover: rgba(255, 255, 255, 0.4);
    --lightbox-preview-border: #ccc;
    --lightbox-preview-active-border: var(--primary);
}

/* Dark Theme Colors */
body[data-theme="dark"] {
    --primary: #fdb913;
    /* A lighter accent for dark mode primary */
    --secondary: #1a1a1a;
    /* Dark background */
    --accent: #887528;
    /* A darker accent for dark mode */
    --text: #e0e0e0;
    /* Light text */
    --background-light: #2a2a2a;
    --background-white: #333;
    --nav-bg: #333;
    --nav-hover: #fdb913;
    --submenu-bg: #444;
    --submenu-hover: #555;
    --footer-bg: #333;
    --footer-text: #e0e0e0;
    --contact-box-bg: #2a2a2a;
    --contact-box-border: #fdb913;
    --tooltip-bg: #fdb913;
    --tooltip-text: #333;
    --carousel-button-bg: rgba(255, 255, 255, 0.3);
    --carousel-button-hover: rgba(255, 255, 255, 0.5);
    --lightbox-bg: rgba(0, 0, 0, 0.9);
    --lightbox-close-btn: #e0e0e0;
    --lightbox-close-btn-hover: #aaa;
    --hero-boxed-bg: #2a2a2a;
    --hero-boxed-border: #fdb913;
    --program-item-bg: #2a2a2a;
    --program-item-border: #fdb913;
    --profil-box-bg: #2a2a2a;
    --profil-box-border: #fdb913;
    --struktur-box-bg: #2a2a2a;
    --struktur-box-border: #fdb913;
    --fasilitas-item-border: #fdb913;

    /* New Lightbox Colors for Dark Theme */
    --lightbox-nav-bg: rgba(0, 0, 0, 0.3);
    --lightbox-nav-hover: rgba(0, 0, 0, 0.5);
    --lightbox-preview-border: #555;
    --lightbox-preview-active-border: var(--primary);
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--secondary);
    /* Use variable */
    color: var(--text);
    /* Use variable */
    height: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Smooth transition */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

header {
    background: var(--primary);
    /* Use variable */
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2rem;
}

header p {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    font-weight: 300;
}

nav {
    background: var(--nav-bg);
    /* Use variable */
}

.highlight {
    text-align: center;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.grid div {
    background: var(--background-light);
    /* Use variable */
    padding: 1rem;
    border-left: 5px solid var(--primary);
    /* Use variable */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

section {
    margin-bottom: 2rem;
}

section h3 {
    color: var(--primary);
    /* Use variable */
}

.cta {
    text-align: center;
}

.cta a {
    color: var(--primary);
    /* Use variable */
    font-weight: bold;
    text-decoration: underline;
}

.cta-wrapper {
    text-align: center;
    margin-top: 1.5rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary);
    /* Use variable */
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: var(--nav-hover);
    /* Use variable */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.hero-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.hero-text {
    flex: 1 1 300px;
}

.hero-image {
    flex: 1 1 300px;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.boxed {
    border: 2px solid var(--hero-boxed-border);
    /* Use variable */
    padding: 1.5rem;
    border-radius: 10px;
    background: var(--hero-boxed-bg);
    /* Use variable */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
}

.info {
    text-align: center;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.program-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--program-item-bg);
    /* Use variable */
    border: 2px solid var(--program-item-border);
    /* Use variable */
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    color: var(--text);
    /* Use variable */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.program-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.program-item img {
    width: 80px;
    height: 80px;
    margin-bottom: 0.5rem;
}

.program-item span {
    font-size: 0.95rem;
    font-weight: 500;
}

@media (max-width: 1024px) {
    .program-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .program-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.contact {
    text-align: center;
    padding: 2rem 1rem;
}

.contact-box {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    border: 2px solid var(--contact-box-border);
    /* Use variable */
    border-radius: 12px;
    background-color: var(--contact-box-bg);
    /* Use variable */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.contact-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.contact-item {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.contact-item img {
    width: 32px;
    height: 32px;
}

.tooltip {
    visibility: hidden;
    background-color: var(--tooltip-bg);
    /* Use variable */
    color: var(--tooltip-text);
    /* Use variable */
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.contact-item:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Carousel styles */
.carousel-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
}

.carousel {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    padding: 10px;
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.carousel-slide:hover {
    transform: scale(1.02);
}

.carousel-slide img {
    width: 100%;
    height: 400px;
    /* Tinggi gambar di carousel */
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--carousel-button-bg);
    /* Use variable */
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.carousel-button:hover {
    background-color: var(--carousel-button-hover);
    /* Use variable */
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

/* Lightbox styles */
.lightbox {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    background-color: var(--lightbox-bg);
    /* Use variable */
    /* Black w/ opacity */
    text-align: center;
    flex-direction: column;
    /* Arrange content vertically */
    justify-content: center;
    /* Center vertically */
    align-items: center;
    /* Center horizontally */
    padding: 20px;
    /* Add some padding */
    box-sizing: border-box;
    /* Include padding in width/height */
}

.lightbox-content-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 900px;
    /* Max width for the main image area */
    margin-bottom: 20px;
    /* Space between main image and previews */
}

.lightbox-content {
    max-width: 100%;
    max-height: 70vh;
    /* Adjust height to leave space for previews */
    display: block;
    border-radius: 8px;
    object-fit: contain;
    /* Ensure image fits without cropping */
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    /* Penting untuk menghilangkan spasi ekstra di bawah gambar */
    margin: auto;
    /* Pusatkan gambar di dalam lightbox-content jika ada ruang lebih */
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--lightbox-nav-bg);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.lightbox-nav:hover {
    background-color: var(--lightbox-nav-hover);
}

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

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

.close-btn {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--lightbox-close-btn);
    /* Use variable */
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
    /* Ensure it's above other lightbox elements */
}

.close-btn:hover,
.close-btn:focus {
    color: var(--lightbox-close-btn-hover);
    /* Use variable */
    text-decoration: none;
    cursor: pointer;
}

/* Lightbox Preview Styles */
.lightbox-preview-container {
    width: 100%;
    max-width: 900px;
    /* Match main image width */
    overflow-x: auto;
    /* Enable horizontal scrolling for previews */
    white-space: nowrap;
    /* Prevent thumbnails from wrapping */
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    scrollbar-width: none;
    /* Hide scrollbar for Firefox */
    -ms-overflow-style: none;
    /* Hide scrollbar for IE and Edge */
}

.lightbox-preview-container::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome, Safari, and Opera */
}

.lightbox-preview-carousel {
    display: inline-flex;
    /* Allow thumbnails to be on one line */
    gap: 10px;
    /* Space between thumbnails */
    padding: 5px;
    /* Padding around thumbnails */
}

.lightbox-preview-thumbnail {
    width: 80px;
    /* Fixed width for thumbnails */
    height: 60px;
    /* Fixed height for thumbnails */
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid var(--lightbox-preview-border);
    transition: border-color 0.3s, transform 0.2s;
}

.lightbox-preview-thumbnail:hover {
    transform: scale(1.05);
}

.lightbox-preview-thumbnail.active {
    border-color: var(--lightbox-preview-active-border);
    box-shadow: 0 0 5px var(--lightbox-preview-active-border);
}


.profil-section {
    background: var(--background-light);
    /* Use variable */
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.profil-box {
    background: var(--profil-box-bg);
    /* Use variable */
    border: 2px solid var(--profil-box-border);
    /* Use variable */
    border-radius: 12px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.profil-box h2 {
    text-align: center;
    color: var(--primary);
    /* Use variable */
    margin-top: 1.5rem;
}

.profil-box ul {
    padding-left: 1.2rem;
    margin-top: 0.5rem;
}

.profil-box ul li {
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

.profil-box p {
    line-height: 1.6;
}

.struktur-section {
    background: var(--background-light);
    /* Use variable */
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.struktur-box {
    background: var(--struktur-box-bg);
    /* Use variable */
    border: 2px solid var(--struktur-box-border);
    /* Use variable */
    border-radius: 12px;
    padding: 2rem;
    max-width: 1000px;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.org-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.org-image-wrapper:hover .org-image {
    transform: scale(1.05);
}

.org-image {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

/* Lightbox for Struktur Organisasi (reusing existing .lightbox class) */
/* Ensure this lightbox is distinct from the gallery lightbox if needed, or adjust its usage */
/* The existing .lightbox class is already defined above, so no need to redefine it here. */


.fasilitas-section {
    background: var(--background-light);
    /* Use variable */
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.fasilitas-box {
    max-width: 1000px;
    width: 100%;
    text-align: center;
}

.fasilitas-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.fasilitas-item {
    width: 160px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.3s;
}

.fasilitas-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--fasilitas-item-border);
    /* Use variable */
}

.fasilitas-item:hover {
    transform: scale(1.05);
}

.fasilitas-item span {
    display: block;
    margin-top: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Video Section Styles */
.video-section {
    text-align: center;
    /* Ini sudah ada, memastikan teks di tengah */
    margin-bottom: 2rem;
}

.video-section h3 {
    color: var(--primary);
    /* Use variable */
    margin-bottom: 1.5rem;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 30%;
    /* 16:9 Aspect Ratio (height / width = 9 / 16 = 0.5625) */
    height: 0;
    overflow: hidden;
    background: #000;
    /* Background for loading or if video fails */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    /* Mengatur lebar maksimum video agar tidak terlalu besar */
    margin: 0 auto;
    /* Ini yang membuat video di tengah */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .video-container {
        padding-bottom: 75%;
        /* Mengubah rasio aspek menjadi 4:3 untuk layar yang lebih kecil agar video terlihat lebih besar secara vertikal */
    }
}

/*Test*/
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo img {
    height: 60px;
    padding: 0.5rem 0;
}

.nav-text {
    color: white;
    line-height: 1.2;
}

.nav-text .title {
    font-weight: 600;
}

.nav-text .subtitle {
    font-size: 0.9rem;
    font-weight: 400;
}

.menu-toggle {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: white;
    padding: 1rem;
    cursor: pointer;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    padding: 1rem 1.2rem;
    display: block;
    color: white;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.nav-menu>li:hover>a {
    background: var(--nav-hover);
    /* Use variable */
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--submenu-bg);
    /* Use variable */
    min-width: 200px;
    z-index: 1000;
    border-radius: 0 0 6px 6px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.submenu li a {
    color: var(--primary);
    /* Use variable */
    padding: 0.75rem 1rem;
}

.submenu li a:hover {
    background: var(--submenu-hover);
    /* Use variable */
}

.nav-menu li:hover .submenu {
    display: block;
}

.container {
    padding: 2rem;
}

.section {
    display: none;
}

.active {
    display: block;
}

footer {
    background: var(--footer-bg);
    /* Use variable */
    color: var(--footer-text);
    /* Use variable */
    text-align: center;
    padding: 1rem;
}

footer p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

/* Theme Switcher Styles */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    /* Remove margin-left: auto; and margin-right: 1rem; */
    /* These will be handled by the parent li and flexbox */
    padding: 1rem 1.2rem;
    /* Match padding of other nav items */
    height: 100%;
    /* Ensure it takes full height of li */
    box-sizing: border-box;
    /* Include padding in height calculation */
}

.theme-switch {
    display: none;
    /* Hide the actual checkbox */
}

.theme-switch-label {
    width: 55px;
    /* Increased width to accommodate "Mode" text */
    height: 30px;
    background-color: #ccc;
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    box-sizing: border-box;
    color: white;
    /* Color for "Mode" text */
}

.theme-switch-label .mode-text {
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 5px;
    /* Space between text and icons */
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.theme-switch-label .icon {
    font-size: 1.2rem;
    position: absolute;
    transition: opacity 0.3s;
}

.theme-switch-label .sun {
    color: #000000;
    /* Sun color */
    left: 35px;
    /* Adjusted position to make space for "Mode" */
    opacity: 1;
}

.theme-switch-label .moon {
    color: #e0e0e0;
    /* Moon color */
    right: 30px;
    opacity: 0;
}

.theme-switch-label::after {
    content: '';
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    left: 1px;
    /* Adjusted initial position for slider */
    transition: transform 0.3s, background-color 0.3s;
}

/* Checked state (Dark Mode) */
.theme-switch:checked+.theme-switch-label {
    background-color: #555;
    /* Darker background for dark mode */
}

.theme-switch:checked+.theme-switch-label::after {
    transform: translateX(30px);
    /* Move slider to the right */
    background-color: #fdb913;
    /* Slider color in dark mode */
}

.theme-switch:checked+.theme-switch-label .sun {
    opacity: 0;
}

.theme-switch:checked+.theme-switch-label .moon {
    opacity: 1;
}


@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        display: none;
        background: var(--nav-bg);
        /* Use variable */
        align-items: center;
        text-align: center;
    }

    .nav-menu.show {
        display: flex;
    }

    .submenu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        background: var(--background-light);
        /* Use variable */
        display: none;
    }

    .nav-menu li:hover>.submenu {
        display: block;
    }

    .submenu li a {
        text-align: center;
    }

    .nav-container {
        flex-direction: column;
        align-items: center;
        padding: 0 1rem;
    }

    .nav-logo {
        width: 100%;
        flex-direction: column;
        align-items: center;
    }

    .nav-text {
        text-align: center;
    }

    .menu-toggle {
        margin-left: auto;
    }

    .theme-switch-wrapper {
        margin: 1rem 0;
        /* Adjust margin for mobile */
        /* order: -1; REMOVE THIS LINE */
        /* Place it above logo on mobile */
        width: auto;
        /* Reset width for mobile */
        padding: 0;
        /* Reset padding for mobile */
    }

    .theme-switch-label {
        width: 55;
        /* Keep width for mobile */
        justify-content: flex-start;
        /* Align items to start for mobile */
    }

    .theme-switch-label .mode-text {
        position: static;
        /* Reset position for mobile */
        transform: none;
        /* Reset transform for mobile */
        margin-right: 10px;
        /* Add space for mobile */
    }

    .theme-switch-label .sun {
        left: auto;
        /* Reset left for mobile */
        position: static;
        /* Reset position for mobile */
    }

    .theme-switch-label .moon {
        right: auto;
        /* Reset right for mobile */
        position: static;
        /* Reset position for mobile */
        margin-left: 8px;
        /* Add space between icons for mobile */
    }

    .theme-switch-label::after {
        left: 1px;
        /* Reset slider position for mobile */
        transform: none;
        /* Reset transform for mobile */
    }

    .theme-switch:checked+.theme-switch-label::after {
        transform: translateX(30px);
        /* Keep slider movement for mobile */
    }
}