/* Import Font Modern 'Inter' dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root { 
    --primary-green: #0a5c36; 
    --light-green: #148f55; 
    --accent-gold: #f39c12; 
    --bg-light: #f4f7f5; 
    --white: #ffffff; 
    --text-dark: #2c3e50; 
    --shadow-soft: 0 8px 25px rgba(10, 92, 54, 0.08); 
    --radius-lg: 20px; 
    --radius-md: 12px; 
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Inter', sans-serif; 
    -webkit-tap-highlight-color: transparent; /* Hilangkan blok biru saat tombol ditekan di HP */
}

body { 
    background-color: var(--bg-light); 
    color: var(--text-dark); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    overflow-x: hidden; /* Mencegah layar tergeser ke samping */
}

/* --- HEADER STYLING --- */
header { 
    background: linear-gradient(135deg, var(--primary-green), var(--light-green)); 
    color: var(--white); 
    padding: 40px 20px 60px 20px; 
    text-align: center; 
    border-bottom-left-radius: 40px; 
    border-bottom-right-radius: 40px; 
    box-shadow: 0 10px 30px rgba(10, 92, 54, 0.2); 
    margin-bottom: 20px; 
}

header h1 { font-size: 1.6rem; margin-top: 10px; font-weight: 800; }
header p { font-size: 0.9rem; opacity: 0.9; margin-bottom: 15px;}

.user-badge {
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
}

/* Pembungkus Konten Utama: Maksimal selebar tablet, di HP akan full-width otomatis */
.container { 
    padding: 20px; 
    max-width: 600px; 
    margin: 0 auto; 
    flex: 1; 
    width: 100%; 
    animation: fadeInUp 0.6s ease backwards; 
}

/* --- GRID MENU DASHBOARD --- */
.menu-container { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px; 
}

.menu-card { 
    background: var(--white); 
    padding: 25px 15px; 
    border-radius: var(--radius-lg); 
    text-align: center; 
    text-decoration: none; 
    color: var(--text-dark); 
    box-shadow: var(--shadow-soft); 
    transition: all 0.3s ease; 
    border: 1px solid rgba(10, 92, 54, 0.05); 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 130px;
}

.menu-card:active {
    transform: scale(0.95); /* Efek tombol ditekan yang lebih responsif di HP */
}

.icon-box {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.menu-card span { 
    font-size: 0.85rem; 
    font-weight: 700; 
    line-height: 1.3;
}

/* --- FORM & KOMPONEN UMUM --- */
.form-box { 
    background: var(--white); 
    padding: 25px; 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-soft); 
    margin-bottom: 25px; 
    border-top: 5px solid var(--primary-green); 
}

label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.9rem; color: var(--primary-green); }
select, textarea, input { 
    width: 100%; padding: 15px; margin-bottom: 15px; /* Padding dibesarkan agar mudah disentuh jari */
    border-radius: var(--radius-md); border: 1px solid #e0e6e2; 
    background: #f9fbf9; font-size: 1rem; /* Font size 1rem (16px) wajib di HP agar iOS tidak auto-zoom */
    transition: 0.3s;
}
select:focus, input:focus, textarea:focus { border-color: var(--primary-green); outline: none; }

