:root {
    --emerald: #064e3b;
    --emerald-light: #0a6b51;
    --gold: #d4af37;
    --gold-bright: #f1c40f;
    --dark: #1a1a1a;
    --white: #ffffff;
}

body {
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
    margin: 0;
}

/* --- Header & Navigation --- */
.navbar {
    background: var(--emerald);
    padding: 0.8rem 0;
}

/* Baris 1: Logo & Brand */
.navbar-row1 {
    background: #064e3b !important;  /* hardcode supaya tak kena override page lain */
    padding: 0.6rem 0;
    position: relative;
    z-index: 1031;
}

/* Baris 2: Menu — sticky di atas */
.navbar-row2 {
    background: #064e3b !important;  /* hardcode supaya tak kena override page lain */
    border-bottom: 4px solid #d4af37 !important;
    padding: 0;
    top: 0;
}

.brand-text span {
    font-size: 1.5rem;
    letter-spacing: 1px;
    color: var(--white);
}

.reg-no {
    font-size: 0.7rem;
    color: var(--gold);
    letter-spacing: 2px;
}

.nav-link {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85) !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--gold) !important;
    transform: translateY(-2px);
}

/* --- Butang E-Penyata Beranimasi --- */
.btn-animated-epenyata {
    background: linear-gradient(-45deg, #d4af37, #f1c40f, #b8860b, #ffd700);
    background-size: 400% 400%;
    animation: gradient-flow 3s ease infinite;
    color: #064e3b !important; /* Emerald Green */
    font-weight: 800;
    padding: 15px 35px; /* Lebih besar */
    border-radius: 50px;
    border: 2px solid #000; /* Outer line hitam untuk butang */
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: transform 0.3s ease;
}

.btn-animated-epenyata:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Hero Section --- */
.hero-modern {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    overflow: hidden;
    background: #071c14; /* fallback while images load */
}

/* JS-driven crossfade layers */
.hero-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 0;
}
.hero-bg-layer.active { opacity: 1; }

.hero-modern .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dark gradient — cukup gelap untuk teks terbaca, gambar tetap jelas */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.25) 50%,
        rgba(0, 0, 0, 0.50) 100%
    );
    z-index: 1;
}

/* Gold accent line at the bottom of the hero */
.hero-modern::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, var(--gold) 70%, transparent 100%);
    z-index: 3;
}

.hero-modern .content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    padding: 20px;
}

/* --- Tipografi Hero (Penyelesaian Warna) --- */
.hero-modern h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 25px;
    text-transform: uppercase;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
}

/* --- Tambahan untuk mobile sahaja --- */
@media (max-width: 768px) {
    .hero-modern {
        min-height: 55vh;
        background-attachment: scroll;
        padding: 20px 0;
    }
    
    .hero-modern h1 {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
    }
    
    .hero-modern .lead {
        font-size: 0.8rem !important;
        margin-bottom: 20px !important;
        padding: 0 10px;
    }
    
    .hero-modern .content {
        padding: 10px !important;
        width: 100%;
    }
    
    .hero-modern .d-flex {
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px !important;
    }
    
    .btn-gold {
        font-size: 0.75rem !important;
        padding: 8px 12px !important;
        white-space: nowrap;
    }
    
    .hero-modern .btn-outline-light {
        font-size: 0.75rem !important;
        padding: 8px 12px !important;
        white-space: nowrap;
    }
    
    .badge-oval {
        font-size: 0.65rem !important;
        padding: 2px 8px !important;
        margin-bottom: 8px;
    }
    
    /* Pastikan teks KOPERASI KOMUNITI ISLAM tidak pecah teruk */
    .hero-modern h1 br {
        display: none;
    }
    
    .hero-modern h1 {
        display: flex;
        flex-direction: column;
    }
}

/* Baris 1: KOPERASI KOMUNITI ISLAM (GOLD) */
.text-gold-shiny {
    background: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine-text 5s linear infinite;
    display: inline-block;
}

/* Baris 2: BANDAR LAGUNA MERBOK (PUTIH) */
.text-white-solid {
    color: var(--white) !important;
    -webkit-text-fill-color: var(--white) !important; /* Batalkan kesan transparent h1 */
    background: none !important;
    display: inline-block;
    margin-top: 10px;
}

@keyframes shine-text {
    to { background-position: 200% center; }
}

.lead {
    font-size: 1.2rem;
    font-weight: 500;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

/* --- Butang Utama --- */
.btn-gold {
    background-color: var(--gold);
    color: var(--emerald);
    font-weight: 700;
    border: none;
    transition: 0.3s;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
}

.btn-gold:hover {
    background-color: white;
    transform: translateY(-3px);
}

.btn-animated-epenyata {
    white-space: nowrap; /* Menghalang teks E-Penyata daripada pecah baris */
    margin-left: 15px;    /* Memberi sedikit ruang dari menu terakhir */
}

/* --- WhatsApp Floating --- */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* --- Footer --- */
.footer-section {
    background-color: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 50px 0 20px 0;
    border-top: 5px solid var(--gold);
}

.copyright-text {
    font-size: 0.8rem;
}

/* Menjadikan Dropdown terbuka apabila Hover (Desktop) */
@media (min-width: 992px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0; 
        animation: fadeIn 0.3s;
    }
}

/* Gaya Kotak Sub-Menu */
.dropdown-menu {
    background-color: #fff;
    border: 1.5px solid var(--gold) !important;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.13);
    padding: 8px 0;
    margin-top: 2px !important;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333 !important;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 9px 16px;
    transition: background 0.18s, color 0.18s, transform 0.15s;
    white-space: normal;
    line-height: 1.35;
}

