/* style.css - Modern, Elegant, Aesthetic, and Responsive */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    /* New Elegant Color Palette */
    --color-primary-dark: #2c3e50; /* Darker blue for main headers */
    --color-primary-light: #34495e;
    --color-secondary-blue: #3498db; /* For admin button, some borders */
    --color-secondary-green: #2ecc71; /* For submit button, 'Berangkat' */
    --color-secondary-orange: #e67e22; /* For filter button, 'Pulang' */
    --color-danger-red: #e74c3c; /* For delete button */

    --color-bg-body-start: #e0eafc; /* Lighter blue background start */
    --color-bg-body-end: #cfdef3;   /* Lighter blue background end */
    --color-bg-card: #ffffff;
    --color-bg-filter-section: #f0f4f8; /* Light background for filter area */

    --color-text-dark: #343a40;
    --color-text-light: #ffffff;
    --color-text-sub-header: #333; /* Darker text for sub-headers for better contrast */


    /* Gradients */
    --gradient-body: linear-gradient(135deg, var(--color-bg-body-start) 0%, var(--color-bg-body-end) 100%);
    --gradient-header-main-page: linear-gradient(135deg, #1d2b64 0%, #f8cdda 100%); /* Elegant Blue to Soft Pink for top page header */

    --gradient-table-header-main: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary-light) 100%); /* Dark blue for Angkutan, Total */
    --gradient-table-header-berangkat: linear-gradient(135deg, var(--color-secondary-green) 0%, #27ae60 100%); /* Green for Berangkat */
    --gradient-table-header-pulang: linear-gradient(135deg, var(--color-secondary-orange) 0%, #f39c12 100%); /* Orange for Pulang */

    /* Specific sub-header background colors - slightly darker for better contrast */
    --color-sub-header-bg-berangkat: #d4f2e6; /* Slightly darker light green */
    --color-sub-header-bg-pulang: #fff3e6;    /* Slightly darker light orange */

    --gradient-button-submit: linear-gradient(45deg, var(--color-secondary-green) 0%, #27ae60 100%);
    --gradient-button-admin: linear-gradient(45deg, var(--color-secondary-blue) 0%, #2980b9 100%);
    --gradient-button-filter: linear-gradient(45deg, var(--color-secondary-orange) 0%, #e06d15 100%);
    --gradient-button-delete: linear-gradient(45deg, var(--color-danger-red) 0%, #c0392b 100%);

    --gradient-radio-checked: linear-gradient(45deg, var(--color-secondary-blue) 0%, #00f2fe 100%);
    --gradient-table-footer: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%); /* Light blueish gradient for footer */

    /* Shadows */
    --shadow-soft: 0 8px 25px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 12px 35px rgba(0, 0, 0, 0.15);
    --shadow-input-focus: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);

    /* Borders & Radii */
    --border-radius-card: 18px;
    --border-radius-input: 12px;
    --border-radius-button: 35px;
    --color-border-light: #dee2e6;
    --color-border-table-header: rgba(255,255,255,0.15); /* Subtle white border for header cells */
    --color-border-table-sub-header: #c3d6e5; /* Darker border for sub-headers */
    --color-border-table-data: #e0e6ed; /* For body cells */
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--gradient-body);
    color: var(--color-text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* --- Header (Main page header - not table header) --- */
.header {
    width: 100%;
    padding: 25px 20px;
    background: var(--gradient-header-main-page);
    color: var(--color-text-light);
    text-align: center;
    box-shadow: var(--shadow-medium);
    margin-bottom: 30px;
    border-bottom-left-radius: var(--border-radius-card);
    border-bottom-right-radius: var(--border-radius-card);
    transition: all 0.3s ease;
}

.header h1 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 2.2rem;
}

/* --- Container (Form & Admin Panel) --- */
.container {
    max-width: 900px;
    width: 90%;
    margin: 30px auto;
    background-color: var(--color-bg-card);
    padding: 35px;
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-soft);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

h2 {
    color: var(--color-text-dark);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    font-size: 1.8rem;
    position: relative;
}
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient-header-main-page);
    margin: 10px auto 0;
    border-radius: 2px;
}
.section-title {
    margin-top: 40px;
}


/* --- Form Elements --- */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--color-text-dark);
    font-size: 1.05rem;
}

