/* ==========================================================================
   LULUSAN TERBAIK MANAGEMENT CSS - SMKN 1 CIKAMPEK ADMIN
   Spesifik untuk Modul Pengelolaan Data Alumni & Lulusan Terbaik (lulusan.html)
   ========================================================================== */

/* 1. HIGHLIGHT ACTIVE SIDEBAR/NAV MENU */


/* 2. TOMBOL AKSI UTAMA (+ Tambah Lulusan Baru) */
main#content > button {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

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

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

/* 3. CARD CONTAINER FORM (#area-form-lulusan) */
#area-form-lulusan {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    padding: 25px !important;
    max-width: 500px !important;
    margin-bottom: 25px !important;
    animation: slideDown 0.3s ease-out;
}

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

#judul-form-lulusan {
    margin-top: 0;
    margin-bottom: 20px;
    color: #334155;
    font-size: 1.25rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

/* 4. FORM FIELDS & INPUTS STYLING */
#form-lulusan label {
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 6px;
}

#form-lulusan input[type="text"],
#form-lulusan input[type="number"],
#form-lulusan textarea {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px !important;
    font-size: 0.95rem;
    color: #1e293b;
    background-color: #f8fafc;
    box-sizing: border-box;
    transition: all 0.2s ease;
    width: 100%;

    /* ── FIX: Placeholder overlap pada input[type="number"] ──────────────
       Masalah: spinner (panah naik/turun) bawaan browser menindih placeholder.
       Solusi: beri padding-right cukup agar teks/placeholder tidak tertutup
       spinner, dan pastikan line-height eksplisit agar teks vertikal center. */
    padding-right: 36px !important; /* ruang untuk spinner */
    line-height: 1.5;
    -moz-appearance: textfield; /* Firefox: sembunyikan spinner jika tidak perlu */
}

/* Sembunyikan spinner Chrome/Safari/Edge hanya pada field tahun lulus
   agar placeholder terlihat penuh. Hapus rule ini jika spinner tetap dibutuhkan. */
#form-lulusan input[type="number"]::-webkit-outer-spin-button,
#form-lulusan input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#form-lulusan input[type="text"]:focus,
#form-lulusan input[type="number"]:focus,
#form-lulusan textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

#form-lulusan textarea {
    resize: vertical;
}

/* Input File Kustomisasi Ringan */
#form-lulusan input[type="file"] {
    background: #f1f5f9;
    padding: 8px;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

/* Buttons di dalam Form */
#form-lulusan button[type="submit"] {
    background-color: #16a34a;
    color: white;
    border: none;
    padding: 10px 18px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#form-lulusan button[type="submit"]:hover {
    background-color: #15803d;
}

#form-lulusan button[type="button"] {
    background-color: #94a3b8;
    color: white;
    border: none;
    padding: 10px 18px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s;
}

#form-lulusan button[type="button"]:hover {
    background-color: #64748b;
}

/* 5. TABEL DATA ALUMNI / LULUSAN */
table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0 !important;
}

table th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 14px 16px !important;
    border: none !important;
}

table td {
    padding: 14px 16px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    color: #334155;
    font-size: 0.95rem;
}

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

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

/* Kolom Nama Alumni */
table td b {
    color: #1e293b;
    font-weight: 600;
}

/* Tombol Aksi Kolom Tabel (Edit & Hapus) */
table td button {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    margin: 2px;
}

/* Tombol Edit */
table td button:nth-of-type(1) {
    background-color: #fef3c7;
    color: #d97706;
    border-color: #fde68a;
}

table td button:nth-of-type(1):hover {
    background-color: #fde68a;
    color: #b45309;
}