.dropdown-item:hover {
    background-color: rgba(6,78,59,0.07) !important;
    color: var(--emerald) !important;
    transform: translateX(3px);
}

/* Icon box — sama gaya seperti mega-link-icon */
.dd-icon {
    width: 28px; height: 28px;
    background: rgba(6,78,59,0.09);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    color: var(--emerald);
    flex-shrink: 0;
    transition: background 0.18s, color 0.18s;
}
.dropdown-item:hover .dd-icon {
    background: var(--emerald);
    color: #fff;
}

/* Lebar minimum dropdown biasa */
.nav-item.dropdown:not(.mega-nav-item) .dropdown-menu {
    min-width: 250px;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: rgba(6,78,59,0.12) !important;
    color: var(--emerald) !important;
}

.dropdown-header {
    color: var(--gold) !important;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    padding: 10px 20px 5px;
}

.dropdown-divider {
    border-color: #f0ede8 !important;
    margin: 4px 8px;
}

/* Animasi Fade In */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Gaya Kad Sijil */
.cert-card {
    background: white;
    border-radius: 12px;
    border-bottom: 5px solid var(--gold);
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cert-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.cert-icon {
    font-size: 3rem;
    color: var(--emerald);
    margin-bottom: 15px;
}

.cert-body {
    padding: 30px;
    text-align: center;
}

.report-card {
    border-left: 5px solid var(--emerald) !important;
    transition: transform 0.3s ease;
}

.report-card:hover {
    transform: translateX(10px);
    background-color: #f8f9fa;
}

.icon-box i {
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.1));
}

.btn-outline-success {
    border-color: var(--emerald);
    color: var(--emerald);
}

.btn-outline-success:hover {
    background-color: var(--emerald);
    color: white;
}

/* Gaya Butang Back to Top */
#btnBackToTop {
    display: none; /* Disembunyikan secara default */
    position: fixed;
    bottom: 110px; /* Kedudukan di atas butang WhatsApp */
    right: 40px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--gold);
    color: var(--emerald);
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

#btnBackToTop:hover {
    background-color: var(--emerald);
    color: var(--gold);
    transform: translateY(-5px);
}

/* Gaya Bicara Pengerusi */
.border-gold-frame {
    border: 8px solid white;
    outline: 2px solid var(--gold);
    z-index: 1; /* Memastikan gambar berada di atas bingkai */
    position: relative;
}

.pengerusi-img-wrapper {
    position: relative;
    display: inline-block;
}

.pengerusi-badge {
    /* Menukar daripada absolute kepada relative untuk susun di bawah */
    position: relative; 
    
    /* Margin negatif untuk bertindih sedikit di bawah gambar (adjust jika perlu) */
    margin-top: -10px; 
    
    /* Memusatkan badge di bawah gambar */
    margin-left: auto;
    margin-right: auto;
    
    /* Menetapkan lebar badge (seperti dalam imej dummy) */
    width: 80%; 
    max-width: 300px;
    
    background: var(--emerald); /* Hijau Gelap */
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    
    /* Border kiri emas yang unik */
    border-left: 5px solid var(--gold); 
    
    text-align: left; /* Teks kekal di kiri di dalam badge */
    
    /* Memastikan badge berada di atas imej dan shadow gambar */
    z-index: 10; 
}

.italic {
    font-style: italic;
}

.tracking-wider {
    letter-spacing: 2px;
}

.btn-outline-emerald {
    border: 2px solid var(--emerald);
    color: var(--emerald);
    font-weight: 700;
    transition: all 0.3s;
}

.btn-outline-emerald:hover {
    background: var(--emerald);
    color: white;
}

.speech-content p {
    font-size: 1.05rem;
    text-align: justify;
}

.text-gold {
    color: #d4af37; /* Warna emas KKIBLM */
}

.fw-semibold {
    font-weight: 600; /* Lebih nipis daripada bold biasa */
}

/* Memastikan susunan nama dan gelaran nampak harmoni */
.text-dark {
    color: #212529;
    line-height: 1.4;
}

.badge-oval {
    background-color: #FFD700; /* Warna kuning emas */
    color: #000;              /* Warna tulisan hitam supaya jelas */
    padding: 2px 15px;        /* Ruang atas-bawah dan kiri-kanan */
    border-radius: 50px;      /* Membuat bentuk bujur/oval */
    font-weight: bold;        /* Menebalkan tulisan */
    display: inline-block;    /* Memastikan padding berfungsi dengan baik */
    font-size: 0.85em;        /* Kecilkan sedikit supaya nampak kemas */
    margin-left: 5px;         /* Jarak dari perkataan sebelumnya */
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1); /* Sedikit bayangan supaya nampak timbul */
}

.map-container iframe {
    filter: grayscale(10%) contrast(1.1); /* Menjadikan peta nampak lebih korporat */
}

/* Gaya Imej Ahli */
.member-img-wrapper {
    width: 120px; /* Lebarkan sedikit supaya nampak lebih seimbang dengan kotak petak */
    height: 140px; /* Buat bentuk potret (tinggi sedikit) atau kekalkan 120px untuk petak sama sisi */
    margin: 0 auto 15px;
    position: relative;
    z-index: 2;
}

.member-img {
    width: 100%;
    height: 100%;
    /* 'cover' memastikan gambar memenuhi ruang tanpa penyek, 
       manakala 'center' memastikan muka berada di tengah */
    object-fit: cover; 
    object-position: center; 
    
    border-radius: 50%;
    border: 3px solid var(--gold);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #fff; /* Tukar ke putih supaya lebih bersih */
    
    /* Tambahkan ini jika gambar asal anda adalah jenis 'transparent' 
       dan anda mahu ia tidak menyentuh bingkai emas */
    padding: 2px; 
}

