/* assets/css/style.css */
:root {
    --bg-color: #f4f1ea;
    --primary-color: #0077b6;
    --secondary-color: #6c757d; /* A neutral gray for cancel buttons */
    --text-color: #333;
    --border-color: #ccc;
    --danger-color: #e76f51;
    --success-color: #2a9d8f;
    --header-bg: #ffffff;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main { flex: 1; }
.container { width: 90%; max-width: 1200px; margin: 2rem auto; padding: 1rem; }
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 1rem; }
.login-form { background: #fff; padding: 2.5rem; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 100%; max-width: 400px; text-align: center; }
.logo { max-width: 180px; margin-bottom: 1rem; }
.header-logo { max-height: 40px; }
.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; }
input[type="text"], input[type="password"], input[type="email"], select, textarea { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 5px; box-sizing: border-box; transition: border-color 0.3s; font-family: inherit; font-size: 1rem; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-color); outline: none; }
.btn, button { display: inline-block; width: auto; padding: 10px 20px; border: none; border-radius: 5px; color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; transition: background-color 0.3s ease; }
form button[type="submit"] { width: 100%; } /* Make main form buttons full-width */
.btn-primary { background-color: var(--primary-color); }
.btn-primary:hover { background-color: #005a8d; }
.btn-success { background-color: var(--success-color); }
.btn-success:hover { background-color: #218274; }
.btn-secondary { background-color: var(--secondary-color); }
.btn-secondary:hover { background-color: #5a6268; }
.alert { padding: 1rem; margin-bottom: 1rem; border-radius: 4px; border: 1px solid transparent; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.main-header { background: var(--header-bg); box-shadow: 0 2px 4px rgba(0,0,0,0.05); padding: 0 5%; }
.header-container { display: flex; justify-content: space-between; align-items: center; height: 60px; }
.logo-container { display: flex; align-items: center; }
.app-name { font-weight: bold; margin-left: 15px; font-size: 1.2rem; color: var(--primary-color); }
.main-header nav a { margin-left: 20px; text-decoration: none; color: var(--text-color); font-weight: 500; }
.main-footer { text-align: center; padding: 1rem; margin-top: 2rem; background: #e9e6e1; font-size: 0.9rem; }
.card { background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.05); margin-bottom: 20px; }
.search-result-card { border: 1px solid #eee; padding: 15px; border-radius: 5px; margin-top: 15px; }
.log-access-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
.radio-group { display: flex; gap: 20px; }
/* Modal Styles */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: #fff; padding: 2rem; border-radius: 8px; width: 90%; max-width: 400px; text-align: center; }
.modal-buttons { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 768px) {
    .header-container { flex-direction: column; height: auto; padding: 10px 0; }
    .main-header nav { margin-top: 10px; }
    .main-header nav a { margin: 0 10px; }
}

/* --- User Table Styles --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.user-table th, .user-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
.user-table th {
    background-color: #f4f4f4;
    font-weight: 600;
}
.user-table tr:hover {
    background-color: #f9f9f9;
}
.user-table .btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

/* --- Status Badge Styles --- */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-undefined { background-color: #6c757d; }
.status-authorized { background-color: #2a9d8f; }
.status-vip { background-color: #e76f51; }
.status-membership { background-color: #fca311; }
.status-agreement { background-color: #1d3557; }


/* --- Responsive Table for Mobile --- */
@media (max-width: 768px) {
    .user-table thead {
        display: none;
    }
    .user-table, .user-table tbody, .user-table tr, .user-table td {
        display: block;
        width: 100%;
    }
    .user-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
    }
    .user-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #eee;
    }
    .user-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        text-align: left;
        font-weight: 600;
    }
    .user-table td:last-child {
        border-bottom: 0;
    }
    .search-form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .search-form button {
        width: 100%;
    }
}

/* --- Back Link Style --- */
.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.back-link:hover {
    text-decoration: underline;
}

/* --- Pagination Controls --- */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}
.pagination-summary {
    font-weight: 600;
    color: var(--text-color);
}
.pagination-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.pagination-btn {
    min-width: 40px;
}
.pagination-btn.active,
.pagination-btn:disabled,
.pagination-btn.disabled {
    background-color: var(--primary-color);
    opacity: 0.75;
    cursor: default;
}

/* --- Toggle Switch for "Deny Access" --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    vertical-align: middle;
}
.toggle-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;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--danger-color);
}
input:checked + .slider:before {
    transform: translateX(26px);
}
.toggle-label {
    margin-left: 10px;
    vertical-align: middle;
}

/* --- Report Filter Form Styles --- */
.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.filter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.filter-group .form-group {
    flex: 1;
    min-width: 200px;
}
input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    position: relative;
}

/* --- Password Generator and Strength Bar --- */
.password-wrapper {
    display: flex;
    gap: 10px;
}
.password-wrapper input {
    flex-grow: 1;
}
.password-wrapper button {
    flex-shrink: 0;
    width: auto; /* Override default full-width */
}
.password-strength-bar {
    height: 8px;
    background-color: #eee;
    margin-top: 8px;
    border-radius: 4px;
    overflow: hidden;
}
.strength-meter {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}
.strength-meter.weak { background-color: #e74c3c; } /* Red */
.strength-meter.medium { background-color: #f1c40f; } /* Yellow */
.strength-meter.strong { background-color: #2ecc71; } /* Green */
.strength-meter.very-strong { background: linear-gradient(to right, #2ecc71, #27ae60); } /* Darker Green */

/* --- Page Header with Actions --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0; /* h1 has its own margin */
}
.page-header h1 {
    margin-bottom: 0;
}
.header-actions {
    display: flex;
    gap: 1rem;
}
.action-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.action-icon svg {
    width: 16px;
    height: 16px;
}

/* --- Modal Close Button --- */
.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
}
.close-modal-btn:hover {
    color: #333;
}

/* --- Report Tabs --- */
.tabs-nav {
    border-bottom: 2px solid #ddd;
    margin-bottom: 1.5rem;
}
.tab-link {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-bottom: 0;
    margin-bottom: -2px;
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 600;
}
.tab-link.active {
    border-color: #ddd;
    border-bottom: 2px solid var(--bg-color);
    border-radius: 5px 5px 0 0;
    background: var(--bg-color);
    color: var(--primary-color);
}

/* --- Filter Actions --- */
.filter-actions {
    display: flex;
    gap: 1rem;
}
.filter-actions .btn {
    width: auto;
}

/* --- Pagination --- */
.pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 5px;
}
.page-link {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: var(--primary-color);
    border-radius: 4px;
}
.page-link:hover {
    background-color: #f4f4f4;
}
.page-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* --- Clickable Table Row --- */
.clickable-row {
    cursor: pointer;
}
.clickable-row:hover {
    background-color: #eaf6ff !important;
}

/* --- Import Form --- */
.import-form {
    margin-top: 1.5rem;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}
.form-control-file {
    border: 1px solid #ccc;
    display: block;
    padding: 10px;
    width: 100%;
    border-radius: 5px;
    background: #fff;
}
.import-form button {
    margin-top: 1rem;
    width: auto; /* Make the import button not full-width */
}

/* --- Action Buttons in Tables --- */
.action-buttons {
    display: flex;
    gap: 5px;
}
.action-buttons .btn-sm {
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-danger {
    background-color: var(--danger-color);
}
.btn-danger:hover {
    background-color: #c94a29;
}

/* --- Dynamic Form Sections --- */
.dynamic-section, .dynamic-subsection {
    border-left: 3px solid #0077b6;
    padding-left: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}
.payment-details {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}
.price-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--success-color);
    margin-bottom: 1rem;
    text-align: right;
}

/* --- Bulk Actions --- */
.bulk-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}
.bulk-actions button {
    width: auto;
}

/* Adjustments for report tables */
.user-table th:first-child, .user-table td:first-child {
    /* Remove fixed width to allow content to determine size */
    white-space: nowrap; /* Prevent date and time from wrapping */
}

.user-table th:first-child, .user-table td:first-child {
    padding-left: 15px;
}

.user-table td:first-child:before {
    content: "" !important; /* Hide the data-label for the checkbox column on mobile */
}

/* Add these new styles to the end of assets/css/style.css */

/* --- Ticket Type Badge Styles --- */
.ticket-type-payment {
    background-color: var(--success-color);
}
.ticket-type-agreement {
    background-color: var(--primary-color);
}

/* Daily Authorization Status in Search Results */
.daily-status {
    display: block;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-weight: bold;
    color: #fff;
    text-align: center;
}
.daily-status.authorized {
    background-color: var(--success-color); /* Teal */
}
.daily-status.unauthorized {
    background-color: #fca311; /* Orange/Yellow */
}
.daily-status.access-denied-permanent {
    background-color: var(--danger-color); /* Red */
}

/* Edit Plate Button */
.btn-edit-plate {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
    text-decoration: underline;
}
.btn-edit-plate:hover {
    color: #005a8d;
}

/* Modal Close Button */
.modal-close-btn {
    /* Uses existing btn-secondary styles */
}