@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== Reset & Base ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI";
    /* Cahaya hangat: Dark slate base with precise radial gradients */
    background-color: #1d1d33;
    background-image: 
        radial-gradient(circle at 86% 2%, rgba(167, 123, 86, 0.40) 0%, transparent 60%),
        radial-gradient(circle at 6% 72%, rgba(167, 118, 69, 0.21) 0%, transparent 60%);
    background-attachment: fixed;
    color: #F4F5FB;
    line-height: 1.5;
}

a {
    color: #e6a760;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Navigasi utama (Header) ===== */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 95px;
    padding: 0 68px;
    background-color: rgba(244, 245, 251, 0.05);
    border-bottom: 1px solid rgba(232, 233, 245, 0.19);
}

header h1 {
    /* Identitas */
    display: flex;
    align-items: center;
    gap: 12px;
    color: #F4F5FB;
    font-size: 20px;
    font-weight: 600;
}

header h1::before {
    content: "";
    display: inline-block;
    width: 31px;
    height: 33px;
    background: url("../svg/Lambang%20perpustakaan.svg") no-repeat center;
    background-size: contain;
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    font-size: 1.6rem;
    color: #F4F5FB;
    background: none;
    border: none;
    cursor: pointer;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 10px;
}

header nav a {
    /* Tautan navigasi */
    color: #F4F5FB;
    font-weight: 400;
    font-size: 16px;
    padding: 12px 18px;
    border-radius: 100px;
    transition: background-color 0.3s ease;
}

header nav a:hover {
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===== Konten halaman (Main) ===== */
main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 44px 132px; /* Perfect Figma padding */
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== Judul Halaman & Kontainer ===== */
section {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 24px; /* itemSpacing connecting Judul to Formulir */
}

section h2 {
    /* Judul */
    font-size: 40px;
    font-weight: 700;
    color: #F4F5FB;
    margin-bottom: 0;
}

/* ===== Formulir (Card) ===== */
form {
    /* Pendaftaran anggota card */
    background-color: rgba(244, 245, 251, 0.04);
    border: 1px solid rgba(232, 233, 245, 0.19);
    border-radius: 22px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

form p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between label and input */
}

form label {
    font-size: 15px;
    font-weight: 600;
    color: #F4F5FB;
    margin: 0;
}

form input,
form select {
    width: 100%;
    padding: 14px 16px;
    background-color: rgba(20, 20, 37, 0.4);
    border: 1px solid rgba(232, 233, 245, 0.19);
    border-radius: 12px;
    color: #F4F5FB;
    font-size: 15px;
    font-family: "Inter", sans-serif;
    transition: border-color 0.3s ease;
}

form input:focus,
form select:focus {
    outline: none;
    border-color: #F4F5FB;
    background-color: rgba(20, 20, 37, 0.6);
}

form button[type="submit"] {
    background-color: #F4F5FB;
    color: #1a1614;
    border: none;
    padding: 14px 32px;
    border-radius: 100px; /* Pill shape */
    font-size: 16px;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 8px;
    transition: opacity 0.3s ease;
}

form button[type="submit"]:hover {
    opacity: 0.85;
}

/* ===== Kolom Pencarian ===== */
.search-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin-bottom: 8px;
}

.search-box label {
    font-size: 15px;
    font-weight: 600;
    color: #F4F5FB;
}

.search-box input {
    width: 100%;
    padding: 14px 16px;
    background-color: rgba(20, 20, 37, 0.4);
    border: 1px solid rgba(232, 233, 245, 0.19);
    border-radius: 12px;
    color: #F4F5FB;
    font-size: 15px;
    font-family: "Inter", sans-serif;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #F4F5FB;
    background-color: rgba(20, 20, 37, 0.6);
}

/* ===== Tabel ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: rgba(244, 245, 251, 0.04);
    border: 1px solid rgba(232, 233, 245, 0.19);
    border-radius: 22px;
    overflow: hidden;
}

th, td {
    text-align: left;
    padding: 16px 28px;
    border-bottom: 1px solid rgba(232, 233, 245, 0.19);
    color: #F4F5FB;
}

thead {
    background-color: rgba(255, 255, 255, 0.05);
}

thead th {
    font-weight: 600;
    font-size: 14px;
    color: #bbbacb;
}

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

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Aksi Tabel (Tombol Edit & Hapus) */
td button {
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    border: 1px solid rgba(232, 233, 245, 0.19);
    cursor: pointer;
    background-color: rgba(244, 245, 251, 0.08);
    color: #F4F5FB;
    transition: all 0.2s ease;
    margin-right: 6px;
}

td button:hover {
    background-color: rgba(244, 245, 251, 0.18);
}

td button.btn-hapus,
td button:last-of-type {
    color: #ff9d9d;
    border-color: rgba(255, 157, 157, 0.3);
    background-color: rgba(255, 157, 157, 0.1);
}

td button.btn-hapus:hover,
td button:last-of-type:hover {
    background-color: rgba(255, 157, 157, 0.2);
}

/* Status & Pesan */
.error {
    display: block;
    color: #ff9d9d;
    font-size: 13px;
    margin-top: 4px;
}

#loading-indicator {
    color: #bbbacb;
    font-size: 14px;
}

/* ===== Dashboard (Ringkasan) ===== */
/* Mendukung langsung section maupun wrapper div lama */
section:nth-of-type(2),
section:nth-of-type(2) > div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
}

section:nth-of-type(2) h2 {
    width: 100%;
}

section:nth-of-type(2) > div {
    width: 100%;
}

article {
    flex: 1 1 200px;
    background-color: rgba(244, 245, 251, 0.05);
    border: 1px solid rgba(232, 233, 245, 0.25);
    border-radius: 22px;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

article h3 {
    font-size: 16px;
    font-weight: 400;
    color: #F4F5FB;
    margin: 0;
}

article p {
    font-size: 36px;
    font-weight: 700;
    color: #F4F5FB;
    margin: 0;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 0 132px 44px 132px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 768px) {
    main {
        padding: 32px;
    }
    header {
        padding: 0 32px;
    }
    footer {
        padding: 0 32px 32px 32px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem;
        height: auto;
    }
    
    .nav-toggle-label {
        display: block;
    }

    header nav {
        display: none;
        width: 100%;
        order: 3;
        margin-top: 1rem;
    }

    header nav.nav-open,
    .nav-toggle:checked ~ nav {
        display: block;
    }

    header nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
}