input[type="text"],
input[type="date"],
select.form-select,
input[type="text"][name="lain_lain_text"] {
    width: calc(100% - 24px);
    padding: 14px 12px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-input);
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: var(--color-text-dark);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M287%2C114.7L154.2%2C247.5c-4.4%2C4.4-11.4%2C4.4-15.8%2C0L5.4%2C114.7c-4.4-4.4-4.4-11.4%2C0-15.8l9.9-9.9c4.4-4.4%2C11.4-4.4%2C15.8%2C0L146.3%2C178L261.3%2C89c4.4-4.4%2C11.4-4.4%2C15.8%2C0l9.9%2C9.9C291.5%2C103.3%2C291.5%2C110.3%2C287%2C114.7z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

input[type="text"]:focus,
input[type="date"]:focus,
select.form-select:focus,
input[type="text"][name="lain_lain_text"]:focus {
    border-color: var(--color-secondary-blue);
    box-shadow: var(--shadow-input-focus);
    outline: none;
}

input[type="text"][name="lain_lain_text"] {
    margin-top: 15px;
    display: block;
}

/* --- Custom Radio Buttons --- */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 30px;
    margin-top: 10px;
}

.radio-group label {
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    color: var(--color-text-dark);
    user-select: none;
}

.radio-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.radio-group label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-secondary-blue);
    border-radius: 50%;
    background-color: var(--color-bg-card);
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.radio-group input[type="radio"]:checked + label::before {
    background: var(--gradient-radio-checked);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.radio-group label::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-light);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.radio-group input[type="radio"]:checked + label::after {
    opacity: 1;
}

.radio-group.transportasi-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}


/* --- Buttons --- */
.btn-submit {
    background: var(--gradient-button-submit);
    color: var(--color-text-light);
    padding: 15px 25px;
    border: none;
    border-radius: var(--border-radius-button);
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 600;
    display: block;
    width: 100%;
    margin-top: 35px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    opacity: 0.95;
}

.admin-link {
    text-align: center;
    margin-top: 30px;
}

.btn-admin {
    background: var(--gradient-button-admin);
    color: var(--color-text-light);
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius-button);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    opacity: 0.95;
}

/* Filter Form */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 40px;
    background-color: var(--color-bg-filter-section);
    padding: 25px;
    border-radius: var(--border-radius-card);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.filter-form .form-group {
    flex: 1;
    min-width: 180px;
    margin-bottom: 0;
}

.filter-form input[type="date"],
.filter-form select.form-select {
    width: 100%;
    padding: 12px 10px;
}

.btn-filter {
    background: var(--gradient-button-filter);
    color: var(--color-text-light);
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius-button);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    opacity: 0.9;
}


/* --- Alerts --- */
.alert {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: var(--border-radius-input);
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.5s ease-out;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Table Styling for Admin Panel --- */
.table-container {
    overflow-x: auto;
    margin-top: 25px;
    margin-bottom: 30px;
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-soft);
    background-color: var(--color-bg-card);
    transition: all 0.3s ease;
}

.table-container:hover {
    box-shadow: var(--shadow-medium);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    min-width: 600px; /* Diperkecil lagi karena kolom berkurang */
    border-radius: var(--border-radius-card);
    overflow: hidden;
}

/* Styling untuk header utama (Angkutan, Berangkat/Pulang, Total) */
table thead th {
    background: var(--gradient-table-header-main);
    color: var(--color-text-light);
    padding: 18px 15px;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-right: 1px solid var(--color-border-table-header);
    border-bottom: none;
}

table thead th:first-child {
    border-top-left-radius: var(--border-radius-card);
}
table thead tr:first-child th:last-child {
    border-top-right-radius: var(--border-radius-card);
    border-right: none;
}
table thead th.gradient-berangkat {
    background: var(--gradient-table-header-berangkat);
    color: var(--color-text-light);
}
table thead th.gradient-pulang {
    background: var(--gradient-table-header-pulang);
    color: var(--color-text-light);
}

/* Styling untuk sub-header (ASN, Non-ASN) */
table thead tr:nth-child(2) th {
    color: var(--color-text-sub-header); /* Warna teks sub-header */
    font-weight: 500;
    font-size: 0.9em;
    padding: 12px 8px;
    text-transform: none;
    letter-spacing: 0;
    border-top: none;
    border-bottom: 1px solid var(--color-border-table-sub-header);
    border-left: 1px solid var(--color-border-table-sub-header);
    border-right: 1px solid var(--color-border-table-sub-header);
}

