@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
    --primary: #2c3e50;
    --accent: #e74c3c;
    --bg: #fdfdfd;
    --glass: rgba(255, 255, 255, 0.9);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; }

body { background-color: var(--bg); color: var(--primary); display: flex; flex-direction: column; min-height: 100vh; }

/* Utility */
.container { max-width: 800px; margin: 0 auto; padding: 20px; width: 100%; padding-bottom: 100px; }
.btn { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; transition: 0.3s; font-weight: 600; }
.btn-primary { background: var(--primary); color: white; }
.btn-accent { background: var(--accent); color: white; }
.hidden { display: none !important; }

/* FIX IPHONE ZOOM & FORM STYLING */
.input-group { margin-bottom: 15px; }
input, select, textarea { 
    font-size: 16px !important; /* Mencegah zoom di iOS */
    width: 100%; 
    padding: 12px; 
    border: 1px solid #eee; 
    border-radius: 10px; 
    background: #f9f9f9;
    margin-top: 5px; 
    outline: none; 
}
.input-group label { font-size: 0.8rem; color: #888; font-weight: 600; margin-left: 2px;}

/* Landing Page */
.hero { height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: radial-gradient(circle at center, #f0f0f0, #ffffff); }
.hero h1 { font-size: 2.5rem; margin-bottom: 10px; letter-spacing: -1px; }
.login-box { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); margin-top: 20px; width: 300px; }

/* Dashboard Tabs */
.nav-tabs { display: flex; gap: 10px; margin-bottom: 20px; justify-content: center; }
.tab-btn { background: transparent; color: #888; border-bottom: 2px solid transparent; border-radius: 0; padding-bottom: 5px; }
.tab-btn.active { color: var(--primary); border-bottom: 2px solid var(--primary); font-weight: 600; }

/* Cards & Summary */
.card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.03); margin-bottom: 20px; border: 1px solid #f0f0f0; }
.summary-box { display: flex; justify-content: space-between; margin-bottom: 10px; }
.summary-item h3 { font-size: 0.8rem; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }
.summary-item p { font-size: 1.4rem; font-weight: 600; }
.income { color: #27ae60; }
.expense { color: #c0392b; }

/* Filter Bar */
.filter-bar { display: flex; gap: 10px; margin-bottom: 0; }

/* --- NEW MODERN LIST DESIGN --- */
.trans-item { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #f7f7f7; }
.trans-item:last-child { border-bottom: none; }
.trans-left { display: flex; align-items: center; gap: 12px; flex: 1; }

.trans-icon {
    width: 42px; height: 42px;
    background-color: #f0f3f5; color: var(--primary);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.trans-info h4 { font-size: 0.95rem; margin-bottom: 2px; color: #2c3e50; }
.trans-info p { font-size: 0.75rem; color: #95a5a6; margin: 0; }
.trans-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }

.amount { font-weight: 600; font-size: 0.95rem; }
.payer-badge { font-size: 0.65rem; background-color: #f0f2f5; color: #555; padding: 2px 8px; border-radius: 10px; margin-top: 4px; display: inline-block; font-weight: 500; }

/* --- SPLIT BILL WIDGET --- */
.split-card { background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 8px; border: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.split-user { font-weight: 600; font-size: 0.9rem; color: #34495e; }
.split-status { font-size: 0.75rem; font-weight: bold; }
.split-status.plus { color: #27ae60; background: #e8f8f5; padding: 4px 8px; border-radius: 6px; }
.split-status.minus { color: #c0392b; background: #fdedec; padding: 4px 8px; border-radius: 6px; }

/* FAB & Modal */
.fab { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background-color: var(--accent); color: white; border-radius: 50%; border: none; box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4); font-size: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 100; transition: transform 0.2s; }
.fab:active { transform: scale(0.9); }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 200; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(3px); }
.modal-box { background: white; padding: 25px; border-radius: 15px; width: 90%; max-width: 400px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); position: relative; animation: popUp 0.3s ease-out; max-height: 90vh; overflow-y: auto; }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; cursor: pointer; color: #888; }
@keyframes popUp { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Settings List */
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill-item { background: #f8f9fa; border: 1px solid #ddd; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; display: flex; align-items: center; gap: 8px; }
.pill-delete { color: #e74c3c; cursor: pointer; font-weight: bold; }

/* --- TIMELINE TRIP STYLE --- */

.timeline-container {
    padding: 10px 0;
    position: relative;
}

/* Garis Vertikal di Tengah */
.timeline-line {
    position: absolute;
    left: 65px; /* Posisi garis dari kiri */
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.timeline-row {
    display: flex;
    position: relative;
    margin-bottom: 25px;
    z-index: 1;
}

/* Kolom Waktu (Kiri) */
.time-col {
    width: 60px;
    text-align: right;
    padding-right: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 5px;
}
.time-start { font-weight: 700; font-size: 0.9rem; color: #2c3e50; }
.time-dur { font-size: 0.7rem; color: #95a5a6; }

/* Kolom Ikon (Tengah) */
.icon-col {
    width: 40px;
    display: flex;
    justify-content: center;
    padding-top: 0px; /* Biar sejajar sama jam */
}
.trip-icon-circle {
    width: 35px; height: 35px;
    border-radius: 50%;
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background: var(--accent); /* Default color */
}

/* Warna-warni Icon berdasarkan tipe */
.bg-flight { background: #3498db; }    /* Biru */
.bg-hotel { background: #9b59b6; }     /* Ungu */
.bg-food { background: #e67e22; }      /* Orange */
.bg-attraction { background: #27ae60; } /* Hijau */
.bg-transport { background: #f1c40f; color:#444; } /* Kuning */

/* Kolom Konten (Kanan) */
.content-col {
    flex: 1;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-left: 10px;
    border: 1px solid #f0f0f0;
    position: relative;
}

/* Style untuk Plan Alternatif */
.content-col.is-alt {
    border: 1px dashed #f39c12;
    background: #fffcf5;
}
.badge-alt {
    background: #f39c12; color: white;
    font-size: 0.6rem; padding: 2px 6px;
    border-radius: 4px; text-transform: uppercase;
    margin-left: 5px; vertical-align: middle;
}

/* Style untuk Event yang SUDAH LEWAT (Completed) */
.timeline-row.completed { opacity: 0.6; filter: grayscale(80%); }
.timeline-row.completed .content-col { background: #f9f9f9; box-shadow: none; }

/* Tombol Edit Kecil */
/* --- Update Gaya Tombol Edit Trip --- */
.btn-edit-trip {
    position: absolute;
    top: 15px;            /* Jarak dari atas */
    right: 15px;          /* Jarak dari kanan */
    width: 35px;          /* Lebar tombol */
    height: 35px;         /* Tinggi tombol */
    background-color: #f8f9fa; /* Warna background abu muda */
    border: 1px solid #e0e0e0;
    border-radius: 50%;   /* Membuatnya jadi bulat */
    color: #555;
    font-size: 16px;      /* Ukuran ikon */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Bayangan tipis */
}

/* Efek saat dipencet / hover */
.btn-edit-trip:active, .btn-edit-trip:hover {
    background-color: var(--primary); /* Berubah jadi warna tema */
    color: white;
    border-color: var(--primary);
    transform: scale(1.1); /* Membesar sedikit */
}

/* --- CSS BARU UNTUK GROUPING --- */

/* Wrapper untuk kolom konten agar bisa menampung Main + Alts */
.content-col-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Jarak antara Utama dan list Alternatif */
    position: relative;
    margin-left: 10px;
}

/* Card Utama (Tetap menggunakan style .content-col lama, tapi kita paksa full width) */
.main-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    position: relative;
    width: 100%;
}

/* Container untuk List Alternatif */
.alt-group-container {
    background: #fdfdfd;
    border: 1px dashed #ddd;
    border-radius: 10px;
    padding: 10px;
    margin-top: -5px; /* Sedikit naik biar nempel */
    position: relative;
}
/* Garis penyambung visual (opsional) */
.alt-group-container::before {
    content: '↳ Alternatif';
    font-size: 0.7rem;
    color: #aaa;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

/* Item Alternatif Kecil */
.alt-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 6px;
    transition: 0.2s;
}
.alt-item-row:last-child { margin-bottom: 0; }
.alt-item-info h4 { font-size: 0.85rem; margin: 0; color: #555; }
.alt-item-info p { font-size: 0.7rem; color: #999; margin: 0; }

/* Tombol Jadikan Utama */
.btn-promote {
    background: #eef2f5;
    color: #27ae60;
    border: 1px solid #dcdcdc;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.65rem;
    cursor: pointer;
    font-weight: 600;
}
.btn-promote:hover { background: #27ae60; color: white; border-color: #27ae60; }

/* Sembunyikan content-col biasa di dalam struktur baru ini jika konflik */
.timeline-row .content-col { margin-left: 0; }