/* ==========================================================================
   1. Import Fon & Pembolehubah CSS (Variables)
   ========================================================================== */

/* Import fon 'Poppins' dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    /* Palet Warna Baharu */
    --font-primary: 'Poppins', sans-serif;
    --color-primary: #4A55A2; /* Biru Indigo */
    --color-primary-dark: #3A448A;
    --color-accent-green: #A0D8B3;
    --color-accent-gold: #FFC107;
    --color-dark: #212529;
    --color-body: #495057;
    --color-light-gray: #F8F9FA; /* Latar belakang lembut */
    --color-white: #ffffff;
    --color-border: #dee2e6;
    
    /* Gaya Komponen Baharu */
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08); /* Bayang-bayang lembut */
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.1);
    --border-radius-md: 8px;
    --border-radius-lg: 12px; /* Sudut lebih bulat */
}

/* ==========================================================================
   2. Gaya Asas & Reset
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-light-gray); /* Menggunakan latar belakang baharu */
    color: var(--color-body);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container, .container-fluid {
    width: 95%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-dark);
    font-weight: 600; /* Konsistenkan berat fon untuk tajuk */
}

/* ==========================================================================
   3. Komponen Tersuai
   ========================================================================== */

/* Reka Bentuk Kad yang Diseragamkan */
.card {
    border: none;
    border-radius: var(--border-radius-lg); /* Sudut lebih bulat */
    box-shadow: var(--shadow-soft); /* Bayang-bayang lebih lembut */
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}
.card-header {
    background-color: var(--color-white);
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

/* Reka Bentuk Butang yang Diseragamkan */
.btn {
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

/* Reka Bentuk Borang yang Diseragamkan */
.form-control, .form-select {
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(74, 85, 162, 0.25);
}

/* ==========================================================================
   4. Susun Atur Mudah Alih (Mobile Layout) - DIKEMAS KINI
   ========================================================================== */

/* Pastikan kandungan utama mempunyai ruang yang cukup */
main.main-content {
    flex-grow: 1;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Header Mudah Alih */
.mobile-header {
    padding: 15px;
    text-align: center;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
}
.mobile-header-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 0;
}

/* Menu Navigasi Bawah (DIKEMAS KINI) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--color-white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e9ecef;
}
.mobile-bottom-nav__link {
    flex: 1; /* Guna flex: 1 untuk agihan ruang yang lebih baik */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px 4px; /* Kurangkan padding sedikit */
    text-decoration: none;
    color: var(--color-body);
    transition: background-color 0.2s;
    overflow: hidden; /* Sembunyikan teks yang melimpah */
}
.mobile-bottom-nav__link .mobile-bottom-nav__label {
    font-size: 0.75rem; /* Saiz fon label dikecilkan sedikit */
    white-space: nowrap; /* Elak teks daripada pecah ke baris kedua */
    text-overflow: ellipsis; /* Tambah '...' jika teks terlalu panjang */
    overflow: hidden;
    width: 100%;
    text-align: center;
}
.mobile-bottom-nav__link i {
    font-size: 1.4rem; /* Saiz ikon dikecilkan sedikit */
    margin-bottom: 4px;
}
.mobile-bottom-nav__link.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* Media Query untuk mengaktifkan paparan mudah alih */
@media (max-width: 991.98px) {
    body.mobile-layout {
        padding-bottom: 80px; /* Ruang untuk elak menu bawah bertindih */
    }
    .mobile-bottom-nav {
        display: flex;
    }
}