/* public/css/style.css */

/* Reset dasar */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 15px;
    margin-bottom: 20px;
    position: relative; /* Diubah untuk dashboard */
    align-items: flex-start; /* Diubah untuk dashboard */
}
.header .logo {
    width: 60px;
    height: auto;
}
.header h1 {
    color: #007bff;
    font-size: 24px;
    margin: 0;
}
.header h2 {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}
.header p {
    font-size: 14px;
    color: #555;
    margin: 0;
}

/* Style untuk pesan error */
.alert-error {
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    font-weight: 500;
}

/* Form */
form h3 {
    margin-top: 20px;
    margin-bottom: 15px;
    color: #333;
}
form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}
form input[type="text"],
form input[type="password"],
form input[type="number"],
form input[type="tel"],
form input[type="date"],
form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}
form hr {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 20px 0;
}

/* KUNCI INTERAKTIF: Peta */
#map {
    width: 100%;
    height: 350px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 15px;
    background-color: #e9e9e9;
}

/* Tombol */
.btn-pesan {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-pesan:hover {
    background-color: #218838;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #888;
}

/* KUNCI RESPONSIF: Aturan untuk layar HP (di bawah 600px) */
@media (max-width: 600px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    .header {
        flex-direction: column;
        text-align: center;
    }
    .header h1 {
        font-size: 20px;
    }
    .header h2 {
        font-size: 16px;
    }
    #map {
        height: 250px;
    }
}

/* =============== */
/* STYLE HALAMAN PELACAKAN  */
/* =============== */
.tracking-container {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #f9f9f9;
}
.tracking-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
}
.kode-pesanan {
    font-size: 1.1em;
    font-weight: 500;
    color: #555;
    background: #eee;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}
.status-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1.2em;
    font-weight: 600;
}
.status-info.status-success {
    background-color: #e6f7ec;
    border-color: #b7e1cd;
    color: #1f774a;
}
.status-info.status-error { /* Tambahan untuk status Batal */
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}
.spinner {
    width: 24px;
    height: 24px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#map-lacak {
    width: 100%;
    height: 350px; /* Diubah jadi 350px */
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-top: 20px;
    background-color: #e9e9e9;
}
#supir-info {
    margin-top: 15px;
    padding: 15px;
    background: #f0f7ff;
    border: 1px solid #b3d4fc;
    border-radius: 5px;
}
#supir-info h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0056b3;
}

/* =============== */
/* STYLE HALAMAN LOGIN  */
/* =============== */
.container-login {
    max-width: 500px;
}
.btn-login {
    background-color: #007bff;
}
.btn-login:hover {
    background-color: #0056b3;
}
.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}
.login-footer a {
    color: #007bff;
    text-decoration: none;
}
.login-footer a:hover {
    text-decoration: underline;
}

/* =============== */
/* STYLE DASHBOARD SUPIR */
/* =============== */
.btn-logout {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #dc3545;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.btn-logout:hover {
    background-color: #c82333;
}
.dashboard-content {
    padding: 10px;
}
.status-toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.2em;
}
.status-toggle-container label {
    margin-bottom: 0;
}
.status-toggle-container #status-text {
    font-weight: 700;
}
.status-text.status-offline {
    color: #dc3545;
}
.status-text.status-online {
    color: #28a745;
}
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}
input:checked + .slider {
    background-color: #28a745;
}
input:checked + .slider:before {
    transform: translateX(26px);
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}

/* =============== */
/* STYLE KARTU ORDER SUPIR */
/* =============== */
#order-container {
    margin-top: 20px;
}
.order-card,
.order-card-success {
    padding: 20px;
    border: 1px solid #007bff;
    background: #f0f7ff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.order-card h3 {
    margin-top: 0;
    color: #0056b3;
    font-size: 1.3em;
}
.order-card p {
    margin-bottom: 8px;
    font-size: 1.1em;
    line-height: 1.5;
}
.btn-terima-order {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-terima-order:hover {
    background-color: #218838;
}
.btn-terima-order:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}
.order-card-success {
    border-color: #28a745;
    background: #e6f7ec;
    text-align: center;
}
.order-card-success h3 {
    color: #1f774a;
    margin-top: 0;
}

/* =============== */
/* STYLE IKON SUPIR DI PETA */
/* =============== */
.supir-icon {
    font-size: 24px;
    text-shadow: 0 0 3px #000;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    padding: 2px;
}

/* =============== */
/* STYLE TUGAS AKTIF SUPIR */
/* =============== */
.order-card-active {
    padding: 20px;
    border: 1px solid #28a745;
    background: #f0fff4;
    border-radius: 8px;
}
.order-card-active h3 {
    margin-top: 0;
    color: #1f774a;
}
.order-card-active p {
    margin-bottom: 8px;
    font-size: 1.1em;
}
#map-supir {
    width: 100%;
    height: 350px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-top: 15px;
    margin-bottom: 15px;
}
.btn-selesai {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}
.btn-selesai:hover {
    background-color: #0056b3;
}
.btn-selesai:disabled {
    background-color: #aaa;
}
/* Tombol Batal (Supir & User) */
.btn-batal {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background-color: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: none; /* Sembunyi by default, JS akan tampilkan */
}
.btn-batal:hover {
    background-color: #f8d7da;
}
.btn-batal:disabled {
    color: #aaa;
    border-color: #aaa;
    background-color: transparent;
    cursor: not-allowed;
}

