/* Custom CSS enhancements for TaxiMK */

/* Animation utilities */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Map enhancements */
.leaflet-container {
    height: 400px;
    border-radius: 0.5rem;
    overflow: hidden;
}

.current-location-marker {
    background: none;
    border: none;
}

.pickup-marker, .destination-marker, .driver-marker, .active-driver-marker {
    background: none;
    border: none;
}

/* Custom map controls */
.leaflet-control-custom {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.leaflet-control-custom:hover {
    background: #f9f9f9;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.status-online {
    background-color: #10b981;
}

.status-offline {
    background-color: #6b7280;
}

.status-busy {
    background-color: #f59e0b;
}

.status-requested {
    background-color: #fbbf24;
}

.status-accepted {
    background-color: #3b82f6;
}

.status-in-progress {
    background-color: #10b981;
}

.status-completed {
    background-color: #059669;
}

.status-cancelled {
    background-color: #ef4444;
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

/* Card enhancements */
.card-hover {
    transition: all 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.ride-card {
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.ride-card.requested {
    border-left-color: #fbbf24;
}

.ride-card.accepted {
    border-left-color: #3b82f6;
}

.ride-card.in-progress {
    border-left-color: #10b981;
}

.ride-card.completed {
    border-left-color: #059669;
}

.ride-card.cancelled {
    border-left-color: #ef4444;
}

/* Button enhancements */
.btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
    transition: all 0.2s ease;
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #ef4444;
    border-color: #ef4444;
    color: white;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
}

.btn-warning {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: white;
    transition: all 0.2s ease;
}

.btn-warning:hover {
    background-color: #d97706;
    border-color: #d97706;
    transform: translateY(-1px);
}

/* Form enhancements */
.form-floating {
    position: relative;
}

.form-floating input {
    height: 56px;
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.form-floating label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

.form-floating input:focus ~ label,
.form-floating input:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Dashboard enhancements */
.kpi-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kpi-card:hover::before {
    opacity: 1;
}

.earnings-card {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.rides-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.rating-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.time-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Search and filter enhancements */
.search-container {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 20;
    max-height: 200px;
    overflow-y: auto;
}

.search-suggestion {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.search-suggestion:hover {
    background-color: #f3f4f6;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: #dbeafe;
    color: #1e40af;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

.filter-badge button {
    margin-left: 0.5rem;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.15s ease;
}

.filter-badge button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Modal enhancements */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chart container enhancements */
.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Notification enhancements */
.notification {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.notification-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Connection status indicator */
.connection-status {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

.connection-status.connected {
    background-color: #ecfdf5;
    border-color: #d1fae5;
    color: #065f46;
}

.connection-status.disconnected {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.connection-status.connecting {
    background-color: #fffbeb;
    border-color: #fed7aa;
    color: #92400e;
}

/* Progress indicators */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Rating stars */
.star-rating {
    color: #d1d5db;
    transition: color 0.15s ease;
    cursor: pointer;
}

.star-rating:hover,
.star-rating.active {
    color: #fbbf24;
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .leaflet-container {
        height: 300px;
    }
    
    .kpi-card {
        padding: 1rem;
    }
    
    .chart-container {
        height: 250px;
        padding: 0.5rem;
    }
    
    .modal-content {
        margin: 1rem;
        width: auto;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
    
    .chart-container {
        background: white;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .status-indicator {
        border: 2px solid currentColor;
    }
    
    .kpi-card {
        border: 2px solid white;
    }
    
    .btn-primary,
    .btn-success,
    .btn-danger,
    .btn-warning {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .pulse {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
        border-top-color: #3498db;
    }
}