/* ==========================================
   1. RESET & GAYA ASAS (GLOBAL STYLES)
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    position: relative;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Gambar Latar Belakang (Blurred Background) */
body.home-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Gantikan nama fail gambar sekolah anda di sini */
    background-image: url('gmbr sklh.jpg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Tahap Blur & Kecerahan Gambar */
    filter: blur(6px) brightness(0.85); 
    
    /* Supaya gambar tidak terlebih ke luar skrin bila blur */
    transform: scale(1.05); 
    
    /* Duduk paling belakang sekali */
    z-index: -1; 
}

/* Gambar Latar Belakang (Blurred Background) */
body.book-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Gantikan nama fail gambar sekolah anda di sini */
    background-image: url('buku.jpg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Tahap Blur & Kecerahan Gambar */
    filter: blur(6px) brightness(0.85); 
    
    /* Supaya gambar tidak terlebih ke luar skrin bila blur */
    transform: scale(1.05); 
    
    /* Duduk paling belakang sekali */
    z-index: -1; 
}

/* Wrapper Ikon supaya di tengah */
.user-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

/* Saiz & Bentuk Ikon Bulat */
.user-icon {
    width: 80px;         /* Saiz lebar ikon */
    height: 80px;        /* Saiz tinggi ikon */
    object-fit: cover;
    border-radius: 50%;  /* Supaya bulat sempurna jika gambar empat segi */
}

/* ==========================================
   2. HEADER & NAVIGASI SEKOLAH
   ========================================== */
.homepage-header {
    background-color: #d8b88a; /* Warna sama macam button */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 2px solid #c4a173;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Header Logo & Nama Sekolah */
.header-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px; /* Jarak antara logo dan teks */
}

.header-logo {
    height: 35px; /* Saiz logo comel di header */
    width: auto;
    object-fit: contain;
}

.school-name {
    font-weight: 800;
    color: #3b2a1a;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.header-title {
    flex: 2;
    text-align: center;
    color: #3b2a1a;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.back-btn {
      color: #3d2b17;
      font-size: 1.1rem;
      text-decoration: none;
      display: flex;
      align-items: center;
    }

    .back-btn:hover {
      opacity: 0.7;
    }

/* Pautan WhatsApp / School Contact */
.school-contact {
    color: #000000; /* Warna teks hitam supaya jelas */
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    white-space: nowrap;
}

.school-contact:hover {
    color: #4a3b32;
    text-decoration: underline;
}

/* ==========================================
   3. HEADER NAVIGASI BELAH KANAN (TEXTBOOK LIST)
   ========================================== */
.header-nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Gaya Butang di Header (Loan Status & Announcement guna warna ini) */
.nav-btn {
    background-color: #f7ede2; /* Warna krim cerah */
    color: #3b2a1a;
    border: 1px solid #c4a173;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
}

.nav-btn:hover {
    background-color: #c4a173;
    color: #ffffff;
}

/* ==========================================
   4. CONTAINER & KAD UTAMA
   ========================================== */
.container {
    max-width: 900px;
    width: 90%;
    margin: 30px auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

/* Homepage Hero Card */
.hero-card {
    max-width: 850px;
    margin: 40px auto;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.hero-title {
    color: #3b2a1a;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.school-logo {
    width: 130px;
    height: auto;
    margin: 15px 0;
    object-fit: contain;
}

.system-title {
    font-size: 20px;
    color: #222222;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 35px;
    line-height: 1.4;
}

/* Kad Maklumat Pelajar */
.student-banner {
    background-color: #f7ede2;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    border-left: 5px solid #d8b88a;
}

.student-banner h3 {
    margin: 0;
    color: #4a3b32;
    font-size: 18px;
}

/* ==========================================
   5. BORANG & INPUT (FORMS)
   ========================================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #444;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 11px 14px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #d8b88a;
    box-shadow: 0 0 5px rgba(216, 184, 138, 0.5);
}

/* ==========================================
   6. BUTANG & NAVIGATION (BUTTONS & TABS)
   ========================================== */
.button-group {
    display: flex;
    flex-direction: column; 
    align-items: center;    
    gap: 15px;              
}

.btn {
    background-color: #d8b88a;
    color: #222222;
    border: 1px solid #c4a173;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease-in-out;
    width: 260px; 
    text-align: center; 
}

.btn:hover {
    background-color: #c4a173;
    color: #ffffff;
}

/* Tab Loan Status & Fine */
.tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 14px;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #d8b88a;
    color: #ffffff;
}

.tab-btn:hover:not(.active) {
    background: #e4e4e4;
}

/* Butang Search Center */
.search-btn-container {
    display: flex;
    justify-content: center; 
    margin-top: 25px;
}

.btn-search {
    width: 200px; 
    padding: 10px 20px;
    border: 1px solid #c4a173;
    background-color: #d8b88a;
    color: #222222;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-search:hover {
    background-color: #c4a173;
    color: #ffffff;
}

/* ==========================================
   7. JADUAL DATA (TABLES)
   ========================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #fff;
}

th, td {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    text-align: left;
    font-size: 15px;
}

th {
    background-color: #f7ede2;
    color: #4a3b32;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #fafafa;
}

/* Status Text Formatting */
.status-received, .status-returned {
    color: #2e7d32;
    font-weight: bold;
}

.status-not-returned, .status-unpaid {
    color: #d32f2f;
    font-weight: bold;
}

/* ==========================================
   8. MODAL / ANNOUNCEMENT POP-UP
   ========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: popup 0.3s ease-out;
}

.modal-content h3 {
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 15px;
    color: #555;
}

@keyframes popup {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Total Fine Display */
.total-fine-box {
    text-align: right;
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
}

.total-fine-amount {
    color: #d32f2f;
    font-size: 20px;
}

/* ==========================================
   9. FOOTER STYLES
   ========================================== */
.footer {
    background-color: #d8b88a; 
    color: #3b2a1a;
    text-align: center;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-top: 2px solid #c4a173;
    margin-top: auto; 
    width: 100%;
}