/* Reset and Variables */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

:root {
    --primary-red: #d32f2f;
    --primary-hover: #b71c1c;
    --bg-color: #f4f7f9;
    --card-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-grey: #666666;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(211, 47, 47, 0.15);
    --border-radius: 12px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Hero Section */
.hero-header {
    background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url('hero-bg.png');
    background-size: cover;
    background-position: center;
    color: white;
    height: 70vh;
    min-height: 550px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-content { width: 100%; max-width: 800px; padding: 0 20px; }
.hero-content h1 { font-size: 2.5rem; margin-bottom: 16px; }
.hero-content p { font-size: 1.1rem; margin-bottom: 30px; opacity: 0.9; }

/* Search Bar */
.hero-search-container { position: relative; max-width: 580px; margin: 0 auto; }
.hero-search-container input {
    width: 100%; padding: 15px 25px; border-radius: 50px; border: none; outline: none;
    font-size: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.search-icon {
    position: absolute; right: 25px; top: 50%; transform: translateY(-50%);
    font-size: 1.4rem; color: var(--primary-red); cursor: pointer; transition: all 0.2s;
}
.search-icon:hover { transform: translateY(-50%) scale(1.1); }

/* Peta & Butang GPS */
#map-container { max-width: 900px; margin: 20px auto; padding: 0 20px; }
#map { height: 450px; width: 100%; border-radius: 15px; box-shadow: var(--shadow-soft); z-index: 1; }

#locate-btn {
    position: absolute; top: 20px; right: 40px; z-index: 1000;
    background: white; border: 2px solid var(--primary-red); color: var(--primary-red);
    width: 45px; height: 45px; border-radius: 50%; cursor: pointer;
    font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); transition: 0.3s;
}
#locate-btn:hover { background: var(--primary-red); color: white; transform: scale(1.1); }

/* Blue Pulse Dot */
.blue-dot {
    width: 15px; height: 15px; background-color: #2196F3;
    border: 3px solid white; border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.4);
    animation: pulse-animation 2s infinite;
}
@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0px rgba(33, 150, 243, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(33, 150, 243, 0); }
    100% { box-shadow: 0 0 0 0px rgba(33, 150, 243, 0); }
}

/* Cluster Colors */
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color: rgba(211, 47, 47, 0.6); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
    background-color: rgba(211, 47, 47, 0.9); color: white; font-weight: bold;
}

/* Layout & Cards */
.main-container { max-width: 900px; margin: 0 auto; padding: 20px; }
.status-bar { text-align: center; margin-bottom: 20px; color: var(--text-grey); font-weight: 500; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 20px; }
.card {
    background: white; padding: 20px; border-radius: 12px; box-shadow: var(--shadow-soft);
    display: flex; flex-direction: column; transition: 0.3s; border-top: 4px solid transparent;
}
.card:hover { transform: translateY(-5px); border-top-color: var(--primary-red); }
.pb-id { color: var(--primary-red); font-weight: bold; background: #ffebee; padding: 4px 8px; border-radius: 20px; font-size: 0.8rem; }
.pb-name { font-size: 1.1rem; font-weight: 700; margin: 10px 0; }
.route-btn {
    margin-top: auto; padding: 12px; background: var(--primary-red); color: white;
    border: none; border-radius: 8px; cursor: pointer; font-weight: 600;
}

/* Zone Filter & Pagination */
.zone-filter-container { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.zone-btn { padding: 8px 20px; border-radius: 30px; border: 2px solid var(--primary-red); background: white; color: var(--primary-red); cursor: pointer; font-weight: bold; }
.zone-btn.active { background: var(--primary-red); color: white; }
.pagination-container { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.page-btn { padding: 8px 15px; border: 1px solid #ddd; border-radius: 5px; cursor: pointer; background: white; }
.page-btn.active { background: var(--primary-red); color: white; border-color: var(--primary-red); }

@media (max-width: 768px) {
    /* TAMBAH INI UNTUK KECILKAN TAJUK PADA MOBILE */
    .hero-content h1 {
        font-size: 1.8rem; /* Saiz lebih kecil khusus untuk iPhone */
    }

    /* Kod asal anda di bawah kekal sama */
    .zone-filter-container {
        display: grid;
        grid-template-columns: repeat(4, 1fr); 
        gap: 10px;
        max-width: 320px; 
        margin: 25px auto 20px auto;
    }

    .zone-btn:first-child {
        grid-column: span 4; 
        width: 100%;
        border-radius: 30px;
        padding: 12px 20px;
        margin-bottom: 5px;
        font-size: 1rem;
    }
    
    .zone-btn:not(:first-child) {
        width: 60px;
        height: 60px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.2rem;
        margin: 0 auto;
    }

    .hero-header { height: 60vh; min-height: 450px; }
    #map { height: 350px; }

    /* Container utama menggunakan 4 lajur */
    .zone-filter-container {
        display: grid;
        grid-template-columns: repeat(4, 1fr); 
        gap: 10px;
        max-width: 320px; /* Lebar yang ideal untuk 4 butang bulat */
        margin: 25px auto 20px auto;
    }

    /* Butang "Semua Zon" merentasi semua 4 lajur di atas */
    .zone-btn:first-child {
        grid-column: span 4; 
        width: 100%;
        border-radius: 30px;
        padding: 12px 20px;
        margin-bottom: 5px; /* Jarak antara 'Semua' dan baris ABCD */
        font-size: 1rem;
    }
    
    /* Butang A, B, C, D menjadi baris yang kemas */
    .zone-btn:not(:first-child) {
        width: 60px; /* Saiz yang selesa untuk ditekan jari */
        height: 60px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.2rem;
        margin: 0 auto; /* Pastikan butang berada di tengah sel grid */
    }

    /* Kecilkan hero header sikit untuk fokus pada filter/map */
    .hero-header { height: 60vh; min-height: 450px; }
    #map { height: 350px; }
}