/* Gaya Dasar untuk Halaman */
body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    padding: 20px;
    text-align: center;
    color: #333;
    background-image: url('../../assets/image/backDepan.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Gaya untuk Banner */
header h1 {
    margin: 0 0 40px;
}

header img {
    display: block;
    width: min(100%, 1200px);
    height: auto;
    margin: 0 auto;
}

/* Kontainer untuk semua kotak mata pelajaran */
.subject-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Agar responsif di layar kecil */
    gap: 30px; /* Jarak antar kotak */
}

/* Gaya untuk setiap kotak mata pelajaran */
.subject-box {
    width: 400px;
    height: 400px;
    border-radius: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #000000; /* Hitam Pekat untuk kotak teks/submenu */
    font-size: 1.8rem;
    font-weight: 800;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    /* Animasi saat muncul */
    opacity: 0; /* Mulai dari transparan */
    transform: translateY(50px); /* Mulai dari posisi sedikit di bawah */
    animation: jump-in 0.6s ease-out forwards; /* Terapkan animasi */
}

/* Sembunyikan teks HTML khusus kotak yang memakai gambar */
.subject-box.has-image {
    color: transparent;
    font-size: 0;
}

/* Efek saat kursor di atas kotak */
.subject-box:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
}

/* Memberi jeda animasi untuk setiap kotak agar tidak bersamaan */
.subject-box:nth-child(1) { animation-delay: 0.1s; }
.subject-box:nth-child(2) { animation-delay: 0.2s; }
.subject-box:nth-child(3) { animation-delay: 0.3s; }
.subject-box:nth-child(4) { animation-delay: 0.4s; }
.subject-box:nth-child(5) { animation-delay: 0.5s; }
.subject-box:nth-child(6) { animation-delay: 0.6s; }
.subject-box:nth-child(7) { animation-delay: 0.7s; }

/* Gambar spesifik untuk setiap mata pelajaran */
#math {
    background-image: url('../../assets/image/Math.jpeg');
}

#science {
    background-image: url('../../assets/image/Science.jpeg');
}

#mandarin {
    background-image: url('../../assets/image/Mandarin.jpeg');
}

#english {
    background-image: url('../../assets/image/English.jpeg');
}

#programming {
    background-image: url('../../assets/image/Programming.jpeg');
}

/* Media Query untuk layar lebih kecil (misal: HP) */
@media (max-width: 768px) {
    .subject-box {
        width: 300px;
        height: 300px;
        font-size: 1.5rem;
    }

    .subject-box.has-image {
        font-size: 0;
    }
}

/* Definisi animasi "jump-in" */
@keyframes jump-in {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    70% {
        opacity: 1;
        transform: translateY(-15px); /* Loncat sedikit ke atas */
    }
    100% {
        opacity: 1;
        transform: translateY(0); /* Kembali ke posisi normal */
    }
}

/* Gaya untuk gambar Isaac */
#isaac-pic {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 200px; /* Ukuran yang sesuai */
    height: auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 4px solid white;
    z-index: 10;
    /* Animasi saat muncul */
    opacity: 0;
    transform: translateY(100px) scale(0.8);
    animation: appear-from-bottom 1s ease-out 0.8s forwards;
}

@keyframes appear-from-bottom {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

[hidden] {
    display: none !important;
}

.login-card {
    box-sizing: border-box;
    max-width: 410px;
    margin: 5vh auto 0;
    padding: clamp(24px, 6vw, 40px);
    border: 1px solid #d4e7f7;
    border-radius: 25px;
    background: #f8fcff;
    box-shadow: 0 12px 30px #00385e26;
}

.login-card h2 {
    margin: 0;
    color: #005a9c;
    font-size: 1.8rem;
}

.login-card form {
    display: grid;
    gap: 12px;
    text-align: left;
}

.login-card input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #7895aa;
    border-radius: 12px;
    font: inherit;
}

.login-button {
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: #005a9c;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.login-card :focus-visible,
.login-button:focus-visible {
    outline: 3px solid #005a9c;
    outline-offset: 3px;
}

#student-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 48px;
    padding-top: 112px;
    margin-bottom: 24px;
}

#learning-menu {
    position: relative;
}

#logout-button {
    position: absolute;
    top: 0;
    right: 0;
}

#admin-login-button {
    display: block;
    text-align: center;
    text-decoration: none;
}

#admin-button {
    position: absolute;
    top: 56px;
    right: 0;
    display: inline-block;
    text-decoration: none;
}

#student-greeting {
    overflow-wrap: anywhere;
    color: #005a9c;
    font-family: 'Poppins', sans-serif;
    font-size: 4rem;
    font-weight: 400;
    line-height: 1.2;
    text-shadow: 0 2px 0 #fff, 0 4px 10px #00385e26;
}