/* Tautan Login di index.php */
.login-link-container {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.login-link-container a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}
.login-link-container a:hover {
    text-decoration: underline;
}

/* Form Lacak Kode di index.php */
.lacak-form-container {
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
}
.lacak-form-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}
.lacak-form {
    display: flex;
    gap: 10px;
}
.lacak-form input[type="text"] {
    flex-grow: 1; 
    margin-bottom: 0; 
}
.btn-lacak {
    padding: 12px 20px;
    background-color: #17a2b8; 
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap; 
}
.btn-lacak:hover {
    background-color: #138496;
}
hr.divider-lacak { 
    margin-bottom: 30px;
}
/* Ubah H3 form pemesanan */
#formPemesanan h3 {
    text-align: center;
}
/* INI ADALAH LOKASI ERROR '}' KETIGA YANG SUDAH DIHAPUS *//* ... (kode CSS lain di atasnya) ... */

/* Tautan Login di index.php - STYLE BARU */
.login-link-container {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.login-link-container a {
    display: inline-block; /* Agar bisa diberi padding */
    padding: 10px 20px;
    color: #007bff;
    background-color: #f8f9fa; /* Latar belakang abu-abu muda */
    border: 1px solid #dee2e6; /* Border abu-abu */
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease; /* Efek hover */
}
.login-link-container a:hover {
    background-color: #e2e6ea; /* Warna hover sedikit lebih gelap */
    text-decoration: none;
}

/* ... (Kode CSS form lacak, dll) ... */
/* ... (Tambahkan di akhir style.css) ... */

/* =============== */
/* STYLE TIMELINE USER */
/* =============== */
.timeline {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    position: relative;
}
/* Garis vertikal timeline */
.timeline::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 20px; /* Sesuaikan posisi garis */
    width: 4px;
    background-color: #e9ecef;
}

.timeline-item {
    margin-bottom: 20px;
    position: relative;
    padding-left: 50px; /* Ruang untuk ikon */
    opacity: 0.5; /* Defaultnya redup */
    transition: opacity 0.3s ease;
}
.timeline-item.active {
    opacity: 1; /* Status aktif terang */
}
/* Status error (batal) */
.timeline-item.error .timeline-content strong {
    color: #dc3545;
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6c757d; /* Abu-abu default */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    z-index: 1;
}
/* Warna ikon saat aktif */
.timeline-item.active .timeline-icon {
    background-color: #007bff; /* Biru */
}
.timeline-item#status-selesai.active .timeline-icon {
    background-color: #28a745; /* Hijau untuk Selesai */
}
.timeline-item#status-dibatalkan.active .timeline-icon {
     background-color: #dc3545; /* Merah untuk Batal */
}


.timeline-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}
.timeline-content strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.1em;
}
.timeline-content p {
    margin: 0;
    color: #495057;
}

/* Tombol Refresh */
.btn-refresh {
     display: block;
     width: auto; /* Lebar otomatis */
     padding: 8px 15px;
     margin-bottom: 15px;
     background-color: #6c757d; /* Abu-abu */
     color: white;
     border: none;
     border-radius: 5px;
     font-size: 14px;
     cursor: pointer;
}
.btn-refresh:hover {
     background-color: #5a6268;
}
/* ... (Kode CSS Anda yang lain) ... */

/* =============== */
/* STYLE RIWAYAT SUPIR */
/* =============== */
hr.divider-section {
     border: 0;
     height: 2px;
     background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0));
     margin: 40px 0; /* Jarak pemisah */
}

.riwayat-container h3 {
     margin-bottom: 20px;
     text-align: center;
}

.filter-container {
     display: flex;
     flex-wrap: wrap; /* Agar responsif di layar kecil */
     gap: 15px;
     align-items: center;
     margin-bottom: 20px;
     padding: 15px;
     background-color: #f8f9fa;
     border-radius: 5px;
}
.filter-container label {
     margin-bottom: 0; /* Hapus margin default label */
     font-weight: 500;
}
.filter-container select {
     padding: 8px 12px;
     border: 1px solid #ced4da;
     border-radius: 4px;
     background-color: #fff;
}
.btn-filter, .btn-download {
     padding: 8px 15px;
     border: none;
     border-radius: 4px;
     color: white;
     cursor: pointer;
     font-size: 14px;
}
.btn-filter {
     background-color: #007bff; /* Biru */
}
.btn-filter:hover {
     background-color: #0056b3;
}
.btn-download {
     background-color: #28a745; /* Hijau */
     margin-left: auto; /* Dorong tombol download ke kanan */
}
.btn-download:hover {
     background-color: #218838;
}

/* Style tambahan untuk DataTables */
#tabel-riwayat_wrapper { /* Kontainer DataTables */
     margin-top: 10px;
}
#tabel-riwayat th, #tabel-riwayat td {
     font-size: 0.9em; /* Perkecil font tabel */
     padding: 8px 10px;
}
#tabel-riwayat thead th {
     background-color: #e9ecef;
     border-bottom: 2px solid #dee2e6;
}
/* Atur lebar kolom jika perlu */
/* #tabel-riwayat th:nth-child(1) { width: 15%; } */