/* Tombol Hapus */
table td button:nth-of-type(2) {
    background-color: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

table td button:nth-of-type(2):hover {
    background-color: #fca5a5;
    color: #b91c1c;
}

/* 6. MODAL ZOOM GAMBAR & THUMBNAIL */
.img-thumbnail {
    max-width: 80px;
    max-height: 80px;
    object-fit: cover;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px;
    display: block;
    margin: 0 auto;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.img-thumbnail:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    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;
    max-width: 80%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.25s ease-out;
}

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

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

.close:hover,
.close:focus {
    color: #cbd5e1;
    text-decoration: none;
}


/* ==========================================================================
   7. RESPONSIVE — TABLET (≤768px) & MOBILE (≤480px)
   ========================================================================== */

/* ── TABLET (≤768px) ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Tombol Utama → full width */
    main#content > button {
        width: 100%;
        margin-bottom: 15px;
        box-sizing: border-box;
        text-align: center;
    }

    /* Form container → full width */
    #area-form-lulusan {
        padding: 18px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Tombol Simpan & Batal → full width stack */
    #form-lulusan button[type="submit"],
    #form-lulusan button[type="button"] {
        width: 100%;
        margin: 6px 0 0 0 !important;
        display: block;
        box-sizing: border-box;
    }

    /* ── TABLE → CARD LAYOUT ─────────────────────────────────────────────── */
    table, thead, tbody, th, td, tr {
        display: block !important;
        width: 100% !important;
    }

    /* Sembunyikan header tabel */
    table thead {
        display: none !important;
    }

    /* Setiap baris → card */
    table tbody tr {
        margin-bottom: 20px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02) !important;
        padding: 10px !important;
        background-color: #ffffff !important;
    }

    /* Sel data → label kiri, nilai kanan */
    table td {
        text-align: right !important;
        position: relative !important;
        border-bottom: 1px solid #f1f5f9 !important;
        display: block !important;
        padding: 12px 10px 12px 45% !important;
        min-height: 48px;
        box-sizing: border-box !important;
        word-break: break-word;
    }

    /* Baris terakhir (tombol Edit & Hapus) → flex row */
    table td:last-child {
        border-bottom: none !important;
        padding-left: 10px !important;
        display: flex !important;
        justify-content: center !important;
        gap: 8px;
        margin-top: 5px;
    }

    /* Label pseudo-element di kiri */
    table td::before {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 40%;
        text-align: left;
        font-weight: 600;
        color: #475569;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    table td:nth-child(1)::before { content: "No / Urutan:"; }
    table td:nth-child(2)::before { content: "Foto Alumni:"; }
    table td:nth-child(3)::before { content: "Nama Alumni:"; }
    table td:nth-child(4)::before { content: "Tahun Lulus:"; }
    table td:nth-child(5)::before { content: "Keterangan:"; }
    table td:nth-child(6)::before { display: none; }

    /* Thumbnail rata kanan */
    .img-thumbnail {
        margin: 0 0 0 auto !important;
    }

    /* Tombol aksi → sama lebar */
    table td button {
        flex: 1;
        padding: 10px !important;
        text-align: center;
    }

    /* Modal image */
    .modal-content {
        max-width: 90%;
    }
}

/* ── MOBILE (≤480px) ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {

    /* Form container */
    #area-form-lulusan {
        padding: 14px !important;
        border-radius: 8px !important;
    }

    #judul-form-lulusan {
        font-size: 1.05rem;
        margin-bottom: 14px;
    }

    /* Labels */
    #form-lulusan label {
        font-size: 0.83rem;
    }

    /* Inputs & textarea */
    #form-lulusan input[type="text"],
    #form-lulusan input[type="number"],
    #form-lulusan textarea {
        padding: 9px 11px !important;
        padding-right: 11px !important; /* spinner sudah disembunyikan, tidak perlu ruang ekstra */
        font-size: 0.88rem;
    }

    /* Input file */
    #form-lulusan input[type="file"] {
        font-size: 0.82rem;
        padding: 7px;
    }

    /* Tombol form */
    #form-lulusan button[type="submit"],
    #form-lulusan button[type="button"] {
        padding: 10px 14px;
        font-size: 0.88rem;
    }

    /* Card table — padding lebih rapat */
    table tbody tr {
        padding: 8px !important;
    }

    table td {
        padding: 10px 8px 10px 42% !important;
        min-height: 44px;
        font-size: 0.85rem !important;
    }

    table td::before {
        font-size: 0.78rem;
        width: 38%;
    }

    table td:last-child {
        padding-left: 8px !important;
    }

    /* Thumbnail sedikit lebih kecil */
    .img-thumbnail {
        max-width: 64px;
        max-height: 64px;
    }

    /* Tombol aksi */
    table td button {
        font-size: 0.78rem !important;
        padding: 8px 6px !important;
    }

    /* Modal hampir full screen */
    .modal {
        padding-top: 40px;
    }

    .modal-content {
        max-width: 95%;
        border-radius: 8px;
    }

    .close {
        top: 12px;
        right: 16px;
        font-size: 32px;
    }
}