/* --- Global Styles --- */
:root {
    --primary-blue: #87CEEB; /* Biru muda */
    --secondary-yellow: #FFD700; /* Kuning cerah */
    --accent-white: #FFFFFF;
    --text-dark: #333;
    --text-light: #f0f0f0;
    --card-bg: rgba(255, 255, 255, 0.9);
    --transition-speed: 0.5s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif; /* Font ceria */
    background: url('smp_bg.png') repeat; /* Gambar background tema SMP */
    background-size: 200px; /* Ukuran ornamen */
    background-color: var(--primary-blue);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden; /* Mencegah scroll horizontal */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hidden {
    display: none !important;
}

.page-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 0; /* Padding agar tidak terlalu mepet navbar */
    opacity: 0; /* Awalnya tersembunyi untuk transisi */
    transform: translateY(20px); /* Efek slide-in */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.page-section.active {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 2.8em;
    color: var(--text-dark);
    margin-bottom: 40px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    position: relative;
    padding-bottom: 10px;
}
.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary-yellow);
    border-radius: 2px;
}

/* --- `Loading Entrance Page` --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-yellow));
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    color: var(--accent-white);
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-animation {
    width: 100px;
    height: 70px;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.book-animation .page {
    position: absolute;
    width: 50px;
    height: 70px;
    background: var(--accent-white);
    border: 1px solid rgba(0,0,0,0.1);
    transform-origin: left center;
    animation: turnPage 2s infinite ease-in-out;
}

.book-animation .page:nth-child(1) { animation-delay: 0s; z-index: 3; }
.book-animation .page:nth-child(2) { animation-delay: 0.2s; z-index: 2; }
.book-animation .page:nth-child(3) { animation-delay: 0.4s; z-index: 1; }

@keyframes turnPage {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(-180deg); }
    100% { transform: rotateY(-180deg); }
}

#loading-screen p {
    margin-top: 20px;
    font-size: 1.2em;
}

/* --- `Start Page` --- */
#start-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('smp_bg_full.png') no-repeat center center / cover; /* Background SMP-style */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9998; /* Di bawah loading screen */
    color: var(--accent-white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.start-content {
    text-align: center;
    background-color: rgba(0,0,0,0.4);
    padding: 30px 50px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

#typing-text {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 30px;
    overflow: hidden; /* Untuk efek typing */
    border-right: .15em solid orange; /* Kursor typing */
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: orange }
}

#start-button {
    padding: 15px 30px;
    font-size: 1.5em;
    background-color: var(--secondary-yellow);
    color: var(--text-dark);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#start-button:hover {
    transform: translateY(-5px) scale(1.05);
    background-color: #FFEA00;
}

/* --- `Navbar` --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(var(--primary-blue), 0.95);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: background-color 0.3s ease, padding 0.3s ease;
}

#navbar.sticky {
    background-color: rgba(var(--primary-blue), 1);
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--accent-white);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: var(--accent-white);
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background-color: var(--secondary-yellow);
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--secondary-yellow);
}

/* `Hamburger Menu` */
.hamburger {
    display: none; /* Sembunyikan di desktop */
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    z-index: 1001;
}

.hamburger div {
    width: 30px;
    height: 3px;
    background-color: var(--accent-white);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-links.open {
    transform: translateX(0);
}

.hamburger.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.hamburger.toggle .line2 {
    opacity: 0;
}
.hamburger.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* --- `Home Page` --- */
#home {
    background: url('smp_ornament_1.png') no-repeat top left / 150px,
                url('smp_ornament_2.png') no-repeat bottom right / 180px;
    background-color: var(--primary-blue); /* Warna dasar untuk section */
}

.profile-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    text-align: center;
    max-width: 800px;
    transition: transform 0.3s ease;
}
.profile-card:hover {
    transform: translateY(-5px);
}

.profile-card h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 1.8em;
}
.profile-card p {
    font-size: 1.1em;
    color: var(--text-dark);
}

.social-media-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.social-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    width: 280px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.social-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.social-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    border-radius: 10px;
}

.social-card h4 {
    font-size: 1.5em;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.social-card p {
    font-size: 1em;
    color: #666;
    margin-bottom: 15px;
}

.btn-visit {
    display: inline-block;
    background-color: var(--secondary-yellow);
    color: var(--text-dark);
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.btn-visit:hover {
    background-color: #FFEA00;
    transform: scale(1.05);
}

/* --- `About We Page` --- */
#about-we {
    background: url('chalkboard.png') no-repeat center top / contain,
                url('book_stack.png') no-repeat left bottom / 150px;
    background-color: var(--accent-white); /* Warna dasar untuk section */
}

.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 1000px;
}

.student-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid var(--primary-blue);
    opacity: 0; /* Awalnya tersembunyi untuk animasi */
    transform: translateY(20px);
}
.student-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}
.student-card.scroll-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}


.student-card h4 {
    font-size: 1.4em;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.student-card p {
    font-size: 0.95em;
    color: #555;
    font-weight: bold;
}

/* --- `Gallery Photo Page` --- */
#gallery {
    background: url('pencil_icon.png') no-repeat right top / 100px,
                url('ruler_icon.png') no-repeat left bottom / 120px;
    background-color: var(--secondary-yellow); /* Warna dasar untuk section */
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1100px;
}

.photo-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.photo-item:hover {
    transform: scale(1.03) rotate(2deg); /* Animasi zoom dan rotate sedikit */
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 10; /* Pastikan di atas elemen lain saat di-hover */
}

.photo-item img {
    width: 100%;
    height: 200px; /* Tinggi tetap untuk konsistensi */
    object-fit: cover; /* Pastikan gambar mengisi area tanpa distorsi */
    display: block;
    transition: transform 0.3s ease;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s forwards;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s forwards;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--accent-white);
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s ease;
}
.lightbox-close:hover {
    color: var(--secondary-yellow);
}

/* --- `Audio Controls` --- */
.audio-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

#mute-button {
    background-color: rgba(var(--primary-blue), 0.8);
    color: var(--accent-white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}
#mute-button:hover {
    background-color: var(--primary-blue);
    transform: scale(1.05);
}

/* --- `Media Queries` (Responsiveness) --- */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 60%;
        background-color: var(--primary-blue);
        flex-direction: column;
        align-items: center;
        justify-content: space-around;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        z-index: 999; /* Pastikan di atas konten lain */
    }

    .nav-links li {
        margin: 0;
        opacity: 0; /* Untuk animasi link saat menu terbuka */
    }

    .nav-links li a {
        font-size: 1.5em;
    }

    .hamburger {
        display: flex; /* Tampilkan hamburger di mobile */
    }

    .social-media-cards {
        flex-direction: column;
        align-items: center;
    }

    .social-card {
        width: 90%;
        max-width: 300px;
    }

    .student-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    #typing-text {
        font-size: 1.8em;
    }
    #start-button {
        font-size: 1.2em;
        padding: 12px 25px;
    }
}

/* `Animations` */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInFromLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Apply animations to elements */
.fade-in { animation: fadeIn 1s ease-out forwards; }
.slide-in-left { animation: slideInFromLeft 1s ease-out forwards; }
.slide-in-right { animation: slideInFromRight 1s ease-out forwards; }

/* Delay for sequential animations */
.profile-card { animation-delay: 0.5s; }
.social-card:nth-child(1) { animation-delay: 1s; }
.social-card:nth-child(2) { animation-delay: 1.3s; }
