/* ==================== LOADING SCREEN ==================== */
#loading-screen {
    position: fixed;
    inset: 0;
    background: #0f172a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.loader-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: loader-pulse 1.8s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes loader-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 165, 241, 0.3); transform: scale(1); }
    50% { box-shadow: 0 0 50px rgba(24, 97, 165, 0.7); transform: scale(1.06); }
}

.loader-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #fff;
    text-shadow: 0 0 20px rgba(99,102,241,0.6);
}

.loader-bar-wrapper {
    width: 220px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    width: 0%;
    background-color: #3793e9;
    border-radius: 99px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(99,102,241,0.6);
}

.loader-percent {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background: #0f172a;
    color: white;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

/* Lazy Loading Styles */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Placeholder for images while loading */
img[loading="lazy"]:not(.loaded) {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

section {
    padding: 60px 20px;
}

.hero {
    min-height: 100vh;
}

.glh2{
    font-size: 32px;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.glh2.show {
    opacity: 1;
    transform: translateY(0);
}

.glh2.hide {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.title {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    color: white
}

.title.show {
    opacity: 1;
    transform: translateY(0);
}

.title.hide {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}




.title.show {
    opacity: 1;
    transform: translateY(0);
}



/* ==================== NAVBAR ==================== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    box-sizing: border-box;
    padding: 8px clamp(12px, 4vw, 40px);
}

/* ==================== PILL NAVBAR ==================== */
.pill-nav {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 680px;
    background: rgba(20, 28, 48, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50px;
    padding: 5px 6px;
    gap: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    z-index: 1100;
    opacity: 1;
    pointer-events: all;
    backdrop-filter: blur(10px);
}

.pill-nav-indicator {
    position: absolute;
    top: 6px;
    left: 6px;
    height: calc(100% - 12px);
    background: #fff;
    border-radius: 50px;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    pointer-events: none;
    opacity: 0;
}

.pill-nav-link {
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: clamp(11px, 1.4vw, 14px);
    font-weight: 600;
    padding: 10px clamp(8px, 2vw, 22px);
    border-radius: 50px;
    letter-spacing: 0.3px;
    transition: color 0.25s ease;
    white-space: nowrap;
}

.pill-nav-link.active-link {
    color: #0f172a;
}


/* Logo di dalam pill-nav */
#navLogo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0 10px 0 4px;
    margin-right: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.logo img {
    height: 34px;
    width: 34px;
    object-fit: cover;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.18);
    display: block;
}

/* Container constraints */
.atas {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.isi {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}



/* ==================== SECTION BASE ==================== */
section:not(#gallery) {
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 60px 20px;
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

section:not(#gallery).show {
    opacity: 1;
    transform: translateY(0);
}

section:not(#gallery).hide {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Gallery section punya aturan sendiri */
#gallery {
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 50px 20px 40px 20px;
    text-align: center;
    width: 100%;
    max-width: 100vw;
    overflow: visible;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

#gallery.show {
    opacity: 1;
    transform: translateY(0);
}

#gallery.hide {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}



/* ==================== HERO SECTION ==================== */
.hero {
    background-image: url(image/bg.jpeg);
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #ffffff, 0 0 30px #ffffff;
}

.hero h1 {
    font-size: 52px;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #ffffff, 0 0 30px #ffffff;
}

.hero p {
    max-width: 600px;
    opacity: 0.7;
}


/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 10px 24px;
    background: #1e293b;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.tab-btn.active {
    background: #38bdf8;
    color: black;
    transform: scale(1.05);
}

.tab-content {
    max-width: 600px;
    display: none;
    animation: fade 0.4s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==================== STRUCTURE SECTION ==================== */
.structure-section {
    min-height: auto;
    padding: 60px 20px 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.structure-section h2 {
    font-size: 28px;
    margin-bottom: 40px;
    position: relative;
}

.structure-section h2::after {
    content: "";
    width: 120px;
    height: 2px;
    background: white;
    display: block;
    margin: 10px auto 0;
}

.org-section {
    padding: 40px 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* ==================== TAB SWITCHER ==================== */
.tab-switcher {
    position: relative;
    display: inline-flex;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50px;
    padding: 5px;
    margin-bottom: 50px;
    gap: 0;
    backdrop-filter: blur(10px);
}

.tab-switch-btn {
    position: relative;
    z-index: 2;
    padding: 12px 32px;
    background: transparent;
    border: none;
    border-radius: 50px;
    color: rgba(255,255,255,0.6);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tab-switch-btn.active {
    color: #0f172a;
}

.tab-switch-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    height: calc(100% - 10px);
    background: #fff;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* ==================== TAB PANELS ==================== */
.tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    width: 100%;
}

.tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.tab-panel.animating {
    display: block;
}

/* ==================== SCHEDULE & PIKET HARIAN ==================== */
.schedule-piket-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}


.schedule-day-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 4px;
}

/* Schedule & Piket Blocks */
.schedule-block,
.piket-block {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
}

.piket-day-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    padding: 20px 0 16px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Shared Table Style */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.schedule-table tr {
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transition: background 0.2s ease;
}

.schedule-table tr:last-child {
    border-bottom: none;
}

.schedule-table tr:hover {
    background: rgba(255,255,255,0.04);
}

/* Schedule: subject left, time right */
.schedule-table td {
    padding: 14px 20px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
}

/* Schedule: subject left, jam right */
.schedule-table td:first-child {
    font-weight: 600;
    text-align: left;
}

.schedule-table td:last-child {
    text-align: right;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    white-space: nowrap;
    width: 70px;
}

/* Piket: names centered */
.piket-block .schedule-table td {
    text-align: left;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    padding-left: 32px;
}

.piket-num {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    margin-right: 4px;
}

.libur-row {
    text-align: center;
    color: rgba(255,255,255,0.35);
    font-style: italic;
    padding: 40px 20px !important;
    font-size: 16px;
    letter-spacing: 1px;
}

.piket-crossed {
    text-decoration: line-through;
    color: rgba(255,255,255,0.35);
}

/* Highlight row for "Istirahat" */
.schedule-table tr.istirahat-row td {
    color: rgba(255,255,255,0.35);
    font-style: italic;
    font-size: 13px;
}

/* Fade animation on day change */
.schedule-fade-out {
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.schedule-fade-in {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s;
}

/* Today badge */
.today-badge {
    display: inline-block;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    color: #0f172a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 10px;
    vertical-align: middle;
}

@media (max-width: 480px) {
    .schedule-piket-wrapper {
        max-width: 100%;
    }
    .schedule-day-title {
        font-size: 22px;
        min-width: 130px;
    }
    .schedule-table td {
        padding: 12px 14px;
        font-size: 13px;
    }
    .piket-day-title {
        font-size: 18px;
        padding: 16px 0 12px;
    }
}

/* ==================== ORG TREE ==================== */
.org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 10px 16px 30px; /* padding kiri kanan agar tidak mepet tepi */
    box-sizing: border-box;
}

/* ── Wali level: card full width di mobile ── */
.wali-level .card {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

/* ── Node (label + card) ── */
.ot-node {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ot-label {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ── Card ── */
.card {
    background: #f1f1f1;
    color: #111;
    padding: 10px 28px;
    border-radius: 50px;
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    cursor: pointer;
    text-align: center;
    transform: translateY(30px);
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
    white-space: normal;
    word-break: break-word;
}

.card.show {
    transform: translateY(0);
    opacity: 1;
}

.card.hide {
    transform: translateY(30px);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.card:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.card.show:hover {
    transform: translateY(-2px);
}

.role {
    font-size: 12px;
    color: #888;
    font-weight: 600;
}

.name {
    font-size: 14px;
    font-weight: 700;
}

/* ── Garis vertikal ── */
.ot-line-v {
    width: 2px;
    height: 40px;
    background: rgba(255,255,255,0.5);
    flex-shrink: 0;
}

.ot-line-v.short {
    height: 16px;
}

/* ── T-junction (garis horizontal bercabang) ── */
.ot-t-row {
    display: flex;
    width: 60%;
    max-width: 320px;
    height: 2px;
    position: relative;
}

.ot-t-left,
.ot-t-right {
    flex: 1;
    background: rgba(255,255,255,0.5);
}

/* ── Row: baris horizontal ── */
.ot-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

/* Row dua kolom */
.ot-double {
    justify-content: space-around;
    max-width: 460px;
    width: 100%;
}

/* ── Kolom ── */
.ot-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Kolom yang card-nya vertikal (sekretaris & bendahara) */
.ot-stack {
    gap: 0;
}

/* ==================== RESPONSIVE MOBILE ==================== */
@media (max-width: 520px) {
    .org-tree {
        max-width: 100%;
    }

    .ot-double {
        max-width: 100%;
        justify-content: space-around;
    }

    .ot-t-row {
        width: 72%;
    }

    .card {
        min-width: 130px;
        max-width: 130px;
        width: 130px;
        padding: 9px 14px;
        font-size: 12px;
    }

    /* Wali kelas card sama besar di mobile */
    .wali-level .card {
        min-width: 130px;
        max-width: 130px;
        width: 130px;
    }

    .name {
        font-size: 12px;
    }

    .ot-label {
        font-size: 11px;
    }
}


/* ==================== MODAL ==================== */
.modal {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    overflow-y: auto;
    backdrop-filter: blur(10px);
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;

    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: grid;
    place-items: center;
    z-index: 999999;

}

.modal.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.modal-box img {
    max-width: 90%;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    display: block;
    
    
}

.modal.active .modal-box img {
    transform: scale(1);
}

.modal-info {
    background: white;
    padding: 20px 40px;
    border-radius: 15px;
    text-align: center;
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease 0.2s;
}

.modal.active .modal-info {
    transform: translateY(0);
    opacity: 1;
}

.modal-name {
    color: black;
    font-weight: bold;
    font-size: 24px;
    margin: 0;
}

.modal-role {
    color: #666;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}

.modal-img {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    animation: zoom 0.3s ease;
}

@keyframes zoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000;
    line-height: 1;
    transition: transform 0.3s ease;
}

.close:hover {
    transform: scale(1.1);
}


/* ==================== STUDENTS SECTION ==================== */
#students {
    padding: 80px 20px 120px;
    
    overflow: hidden;
    position: relative;
}

.students-title {
    text-align: center;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 50px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    transform: translateY(-30px);
    transition: all 0.8s ease;
}

#students.show .students-title {
    opacity: 1;
    transform: translateY(0);
}

.students-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    cursor: grab;
}

.students-container::-webkit-scrollbar {
    display: none;
}

.students-container.grabbing {
    cursor: grabbing;
}

.students-wrapper {
    display: flex;
    gap: 20px;
    width: max-content;
    padding: 0 10px;
}

.student-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.student-card.show {
    opacity: 1;
    transform: translateY(0);
}

.student-card.hide {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.student-card:hover {
    transform: translateY(-10px);
}

.student-card.show:hover {
    transform: translateY(-10px);
}

/* Polaroid Effect Wrapper */
.student-card-image-wrapper {
    min-width: 200px;
    width: 200px;
    height: 310px; /* tinggi FIXED agar semua sama */
    background: #fff;
    border-radius: 3px;
    padding: 12px 12px 0px 12px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.15),
        0 16px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.student-card:hover .student-card-image-wrapper {
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.15),
        0 16px 32px rgba(0, 0, 0, 0.2),
        0 32px 64px rgba(0, 0, 0, 0.25);
    transform: scale(1.05) rotateZ(2deg);
}

.student-card-image {
    width: 176px;
    height: 220px;
    object-fit: cover;
    object-position: center top;
    position: relative;
    z-index: 1;
    border-radius: 2px;
    display: block;
    flex-shrink: 0;
}

.student-card-name-wrapper {
    text-align: center;
    padding: 10px 4px 14px 4px;
    flex: 1; /* isi sisa ruang agar semua nama rata bawah */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.student-name {
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
    line-height: 1.3;
    padding: 0 8px;
    font-family: 'arial black', sans-serif;
    overflow: hidden;
    word-break: break-word;
}

/* Students Dots Navigation */
.students-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
    padding: 20px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease 0.3s;
}

#students.show .students-dots {
    opacity: 1;
    transform: translateY(0);
}

.students-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.students-dots .dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.students-dots .dot.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #fff;
    transform: scale(1.3);
}

/* Student Modal - Polaroid Style */
.student-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.student-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    opacity: 1;
}

.student-modal-box {
    background: #fff;
    padding: 14px 14px 32px 14px;
    border-radius: 5px;
    max-width: 210px;
    width: 55%;
    text-align: center;
    transform: scale(0.5) translateY(-50px) rotateX(20deg) rotateZ(-5deg);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 30px 90px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.student-modal.active .student-modal-box {
    transform: scale(1) translateY(0) rotateX(0deg) rotateZ(0deg);
    opacity: 1;
}

.student-modal-box img {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.student-modal-info {
    color: #333;
    position: relative;
    z-index: 1;
    margin-top: 20px;
    width: 100%;
}

.student-modal-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: #333;
    letter-spacing: 1px;
    animation: fadeInUp 0.6s ease 0.2s both;
    font-family: 'arial black', sans-serif;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.student-close {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10001;
    line-height: 1;
    font-weight: 300;
    transform: rotate(0deg);
}

.student-close:hover {
    color: #fff;
    transform: rotate(90deg) scale(1.2);
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
}

/* Responsive Students */
@media (max-width: 768px) {
    .students-title {
        font-size: 2rem;
    }
    
    .student-card {
        gap: 8px;
    }
    
    .student-card-image-wrapper {
        min-width: 155px;
        width: 155px;
        height: 248px; /* fixed height mobile */
        padding: 10px 10px 0px 10px;
        gap: 0;
    }
    
    .student-card-image {
        width: 135px;
        height: 170px;
    }
    
    .student-card-name-wrapper {
        padding: 8px 4px 12px 4px;
        flex: 1;
    }
    
    .student-name {
        font-size: 0.85rem;
    }
    
    .students-dots .dot {
        width: 10px;
        height: 10px;
    }
    
    .student-modal-box {
        padding: 12px 12px 30px 12px;
        max-width: 65%;
        width: 65%;
    }
    
    .student-modal-box img {
        max-width: 100%;
        width: 100%;
    }
    
    .student-modal-info {
        margin-top: 15px;
    }
    
    .student-modal-name {
        font-size: 1.4rem;
    }
    
    .student-close {
        top: 15px;
        right: 20px;
        font-size: 2.8rem;
    }
}

@media (max-width: 480px) {
    .student-card {
        gap: 6px;
    }
    
    .student-card-image-wrapper {
        min-width: 130px;
        width: 130px;
        height: 210px; /* fixed height small mobile */
        padding: 8px 8px 0px 8px;
        gap: 0;
    }
    
    .student-card-image {
        width: 114px;
        height: 143px;
    }
    
    .student-card-name-wrapper {
        padding: 7px 3px 10px 3px;
        flex: 1;
    }
    
    .student-name {
        font-size: 0.75rem;
    }
    
    .student-modal-box {
        padding: 10px 10px 28px 10px;
        max-width: 70%;
        width: 70%;
    }
    
    .student-modal-box img {
        max-width: 100%;
        width: 100%;
    }
    
    .student-modal-info {
        margin-top: 12px;
    }
    
    .student-modal-name {
        font-size: 1.2rem;
    }
    
    .student-close {
        top: 10px;
        right: 15px;
        font-size: 2.5rem;
    }
}

@media (max-width: 360px) {
    .student-modal-box {
        padding: 8px 8px 24px 8px;
        max-width: 75%;
        width: 75%;
    }
    
    .student-modal-info {
        margin-top: 10px;
    }
    
    .student-modal-name {
        font-size: 1.1rem;
    }
}

/* ==================== GALLERY SECTION ==================== */
.gallery-section {
    background: linear-gradient(180deg, #1c1c1c, #2a003f);
    padding: 60px 0 40px 0;
    text-align: center;
    color: white;
    font-family: sans-serif;
}

.gallery-section h2 {
    font-size: 32px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Slider Container */
.slider {
    position: relative;
    width: 100%;
    max-width: 1100px;
    height: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    /* Slider selalu tampil — visibility dikontrol oleh parent section */
}

.slides {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 1000px;
    cursor: grab;
    touch-action: pan-y; /* Izinkan scroll vertikal, hanya tangkap swipe horizontal */
}

/* Slide Styling */
.slide {
    position: absolute;
    width: 32%;
    max-width: 340px;
    height: auto;
    aspect-ratio: 3 / 4;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    z-index: 0;
    filter: blur(4px) brightness(0.6);
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    cursor: zoom-in;
}

/* Active Slide */
.slide.active {
    opacity: 1;
    z-index: 10;
    transform: translate(-50%, -50%) scale(1.1);
    filter: blur(0) brightness(1);
}

/* Side Slides */
.slide.prev-slide {
    opacity: 0.5;
    z-index: 5;
    transform: translate(-50%, -50%) translateX(-70%) scale(0.8);
}

.slide.next-slide {
    opacity: 0.5;
    z-index: 5;
    transform: translate(-50%, -50%) translateX(70%) scale(0.8);
}

.katag {
    font-size: 32px;
    margin-bottom: 40px;
    opacity: 0.9;
}


/* ==================== LIGHTBOX ==================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s ease;
    backdrop-filter: blur(12px);
    cursor: zoom-out;
}

.lightbox.active {
    visibility: visible;
    opacity: 1;
}

/* Lightbox image: tampil dengan rasio asli gambar */
#lightboxImg {
    max-width: 92vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 
        0 0 0 1px rgba(255,255,255,0.08),
        0 30px 80px rgba(0, 0, 0, 0.9),
        0 0 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.82);
    transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    /* object-fit: contain untuk menjaga rasio asli */
    object-fit: contain;
    cursor: default;
}

.lightbox.active #lightboxImg {
    transform: scale(1);
}

/* Close button untuk lightbox */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 2.8rem;
    cursor: pointer;
    z-index: 100000;
    line-height: 1;
    font-weight: 300;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.lightbox-close:hover {
    color: #fff;
    transform: rotate(90deg) scale(1.15);
}

/* Hint rasio asli */
.lightbox-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease 0.3s;
}

.lightbox.active .lightbox-hint {
    opacity: 1;
}


/* ==================== DOTS ==================== */
.dots {
    text-align: center;
    margin-top: 15px;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 5px;
    background: #bbb;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: #333;
    transform: scale(1.3);
}


/* ==================== BEFORE/AFTER COMPARISON ==================== */
.before-after {
    width: 90%;
    max-width: 900px;
    margin: 40px auto;
}

.ba-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    perspective: 1000px;
}

.ba-img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.ba-after-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    overflow: hidden;
    z-index: 2;
    transition: width 0.12s linear;
}

.ba-after {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    filter: blur(6px);
    transition: all 0.6s cubic-bezier(.2, .9, .2, 1);
}

section#gallery.show .ba-after {
    opacity: 1;
    transform: none;
    filter: none;
}

.ba-handle {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: 36px;
    z-index: 3;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.ba-handle-line {
    width: 4px;
    height: 60%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.25);
    border-radius: 2px;
}

.ba-after::before {
    content: "";
    position: absolute;
    right: -10px;
    top: 0;
    bottom: 0;
    width: 30px;
    box-shadow: inset -20px 0 30px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}


/* ==================== FOOTER ==================== */
footer {
    padding: 40px;
    text-align: center;
    background: #0b1220;
    opacity: 0.6;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin-top: 100px;
}

.footer {
    color: white;
    padding: 40px 0;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

.footer-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
}

.footer-col {
    flex: 1;
    min-width: 200px;
    margin: 20px 0;
    width: 550px;
    max-width: 90%;
    height: auto;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.footer-col.show {
    opacity: 1;
    transform: translateY(0);
}

.footer-col.hide {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.footer-logo {
    width: 80px;
    border-radius: 50%;
}

.footer-col h5 {
    margin-bottom: 15px;
    font-weight: bold;
}

.footer-col p {
    margin: 5px 0;
    color: #cfcfcf;
}

.center-text h2 {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 2px;
    padding-right: 9%;
}

.footer a {
    text-decoration: none;
    color: #cfcfcf;
    transition: 0.3s;
}

.footer a:hover {
    color: white;
}

hr {
    margin: 30px auto;
    width: 80%;
    border: 0.5px solid #888;
}

copyright {
    font-size: 6px;
    color: #ccc;
    padding-bottom: 10px;
    padding-right: 50%;
}

/* ==================== MEDIA QUERIES ==================== */
@media (max-width:768px){
  
  /* Navbar Mobile */
  nav {
    height: 52px;
    padding: 6px clamp(8px, 3vw, 16px);
  }

  #navLogo {
    padding: 0 8px 0 2px;
    margin-right: 2px;
  }

  #navLogo img,
  .logo img {
    height: 28px;
    width: 28px;
  }

  .pill-nav-link {
    font-size: 12px;
    padding: 9px 10px;
  }

  /* Hero Section Mobile */
  .hero {
    padding-top: 80px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero h1 {
    font-size: 32px;
    margin-bottom: 10px;
  }

  .hero h3 {
    font-size: 18px;
  }

  /* Modal Mobile */
  .modal-box img{
    max-width: 95%;
    max-height: 70vh;
  }
  
  .modal-info {
    padding: 15px 25px;
    margin-top: 15px;
  }
  
  .modal-name {
    font-size: 18px;
  }
  
  .modal-role {
    font-size: 11px;
  }

  .close {
    top: 15px;
    right: 20px;
    font-size: 32px;
  }

  /* Gallery Mobile */
  #gallery {
    padding: 30px 15px;
    min-height: auto;
  }

  .slider {
    max-width: 100%;
    height: 380px;
    padding: 0 10px;
  }

  .slide {
    width: 52%;
  }

  .slide img {
    border-radius: 10px;
  }

  .glh2 {
    font-size: 22px;
    margin-bottom: 20px;
  }

  /* Footer Mobile */
  .footer {
    padding: 10px 5px;
  }

  .footer-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
  }

  .footer-col {
    flex: 1;
    min-width: 120px;
    text-align: center;
    margin: 2px 2px;
  }

  .footer-col h5 {
    font-size: 10px;
    margin-bottom: 3px;
  }

  .footer-col p {
    font-size: 9px;
    margin: 1px 0;
  }

  .center-text h2 {
    padding-right: 0;
    font-size: 16px;
  }

  .footer-logo {
    width: 40px;
  }

  hr {
    margin: 8px auto;
  }

  .copyright {
    font-size: 9px;
    padding-bottom: 2px;
  }
}

/* Extra Small Devices */
@media (max-width: 480px) {
  
  nav {
    height: 48px;
    padding: 5px 8px;
  }

  #navLogo img,
  .logo img {
    height: 24px;
    width: 24px;
  }

  #navLogo {
    padding: 0 6px 0 2px;
    margin-right: 2px;
  }

  .pill-nav-link {
    font-size: 10px;
    padding: 8px 6px;
    letter-spacing: 0;
  }

  .hero {
    padding-top: 70px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .hero h3 {
    font-size: 16px;
  }

  .card {
    max-width: 135px;
    min-width: 115px;
    padding: 8px 10px;
  }

  .role {
    font-size: 10px;
  }

  .name {
    font-size: 11px;
  }

  .structure-section h2,
  .title {
    font-size: 18px;
  }

  .slider {
    height: 320px;
  }

  .glh2 {
    font-size: 18px;
  }

  .modal-box img {
    max-width: 100%;
    max-height: 60vh;
  }

  .footer {
    padding: 8px 5px;
  }

  .footer-container {
    gap: 2px;
  }

  .footer-col {
    min-width: 100px;
    margin: 1px 1px;
  }

  .footer-col h5 {
    font-size: 8px;
    margin-bottom: 2px;
  }

  .footer-col p {
    font-size: 7px;
    margin: 0;
  }

  .center-text h2 {
    font-size: 12px;
    letter-spacing: 0.5px;
  }

  .footer-logo {
    width: 30px;
  }

  hr {
    margin: 5px auto;
  }

  .copyright {
    font-size: 7px;
    padding-bottom: 2px;
  }
}

/* ==================== IMAGE LOADING FIX ==================== */

/* Lightbox image - loading state */
#lightboxImg {
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#lightboxImg.loaded {
    opacity: 1;
}

/* Structure modal image */
.modal img {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal img.loaded {
    opacity: 1;
}

/* Student modal image */
.student-modal-box img {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.student-modal-box img.loaded {
    opacity: 1;
}