table thead tr:nth-child(2) th.sub-header-berangkat {
    background-color: var(--color-sub-header-bg-berangkat);
}
table thead tr:nth-child(2) th.sub-header-pulang {
    background-color: var(--color-sub-header-bg-pulang);
}

/* Border adjustments for the 2 sub-headers (ASN, Non-ASN) */
table thead tr:nth-child(2) th:first-child { /* First sub-header (ASN) */
    border-left: none; /* Align with parent header */
}
table thead tr:nth-child(2) th:last-child { /* Last sub-header (Non-ASN) */
    border-right: 1px solid var(--color-border-table-sub-header); /* Tetap ada border kanan */
}


/* Styling untuk baris data tabel */
table tbody tr:nth-child(odd) {
    background-color: #fcfcfc;
}
table tbody tr:nth-child(even) {
    background-color: #f8f8f8;
}

table tbody tr:hover {
    background-color: #e0f2ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

/* Styling untuk sel data tabel */
table td {
    border: none;
    border-bottom: 1px solid var(--color-border-table-data);
    border-right: 1px solid var(--color-border-table-data);
    padding: 15px 12px;
    text-align: center;
    color: var(--color-text-dark);
}
table td:last-child { /* Last data cell in a row */
    border-right: none;
}
table tbody tr:last-child td {
    border-bottom: none;
}

/* Styling untuk footer tabel */
table tfoot th {
    background: var(--gradient-table-footer);
    color: var(--color-text-dark);
    font-weight: 700;
    padding: 20px 15px;
    border-top: 1px solid var(--color-border-table-data);
    border-bottom-left-radius: var(--border-radius-card);
    border-bottom-right-radius: var(--border-radius-card);
    text-align: center;
}
table tfoot th:first-child {
     border-bottom-left-radius: var(--border-radius-card);
}
table tfoot th:last-child {
     border-bottom-right-radius: var(--border-radius-card);
}

/* Delete Button in Table */
.btn-delete {
    background: var(--gradient-button-delete);
    color: var(--color-text-light);
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius-button);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .container {
        width: 95%;
        padding: 25px;
    }
    .header h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.6rem;
    }
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-form .form-group {
        min-width: unset;
        width: 100%;
    }
    .btn-filter {
        width: 100%;
    }
    table {
        min-width: 500px; /* Diperkecil lagi */
    }
    .full-data-table table {
        min-width: 700px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 20px 15px;
    }
    .header h1 {
        font-size: 1.8rem;
    }
    .container {
        padding: 20px;
        margin: 20px auto;
    }
    h2 {
        font-size: 1.4rem;
        margin-bottom: 25px;
    }
    .radio-group {
        flex-direction: column;
        gap: 12px;
    }
    .radio-group.transportasi-group {
        grid-template-columns: 1fr;
    }
    input[type="text"], input[type="date"], select.form-select, input[type="text"][name="lain_lain_text"] {
        padding: 12px 10px;
        font-size: 0.95rem;
    }
    .btn-submit, .btn-admin {
        font-size: 1.05rem;
        padding: 13px 20px;
    }
    table {
        min-width: 400px; /* Lebih kecil lagi */
    }
    .full-data-table table {
        min-width: 600px;
    }
    table thead th, table td, table tfoot th {
        padding: 10px 5px;
        font-size: 0.85rem;
    }
    .btn-delete {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    table thead tr:nth-child(2) th {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .header h1 {
        font-size: 1.5rem;
    }
    .container {
        padding: 15px;
        margin: 15px auto;
    }
    h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    .radio-group label {
        padding-left: 30px;
        font-size: 0.95rem;
    }
    .radio-group label::before {
        width: 20px;
        height: 20px;
    }
    .radio-group label::after {
        width: 7px;
        height: 7px;
        left: 6px;
    }
    .btn-submit, .btn-admin {
        font-size: 1rem;
        padding: 10px 15px;
    }
    table {
        min-width: 300px; /* Minimum untuk ponsel kecil */
    }
    .full-data-table table {
        min-width: 500px;
    }
    table thead th, table td, table tfoot th {
        font-size: 0.8rem;
        padding: 8px 4px;
    }
    .btn-delete {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    table thead tr:nth-child(2) th {
        font-size: 0.75em;
    }
}

/* Enhancing scrollbar for table container */
.table-container::-webkit-scrollbar {
    height: 8px;
    background-color: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--gradient-button-admin);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-button-admin);
    opacity: 0.9;
}