/* Reset & Fondasi Halaman */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #e8f5e9; /* Warna latar belakang hijau rumput pucat */
    overflow-x: hidden;
    padding: 20px;
}

.map-title {
    text-align: center;
    color: #1b5e20;
    margin-bottom: 40px;
    font-size: 24px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Pembungkus Peta Utama */
.map-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
}

/* Kisi Grid Peta Efek Isometrik 3D */
.farm-map {
    display: grid;
    grid-template-columns: repeat(3, 180px); /* 3 Kolom */
    grid-template-rows: repeat(2, 180px);    /* 2 Baris (Total 6 Zona) */
    gap: 30px;
    padding: 40px;
    background: #c8e6c9; /* Warna tanah/alas perkebunan */
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* TRICK ISOMETRIK HAY DAY */
    transform: rotateX(55deg) rotateZ(-45deg);
    transform-style: preserve-3d;
    transition: all 0.5s ease;
}

/* Desain Kartu Setiap Zona */
.zone {
    background: #a5d6a7;
    border: 4px solid #81c784;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    box-shadow: 0 8px 0 #66bb6a; /* Efek tebal 3D di bawah kartu */
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

/* Efek Hover Saat Zona Ditunjuk */
.zone:hover {
    background: #81c784;
    box-shadow: 0 4px 0 #4caf50;
    transform: translateZ(15px); /* Zona terlihat terangkat naik ke atas */
}

/* Mengembalikan Animasi & Teks agar Tetap Tegak (Tidak Ikut Miring) */
.animation-wrapper, .zone-label {
    transform: rotateZ(45deg) rotateX(-55deg);
}

/* Ukuran Wadah Animasi */
.animation-wrapper {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.animation-wrapper lottie-player {
    width: 120%;
    height: 120%;
}

/* Label Nama Zona */
.zone-label {
    position: absolute;
    bottom: -15px;
    background: #1b5e20;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Warna Pembeda Khusus Zona Office */
.zone.office {
    background: #90caf9;
    border-color: #64b5f6;
    box-shadow: 0 8px 0 #42a5f5;
}
.zone.office:hover {
    background: #64b5f6;
    box-shadow: 0 4px 0 #2196f3;
}
.zone.office .zone-label {
    background: #0d47a1;
}

/* RESPONSIVE LAYOUT: Menjadi 1 Kolom Tegak jika di Layar HP */
@media (max-width: 768px) {
    .farm-map {
        transform: none; /* Matikan efek isometrik di HP agar mudah diklik */
        grid-template-columns: repeat(2, 150px); /* Ubah jadi 2 kolom sejajar */
        grid-template-rows: auto;
        gap: 20px;
        background: transparent;
        box-shadow: none;
    }
    
    .animation-wrapper, .zone-label {
        transform: none; /* Normalkan kembali orientasi objek */
    }
    
    .zone {
        box-shadow: 0 4px 0 #66bb6a;
        height: 150px;
    }
    
    .zone.office {
        box-shadow: 0 4px 0 #42a5f5;
    }
}


/* --- GAYA MODAL POP-UP --- */

/* Latar Belakang Gelap (Overlay) */
.modal {
    display: none; /* Tersembunyi secara default */
    position: fixed;
    z-index: 9999; /* Berada di paling atas lapisan layar */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Efek gelap transparan */
    backdrop-filter: blur(4px); /* Efek blur di latar belakang */
    animation: fadeIn 0.3s ease-out;
}

/* Kotak Konten Modal */
.modal-content {
    background-color: #ffffff;
    margin: 10% auto; /* Jarak 10% dari atas, otomatis rata tengah kiri-kanan */
    padding: 30px;
    border-radius: 20px;
    width: 85%;
    max-width: 550px; /* Lebar maksimal kotak */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Tombol Tutup (X) */
.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #888;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #d32f2f; /* Berubah merah saat diarahkan kursor */
}

/* Gaya Teks di Dalam Modal (Output dari PHP) */
#modal-body h2 {
    color: #1b5e20;
    font-size: 24px;
    margin-bottom: 15px;
    border-bottom: 2px solid #c8e6c9;
    padding-bottom: 10px;
}

#modal-body p {
    color: #444;
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 12px;
}

/* Badge Status Panen/Operasional */
.badge {
    background-color: #2e7d32;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.loading-spinner {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px 0;
}

/* --- ANIMASI CSS --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        transform: translateY(50px); 
        opacity: 0;
    }
    to { 
        transform: translateY(0); 
        opacity: 1;
    }
}

