/* ==========================================================================
   GURU & STAFF MANAGEMENT CSS - SMKN 1 CIKAMPEK ADMIN
   Spesifik untuk Modul Data Tenaga Pendidik & Kependidikan (guru.html)
   ========================================================================== */

/* 1. MAIN HEADER & ACTION BUTTONS */
main#content > button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 18px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

main#content > button:hover {
    background-color: var(--primary-hover);
}

main#content > button:active {
    transform: scale(0.98);
}

/* 2. FORM CONTAINER (#area-form-guru) */
#area-form-guru {
    background-color: var(--white) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--box-shadow) !important;
    padding: 24px !important;
    max-width: 500px !important;
    margin-bottom: 30px !important;
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#area-form-guru h3 {
    margin-top: 0;
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* Form Input Fields Styling */
#form-guru label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #334155;
    margin-bottom: 6px;
    display: inline-block;
}

#form-guru input[type="text"],
#form-guru input[type="number"],
#form-guru input[type="file"] {
    padding: 10px 14px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-sm) !important;
    font-size: 0.95rem !important;
    outline: none !important;
    background-color: #f8fafc !important;
    color: #0f172a !important;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    width: 100%;
}

#form-guru input[type="text"]:focus,
#form-guru input[type="number"]:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    background-color: var(--white) !important;
}

/* Khusus input file & penata letak berkas */
#form-guru input[type="file"] {
    background-color: transparent !important;
    border: 1px dashed var(--border-color) !important;
    padding: 8px !important;
    cursor: pointer;
}

#form-guru input[type="number"] {
    text-align: left;
}

/* Preview Foto & Status Upload di Form */
#preview-guru {
    object-fit: cover;
    height: 180px;
    width: 135px; /* Rasio pas foto 3:4 standar */
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#status-upload-guru {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
}

/* Tombol Aksi di dalam Form */
#form-guru button[type="submit"] {
    background-color: var(--success-color) !important;
    color: var(--white) !important;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

#form-guru button[type="submit"]:hover {
    background-color: var(--success-hover) !important;
}

#form-guru button[type="button"] {
    background-color: var(--neutral-color) !important;
    color: var(--white) !important;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.2s;
}

#form-guru button[type="button"]:hover {
    background-color: var(--neutral-hover) !important;
}


/* 3. MODERN TABLE DESIGN FOR GURU & STAFF */
table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: none !important;
    background-color: var(--white) !important;
    border-radius: var(--border-radius) !important;
    overflow: hidden !important;
    box-shadow: var(--box-shadow) !important;
    margin-top: 15px !important;
}

table th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.5px !important;
    padding: 14px 18px !important;
    border-bottom: 2px solid var(--border-color) !important;
}

table td {
    padding: 12px 18px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: var(--text-main) !important;
    font-size: 0.95rem !important;
    vertical-align: middle !important;
}

table tbody tr:hover {
    background-color: #f8fafc !important;
}

table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Kolom Urutan Tampil */
table td:nth-child(1) {
    font-weight: bold;
    color: #64748b;
}

/* Foto Thumbnail di Tabel */
.img-thumbnail {
    width: 50px;
    height: 65px; /* Rasio vertikal 3:4 pas foto */
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.img-thumbnail:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Format Tulisan Nama & Jabatan */
table td b {
    font-size: 1rem;
    color: #0f172a;
}

/* Tombol Aksi Tabel (Edit/Hapus) */
table td button {
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-radius: var(--border-radius-sm) !important;
    border: 1px solid transparent !important;
    margin: 2px;
    cursor: pointer;
    transition: background-color 0.2s;
}

table td button:nth-of-type(1) { /* Edit */
    background-color: #fffbeb !important;
    color: #b45309 !important;
    border-color: #fde68a !important;
}

table td button:nth-of-type(1):hover {
    background-color: #fef3c7 !important;
}

table td button:nth-of-type(2) { /* Hapus */
    background-color: #fef2f2 !important;
    color: #991b1b !important;
    border-color: #fee2e2 !important;
}

table td button:nth-of-type(2):hover {
    background-color: #fee2e2 !important;
}


/* 4. MODAL LIGHTBOX / ZOOM FOTO GURU */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    padding-top: 50px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
}

.modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 350px;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    border: 3px solid var(--white);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: zoomEffect 0.2s ease-out;
}

@keyframes zoomEffect {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f5f9;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover,
.close:focus {
    color: var(--white);
    text-decoration: none;
}


/* ==========================================================================
   5. MOBILE RESPONSIVE (Layar Smartphone - Maksimal 768px)
   ========================================================================== */
@media (max-width: 768px) {
    
    /* Tombol Utama (+ Tambah Guru) Menjadi Penuh */
    main#content > button {
        width: 100%;
        margin-bottom: 15px;
    }

    /* Penyesuaian Kotak Form */
    #area-form-guru {
        padding: 15px !important;
        width: 100% !important;
    }

    /* Tombol Simpan & Batal Bertingkat */
    #form-guru button[type="submit"],
    #form-guru button[type="button"] {
        width: 100%;
        margin: 5px 0 0 0;
        display: block;
    }

    /* ----------------------------------------------------
       TRANSFORMASI TABEL GURU MENJADI BENTUK CARD (KARTU)
       ---------------------------------------------------- */
    table, thead, tbody, th, td, tr {
        display: block !important;
        width: 100% !important;
    }

    /* Menyembunyikan Header Tabel */
    table thead {
        display: none !important;
    }

    /* Tiap baris tabel menjadi sebuah Card */
    table tbody tr {
        margin-bottom: 20px !important;
        border: 1px solid var(--border-color) !important;
        border-radius: var(--border-radius) !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
        padding: 10px !important;
        background-color: var(--white) !important;
    }

    /* Pengaturan Tata Letak Kolom Kiri-Kanan */
    table td {
        text-align: right !important;
        position: relative !important;
        border-bottom: 1px solid #f1f5f9 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        padding: 12px 10px 12px 40% !important; /* Sisakan 40% di kiri untuk label */
        min-height: 50px;
    }

    /* Kolom terakhir (Tombol Aksi) ditaruh paling bawah */
    table td:last-child {
        border-bottom: none !important;
        justify-content: center !important;
        padding-left: 10px !important;
        gap: 10px;
    }

    /* Memunculkan Label Nama Kolom di Sisi Kiri */
    table td::before {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 35%;
        text-align: left;
        font-weight: 600;
        color: #475569;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Label Spesifik Untuk Tabel Guru */
    table td:nth-child(1)::before { content: "Urutan Tampil:"; }
    table td:nth-child(2)::before { content: "Foto Profil:"; }
    table td:nth-child(3)::before { content: "Nama Guru:"; }
    table td:nth-child(4)::before { content: "NIP/NUPTK:"; }
    table td:nth-child(5)::before { content: "Jabatan:"; }
    table td:nth-child(6)::before { display: none; } /* Sel aksi tidak diberi label */

    /* Menyeimbangkan Ukuran Tombol Aksi (Edit & Hapus) */
    table td button {
        flex: 1; /* Agar tombolnya rata membagi 2 kolom */
        padding: 10px !important;
    }
}