.cold-penalty-lookup {
    /* max-width: 600px; */
    /* margin: .5em auto; */
    padding: 20px;
    background: #fff;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border: 1px solid var(--scheme-color);
    /* box-shadow: 0 3px 5px gainsboro; */
}

.cpl-form {
    margin-bottom: 0;
}

.cpl-form-title {
    text-align: center;
    font-size: 1.8rem;
}

/* Form Styles */
/* .cpl-form-group {
    margin-bottom: 1.5em;
} */

.cpl-form-group label:not(.form-check-label) {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.cpl-form-group select,
.cpl-form-group input:not(.form-check-input) {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-shadow: none;
}

.cpl-form-group input:focus {
    color: #212529;
    background-color: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

.cpl-submit,
.cpl-download-btn {
    background: var(--scheme-color);
    color: #fff;
    padding: 8px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.cpl-submit:hover {
    background: var(--scheme-color);
    opacity: .9;
}

.cpl-submit:disabled,
.cpl-download-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.cpl-download-btn {
    background: #198754;
    color: #fff;
    border: 1px solid #198754;
}

.cpl-download-btn:hover {
    background: #198754;
    opacity: .9;
}
/* Loading State */
.cpl-loading .cpl-submit,
.cpl-loading .cpl-force-update-btn {
    pointer-events: none;
    opacity: 0.7;
}

.cpl-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: cpl-spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes cpl-spin {
    to { transform: rotate(360deg); }
}

/* Results loading state */
.cpl-results.cpl-loading {
    position: relative;
    min-height: 100px;
}

.cpl-results.cpl-loading:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

.cpl-results.cpl-loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -20px;
    margin-left: -20px;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: cpl-spin 1s linear infinite;
    z-index: 2;
}

/* Results Styles */
.cpl-results {
    display: none;
    margin-top: 1em;
}

.cpl-success,
.cpl-error {
    padding: 15px;
    border-radius: 4px;
    /* margin-bottom: 20px; */
}

.cpl-success {
    background: #f0f6e6;
    border: 1px solid #c6e1a6;
    color: #4a6741;
}

.cpl-error {
    background: #fef0f0;
    border: 1px solid #fcd9d7;
    color: #d63638;
}

/* Violations List Styles */
.cpl-violations {
    margin-top: 20px;
}

.cpl-violations-summary {
    font-size: 1.5em;
    font-weight: 500;
    margin-bottom: 10px;
    color: #1d2327;
    text-align: center;
}

.cpl-violation-item {
    background: #f8d7da;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.cpl-violation-header {
    background: #fff;
    padding: 12px 15px;
    border-bottom: 1px solid #e2e4e7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cpl-violation-plate {
    font-weight: 600;
    font-size: 1.1em;
}

.cpl-violation-status {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: 500;
}

.cpl-violation-status.status-chaxpht {
    background: #dc3545;
    color: #fff;
}

.cpl-violation-status.status-xpht {
    background: #198754;
    color: #fff;
}

.status-pending {
    background: #fcf9e8;
    color: #907d1a;
}

.status-resolved {
    background: #edfaef;
    color: #2a663c;
}

.cpl-violation-details {
    padding: 15px;
    text-align: left;
}

.cpl-violation-row {
    margin-bottom: 10px;
    line-height: 1.5;
}

.cpl-violation-row:last-child {
    margin-bottom: 0;
}

.cpl-violation-row strong {
    display: inline-block;
    min-width: 100px;
    margin-right: 10px;
}

.table-lookup-history tr {
    vertical-align: middle;
}

.table-lookup-history .alert-danger td {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.table-lookup-history .alert-success td {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

/* Responsive Styles */
@media screen and (max-width: 600px) {
    .cold-penalty-lookup {
        /* margin: 1em; */
        padding: 15px;
    }

    .cpl-violation-row strong {
        display: block;
        margin-bottom: 4px;
    }
}

/* Remove was validated styles */
/* .form-check-input.is-valid, .was-validated .form-check-input:valid {
    background-color: #0d6efd;
    border-color: #0d6efd;
} */

.form-check-input.is-valid~.form-check-label, .was-validated .form-check-input:valid~.form-check-label {
    color: var(--bs-body-color) !important;
}

.form-check-input.is-valid:checked, .was-validated .form-check-input:valid:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-input.is-valid:focus, .was-validated .form-check-input:valid:focus {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Bootstrap 5 Compatibility Classes */

/* Navigation and Tabs */
.nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-tabs {
    border-bottom: 1px solid #dee2e6;
}

.nav-tabs .nav-link {
    margin-bottom: -1px;
    background: none;
    border: 1px solid transparent;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.nav-tabs .nav-link:focus,
.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    isolation: isolate;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: #495057;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

.nav-item {
    display: list-item;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #0d6efd;
    text-decoration: none;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    cursor: pointer;
    background: none;
    border: none;
}

.nav-link:focus,
.nav-link:hover {
    color: #0a58ca;
}

.tab-content {
    border: 1px solid #dee2e6;
    border-top: none;
    margin-bottom: 15px;
}

.tab-pane {
    display: none;
}

.tab-pane.active,
.tab-pane.show {
    display: block;
}

.fade {
    transition: opacity 0.15s linear;
}

.fade:not(.show) {
    opacity: 0;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-top: calc(-0.5 * 0);
    margin-right: calc(-0.5 * 1.5rem);
    margin-left: calc(-0.5 * 1.5rem);
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: calc(1.5rem * 0.5);
    padding-left: calc(1.5rem * 0.5);
    margin-top: 0;
}

.col-12 {
    flex: 0 0 auto;
    width: 100%;
}

.g-3 > * {
    padding-right: calc(1rem * 0.5);
    padding-left: calc(1rem * 0.5);
    margin-top: 1rem;
}

/* Form Classes */
.form-label {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-check {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5em;
    margin-bottom: 0.125rem;
}

.form-check-input {
    width: 1em;
    height: 1em;
    margin-top: 0.25em;
    vertical-align: top;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid rgba(0, 0, 0, 0.25);
    appearance: none;
    color-adjust: exact;
    float: left;
    margin-left: -1.5em;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-input:checked[type="radio"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-inline {
    display: inline-block;
    margin-right: 1rem;
}

.form-check-label {
    cursor: pointer;
}

/* .needs-validation .form-control:invalid {
    border-color: #dc3545;
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
} */

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
    text-align: center;
}

.was-validated .form-control:invalid ~ .invalid-feedback {
    display: block;
}

.cpl-results.success {
    background-color: #fff !important;
}

/* Button Classes */
.btn {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-primary:focus {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
    box-shadow: 0 0 0 0.25rem rgba(49, 132, 253, 0.5);
}

.btn-success {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

.btn-success:hover {
    color: #fff;
    background-color: #157347;
    border-color: #146c43;
}

.btn-success:focus {
    color: #fff;
    background-color: #157347;
    border-color: #146c43;
    box-shadow: 0 0 0 0.25rem rgba(60, 153, 110, 0.5);
}

.btn-warning {
    color: #000;
    background-color: #ffc107;
    border-color: #ffc107;
}

.btn-warning:hover {
    color: #000;
    background-color: #ffca2c;
    border-color: #ffc720;
}

.btn-warning:focus {
    color: #000;
    background-color: #ffca2c;
    border-color: #ffc720;
    box-shadow: 0 0 0 0.25rem rgba(217, 164, 6, 0.5);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

/* Table Classes */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    vertical-align: top;
    border-color: #dee2e6;
}

.table th,
.table td {
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

.table-hover tbody tr:hover {
    color: #212529;
    background-color: rgba(0, 0, 0, 0.075);
}

.table-light {
    color: #000;
    background-color: #f8f9fa;
}

/* Alert Classes */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-info {
    color: #055160;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Typography Classes */
.text-center {
    text-align: center !important;
}

.text-primary {
    color: #0d6efd !important;
}

.text-success {
    color: #198754 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-muted {
    color: #6c757d !important;
}

.fs-4 {
    font-size: calc(1.275rem + 0.3vw) !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

/* Spacing Classes */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.px-2 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

/* Bootstrap Icons */
.bi {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentcolor;
}

.bi::before {
    content: "";
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    width: 1em;
    height: 1em;
}

.bi-search::before {
    content: "🔍";
}

.bi-download::before {
    content: "⬇️";
}

.bi-arrow-repeat::before {
    content: "🔄";
}

.bi-car-front::before {
    content: "🚗";
}

.bi-card-text::before {
    content: "📄";
}

/* Additional utility classes */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-center {
    justify-content: center !important;
}

.align-items-center {
    align-items: center !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.border {
    border: 1px solid #dee2e6 !important;
}

.rounded {
    border-radius: 0.375rem !important;
}

.show {
    display: block !important;
}

.active {
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .fs-4 {
        font-size: 1.5rem !important;
    }
    
    .col-12 {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }
    
    .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}