.btn-main { 
    width: 100%; padding: 16px; 
    background: var(--primary-green); color: white; 
    border: none; border-radius: var(--radius-md); 
    font-weight: bold; cursor: pointer; transition: 0.3s; 
    font-size: 0.95rem; display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn-main:active { transform: scale(0.96); background: var(--light-green); }
.btn-danger { background: #e74c3c; margin-top: 15px; }
.back-link { text-decoration: none; color: var(--primary-green); font-weight: bold; display: inline-block; margin-bottom: 20px; padding: 10px 0; }

@keyframes fadeInUp { 
    from { opacity: 0; transform: translateY(30px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* --- CSS KHUSUS PASAL & REKAP --- */
.card-siswa { background: white; border-radius: 15px; padding: 15px; margin-bottom: 15px; box-shadow: var(--shadow-soft); border: 1px solid #eee; }
.poin-badge { background: #fff3cd; color: #856404; padding: 8px 15px; border-radius: 20px; font-weight: bold; margin-bottom: 10px; display:inline-block;}
.input-area { display: flex; gap: 10px; margin: 15px 0; }
.btn-add { background: var(--primary-green); color: white; border: none; padding: 0 15px; border-radius: 8px; cursor: pointer; font-size: 1.2rem; }
.list-terpilih { list-style: none; padding: 0; }
.list-terpilih li { padding: 12px 0; border-bottom: 1px dotted #ccc; font-size: 0.85rem; display: flex; justify-content: space-between; align-items: center; line-height: 1.4; }
.btn-hapus-card { width: 100%; padding: 12px; background: #fff1f0; color: #f5222d; border: 1px solid #ffa39e; border-radius: 8px; cursor: pointer; font-size: 0.85rem; font-weight: bold; margin-top: 10px;}
.score-circle { width: 120px; height: 120px; border-radius: 50%; border: 8px solid #eee; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; margin: 15px auto; transition: 0.5s ease; }
.score-number { font-size: 2rem; font-weight: 900; }

/* =========================================
   MEDIA QUERIES (KHUSUS LAYAR HP MOBILE)
   ========================================= */
@media screen and (max-width: 480px) {
    /* Penyesuaian Header agar tidak memakan terlalu banyak ruang di layar kecil */
    header {
        padding: 30px 15px 50px 15px;
        border-bottom-left-radius: 30px; 
        border-bottom-right-radius: 30px; 
    }
    
    header h1 { font-size: 1.4rem; }
    
    .container {
        padding: 15px;
        margin-top: -35px; /* Mengurangi efek tumpang tindih berlebih di HP */
    }

    /* Penyesuaian Kotak Menu */
    .menu-container {
        gap: 12px; /* Jarak antar kotak sedikit dikurangi */
    }

    .menu-card {
        padding: 20px 10px;
        min-height: 120px;
    }

    .icon-box {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .menu-card span {
        font-size: 0.8rem;
    }

    /* Form dan Input */
    .form-box {
        padding: 20px 15px;
    }
    
    .score-circle {
        width: 110px;
        height: 110px;
    }
    
    .score-number {
        font-size: 1.8rem;
    }
}

/* =========================================
   CUSTOM NOTIFICATION (MODAL/TOAST)
   ========================================= */
.notif-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 92, 54, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.notif-box {
    background: var(--white);
    padding: 35px 25px;
    border-radius: var(--radius-lg);
    text-align: center;
    width: 85%;
    max-width: 320px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: zoomIn 0.3s ease backwards;
}

.notif-icon {
    font-size: 4.5rem;
    margin-bottom: 15px;
}

.notif-icon.success { color: #27ae60; }
.notif-icon.error { color: #e74c3c; }
.notif-icon.warning { color: #f39c12; }

.notif-text {
    font-size: 1.05rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 1.4;
}

.notif-btn {
    padding: 12px;
    font-size: 0.95rem;
    border-radius: 30px; /* Tombol membulat */
}

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

/* =========================================
   CUSTOM SELECT2 (SEARCHABLE DROPDOWN)
   ========================================= */
.select2-container {
    width: 100% !important;
    margin-bottom: 15px;
}
.select2-container .select2-selection--single {
    height: 52px !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid #e0e6e2 !important;
    background: #f9fbf9 !important;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 50px !important;
    right: 15px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-dark) !important;
    font-size: 0.95rem;
    padding-left: 15px !important;
}
.select2-container--default .select2-selection--single:focus,
.select2-container--open .select2-selection--single {
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 5px rgba(10, 92, 54, 0.3) !important;
    outline: none;
}
.select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-green) !important;
}
.select2-search__field {
    border-radius: 8px !important;
    padding: 8px !important;
}

/* --- SELECT2 MULTIPLE (INPUT MASSAL) --- */
.select2-container--default .select2-selection--multiple {
    min-height: 52px !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid #e0e6e2 !important;
    background: #f9fbf9 !important;
    padding: 4px 8px !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary-green) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    margin-top: 6px !important;
    font-size: 0.85rem;
    font-weight: 600;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--white) !important;
    margin-right: 8px !important;
    border-right: 1px solid rgba(255,255,255,0.3) !important;
    padding-right: 8px !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: transparent !important;
    color: #ffcccc !important;
}