/* FleetVision - Vehicle Tracking System Styles */

/* Base Styles */
* {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-mono {
    font-family: 'Space Mono', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Grid Pattern Background */
.grid-pattern {
    background-image: 
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    width: 100%;
    height: 100%;
}

/* Floating Circles Animation */
.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

.circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(20px, 30px) scale(1.02);
    }
}

/* Navigation Items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(20, 184, 166, 0.2));
    color: #10b981;
    font-weight: 500;
}

/* Cards */
.card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #475569;
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.card-stat {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.card-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #14b8a6);
}

.card-stat.warning::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.card-stat.danger::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.card-stat.info::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #0d9488);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: #1e293b;
    color: #94a3b8;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #334155;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #334155;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #334155;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input::placeholder {
    color: #64748b;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #334155;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #10b981;
}

.form-select option {
    background: #1e293b;
    color: white;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: #1e293b;
    color: #94a3b8;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #334155;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #1e293b;
    color: #e2e8f0;
    font-size: 14px;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.05);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.badge-gray {
    background: rgba(100, 116, 139, 0.15);
    color: #64748b;
}

/* Status Dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-dot.offline {
    background: #64748b;
}

.status-dot.moving {
    background: #3b82f6;
    box-shadow: 0 0 8px #3b82f6;
    animation: pulse 2s infinite;
}

.status-dot.idle {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.status-dot.alert {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: pulse 1s infinite;
}

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

/* Map Container */
.map-container {
    height: 500px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #334155;
}

.map-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    z-index: 1000;
    border-radius: 0;
}

/* Leaflet Custom Styles */
.leaflet-container {
    background: #0f172a;
}

.leaflet-popup-content-wrapper {
    background: #1e293b;
    color: white;
    border-radius: 12px;
    border: 1px solid #334155;
}

.leaflet-popup-tip {
    background: #1e293b;
}

.leaflet-popup-content {
    margin: 12px;
}

.vehicle-marker {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    border: 3px solid white;
    border-radius: 50%;
    width: 36px !important;
    height: 36px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.vehicle-marker.offline {
    background: linear-gradient(135deg, #64748b, #475569);
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.4);
}

.vehicle-marker.alert {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    animation: markerPulse 1s infinite;
}

@keyframes markerPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Notifications */
.toast {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: #0f172a;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid #334155;
}

.tab {
    padding: 10px 20px;
    border-radius: 8px;
    color: #94a3b8;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

.tab:hover {
    color: white;
}

.tab.active {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    color: white;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #334155;
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #1e293b;
}

.timeline-item.warning::before {
    background: #f59e0b;
}

.timeline-item.danger::before {
    background: #ef4444;
}

/* Charts placeholder */
.chart-container {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 20px;
    min-height: 300px;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #334155;
    border-radius: 4px;
    overflow: hidden;
}

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

.progress-bar-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.progress-bar-fill.danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #334155;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .card-stat {
        padding: 16px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px;
    }
}

@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        border-radius: 16px;
    }
    
    .toast {
        min-width: 260px;
    }
}

/* Geofence drawing styles */
.leaflet-draw-toolbar a {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

.leaflet-draw-toolbar a:hover {
    background-color: #334155 !important;
}

/* Alert animation */
.alert-pulse {
    animation: alertPulse 2s infinite;
}

@keyframes alertPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 50;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 48px;
    height: 26px;
    background: #334155;
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle.active {
    background: linear-gradient(135deg, #10b981, #14b8a6);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle.active::after {
    left: 25px;
}

/* Vehicle Card */
.vehicle-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.vehicle-card:hover {
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.1);
}

.vehicle-card.selected {
    border-color: #10b981;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.1), rgba(20, 184, 166, 0.05));
}

/* Alert Card */
.alert-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s ease;
}

.alert-card.unread {
    border-left: 4px solid #ef4444;
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.05), #0f172a);
}

.alert-card:hover {
    background: linear-gradient(145deg, #334155, #1e293b);
}

/* Checkbox */
.checkbox {
    width: 20px;
    height: 20px;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox.checked {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    border-color: #10b981;
}

.checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(20, 184, 166, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search Input */
.search-input {
    position: relative;
}

.search-input input {
    padding-left: 44px;
}

.search-input svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

/* Stat Card Hover Effect */
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #14b8a6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Filter Pills */
.filter-pill {
    padding: 8px 16px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 20px;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: #10b981;
    color: #10b981;
}

.filter-pill.active {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    border-color: transparent;
    color: white;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card, .card-stat {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}
