/* =========================================
   1. VARIABEL WARNA (TEMA APLIKASI)
   ========================================= */
:root {
    --primary: #0088cc;       /* Biru Laut Utama */
    --primary-dark: #005f8f;  /* Biru Gelap untuk Gradient */
    --accent: #FFD700;        /* Kuning Emas (Semut Mutiara) */
    --bg-body: #f4f7f6;       /* Abu-abu muda background */
    --surface: #ffffff;       /* Warna Putih Kotak */
    --text-main: #333333;     /* Warna Teks Utama */
}

/* =========================================
   2. GLOBAL STYLE
   ========================================= */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    padding-bottom: 90px; /* Memberi ruang agar konten tidak tertutup menu bawah */
    overflow-x: hidden;   /* Mencegah geser kanan-kiri */
    margin: 0;
}

a { text-decoration: none; }

/* =========================================
   3. PRELOADER (ANIMASI MASKOT)
   ========================================= */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 100%);
    z-index: 9999;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    transition: opacity 0.5s ease-out;
}

.mascot-loader {
    width: 150px;
    animation: sailing 2s infinite ease-in-out;
}

.loading-text {
    margin-top: 20px; font-weight: 600; color: var(--primary-dark);
    letter-spacing: 1px; animation: pulse 1.5s infinite;
}

/* Animasi Mengapung (Sailing) */
@keyframes sailing {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

/* Animasi Kedip Teks */
@keyframes pulse { 
    0% { opacity: 0.6; } 
    50% { opacity: 1; } 
    100% { opacity: 0.6; } 
}

/* =========================================
   4. HEADER ATAS (HERO SECTION)
   ========================================= */
.app-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 20px 20px 60px 20px; /* Padding bawah besar untuk tempat menu floating */
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    position: relative;
    color: white;
}

.top-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
}

.logo-img { 
    height: 40px; 
    filter: brightness(0) invert(1); /* Membuat logo otomatis jadi putih */
}

.greeting h5 { font-weight: 700; margin: 0; }
.greeting p { font-size: 0.8rem; margin: 0; opacity: 0.9; }

/* =========================================
   5. MENU UTAMA (KOTAK MELAYANG)
   ========================================= */
.main-menu-card {
    background: var(--surface);
    margin: -40px 15px 15px 15px; /* Margin minus membuat naik ke atas header */
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    position: relative;
    z-index: 10;
}

.menu-grid {
    display: grid; 
    grid-template-columns: repeat(4, 1fr); /* 4 Kolom */
    gap: 15px;
}

.menu-item {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    color: var(--text-main);
}

.icon-box {
    width: 50px; height: 50px;
    border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: 8px;
    transition: transform 0.2s;
}

.menu-item:active .icon-box { transform: scale(0.9); }
.menu-label { font-size: 0.7rem; font-weight: 500; text-align: center; }

/* Warna-warni Icon Menu */
.ic-ticket { background: #e3f2fd; color: #2196f3; }
.ic-jadwal { background: #e8f5e9; color: #4caf50; }
.ic-cargo  { background: #fff3e0; color: #ff9800; }
.ic-promo  { background: #fce4ec; color: #e91e63; }

/* =========================================
   6. MEMBER CARD AREA
   ========================================= */
.member-card {
    margin: 15px;
    
    /* HAPUS atau KOMENTARI warna solid ini jika pakai gambar */
    /* background-color: var(--primary-dark); */ 

    /* AKTIFKAN BARIS INI (Hapus tanda komentar / slash bintang) */
    background: url('../img/bg-member.png') center/cover no-repeat; 
    
    /* Supaya teks tetap terbaca jelas di atas gambar */
    position: relative;
    border-radius: 20px;
    padding: 20px;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 136, 204, 0.3);
}

.member-overlay {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: rgba(0, 95, 143, 0.8); /* Overlay biru transparan */
    z-index: 1;
}

.member-content { 
    position: relative; 
    z-index: 2; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
}

/* Tombol Generate QR */
.btn-qr-generate {
    background: var(--accent);
    color: var(--primary-dark);
    border: none;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
    transition: all 0.3s;
    display: flex; align-items: center; gap: 8px;
}
.btn-qr-generate:active { transform: scale(0.95); }

/* =========================================
   7. PROMO HORIZONTAL SCROLL
   ========================================= */
.section-header { 
    padding: 0 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 10px; 
}

.section-title { font-weight: 700; font-size: 1.1rem; margin: 0; }
.see-all { font-size: 0.8rem; color: var(--primary); }

.promo-scroll {
    display: flex; 
    overflow-x: auto; 
    padding: 0 15px 20px 15px; 
    gap: 15px;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none; scrollbar-width: none; /* Sembunyikan scrollbar */
}
.promo-scroll::-webkit-scrollbar { display: none; }

.promo-card {
    min-width: 280px;
    background: white; border-radius: 15px; overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    scroll-snap-align: center;
}

.promo-img { width: 100%; height: 120px; object-fit: cover; }
.promo-body { padding: 12px; }
.promo-tag { 
    font-size: 0.65rem; background: #fff3e0; 
    color: #ff9800; padding: 3px 8px; border-radius: 4px; font-weight: bold;
}

/* =========================================
   8. BOTTOM NAVIGATION (MENU BAWAH)
   ========================================= */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: white;
    height: 70px;
    display: flex; justify-content: space-around; align-items: center;
    border-top-left-radius: 20px; border-top-right-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    z-index: 100;
}

.nav-item {
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none; color: #999; font-size: 0.7rem;
    position: relative;
    width: 20%;
}

.nav-item i { font-size: 1.4rem; margin-bottom: 4px; transition: 0.2s; }

/* Efek saat menu aktif */
.nav-item.active { color: var(--primary); font-weight: 600; }
.nav-item.active i { transform: translateY(-3px); }

/* Tombol Tengah Melayang (SCAN) */
.nav-scan-wrapper { position: relative; top: -25px; }

.nav-scan-btn {
    width: 60px; height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.8rem;
    box-shadow: 0 10px 20px rgba(0, 136, 204, 0.4);
    border: 5px solid var(--bg-body); /* Border tebal agar terlihat terpisah */
}

/* =========================================
   9. MODAL QR STYLING
   ========================================= */
.qr-modal-body { text-align: center; padding: 30px; }

.qr-placeholder {
    width: 200px; height: 200px; margin: 0 auto;
    border: 2px dashed #ccc; 
    display: flex; align-items: center; justify-content: center;
    background: #f9f9f9;
}

.dashed { border-top: 2px dashed #ccc; background: none; opacity: 0.5; }