/* Custom styles for Tesla Cybercab Robotaxi Simulator */

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
    font-weight: 600;
}

.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-success {
    background-color: #198754;
    border-color: #198754;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

/* Results styling */
.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.result-card h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.result-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* Trip log styling */
.trip-log {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem;
}

.trip-entry {
    padding: 0.5rem;
    border-bottom: 1px solid #f1f3f4;
    font-size: 0.875rem;
}

.trip-entry:last-child {
    border-bottom: none;
}

.trip-type-paid {
    color: #198754;
    font-weight: 600;
}

.trip-type-deadhead {
    color: #6c757d;
}

.trip-type-charging {
    color: #fd7e14;
}

/* Loading animation */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
}

/* Custom scrollbar */
.trip-log::-webkit-scrollbar {
    width: 6px;
}

.trip-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.trip-log::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.trip-log::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation for results */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Tesla-inspired color scheme */
.text-tesla-red {
    color: #e31937;
}

.bg-tesla-red {
    background-color: #e31937;
}

.text-tesla-blue {
    color: #3e6ae1;
}

.bg-tesla-blue {
    background-color: #3e6ae1;
}

/* Metric cards */
.metric-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease-in-out;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: #3e6ae1;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Summary statistics */
.summary-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.summary-stats h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
}

.stat-value {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Fleet-specific styles */
.fleet-tabs .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.fleet-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease-in-out;
}

.fleet-tabs .nav-link:hover {
    border-color: #3e6ae1;
    color: #3e6ae1;
}

.fleet-tabs .nav-link.active {
    border-color: #3e6ae1;
    color: #3e6ae1;
    background-color: transparent;
}

.fleet-tabs .btn-close {
    font-size: 0.5rem;
    padding: 0.25rem;
    margin-left: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

.fleet-tabs .btn-close:hover {
    opacity: 1;
}

.vehicle-config {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.vehicle-config .form-label {
    font-weight: 500;
    color: #495057;
    font-size: 0.875rem;
}

/* Fleet results styling */
.fleet-summary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.fleet-summary h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.fleet-summary .metric-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.fleet-summary .metric-value {
    color: white;
    font-size: 1.5rem;
}

.fleet-summary .metric-label {
    color: rgba(255, 255, 255, 0.8);
}

/* Vehicle type result cards */
.vehicle-result-card {
    border: none;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.vehicle-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.vehicle-result-card .card-header {
    font-weight: 600;
    font-size: 0.9rem;
}

.vehicle-result-card .metric-card {
    background: white;
    border: 1px solid #e9ecef;
}

.vehicle-result-card .metric-value {
    font-size: 1.25rem;
}

/* Fleet charts */
.fleet-chart-container {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Responsive fleet layout */
@media (max-width: 768px) {
    .fleet-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .vehicle-config {
        padding: 0.75rem;
    }
    
    .vehicle-result-card .metric-value {
        font-size: 1rem;
    }
}

/* Error handling styles */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='m5.8 4.6 6 6m0-6-6 6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Error message animation */
.invalid-feedback {
    animation: fadeIn 0.3s ease-in-out;
}

/* Field-specific error styling */
.field-error {
    border-color: #dc3545 !important;
}

.field-error:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
}

/* Validation error summary styling */
#validationErrorSummary {
    border-left: 4px solid #dc3545;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

#validationErrorSummary .alert-heading {
    color: #721c24;
}

#validationErrorSummary ul {
    padding-left: 1.5rem;
}

#validationErrorSummary li {
    margin-bottom: 0.25rem;
    color: #721c24;
}

/* Smooth transitions for error states */
.form-control,
.form-select {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.invalid-feedback {
    transition: opacity 0.15s ease-in-out;
}

/* Error icon positioning */
.form-control.is-invalid,
.form-select.is-invalid {
    background-position: right 0.75rem center;
    background-size: 1rem 1rem;
}

/* Hover effects for error fields */
.form-control.is-invalid:hover,
.form-select.is-invalid:hover {
    border-color: #c82333;
}

/* Focus ring for error fields */
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #c82333;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}
