/* Custom Styles for Isopan Logistics Pilot */

* {
    font-family: 'Inter', sans-serif;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation Items */
.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #6B7280;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-item:hover {
    background-color: #F3F4F6;
    color: #111827;
}

.nav-item.active {
    background-color: #3B82F6;
    color: white;
}

.nav-item.active:hover {
    background-color: #2563EB;
}

/* Mobile Navigation Items */
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    padding: 0.5rem;
}

.mobile-nav-item.active {
    color: #3B82F6;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pending {
    background-color: #FEF3C7;
    color: #92400E;
}

.status-loading {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.status-in_transit {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-unloading {
    background-color: #E0E7FF;
    color: #3730A3;
}

.status-completed {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-cancelled {
    background-color: #FEE2E2;
    color: #991B1B;
}

/* Priority Badges */
.priority-low {
    background-color: #D1FAE5;
    color: #065F46;
}

.priority-medium {
    background-color: #FEF3C7;
    color: #92400E;
}

.priority-high {
    background-color: #FED7AA;
    color: #9A3412;
}

.priority-critical {
    background-color: #FEE2E2;
    color: #991B1B;
}

/* Incident Status */
.incident-status-open {
    background-color: #FEE2E2;
    color: #991B1B;
}

.incident-status-in_progress {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.incident-status-resolved {
    background-color: #D1FAE5;
    color: #065F46;
}

/* Truck Card Animation */
.truck-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Activity Timeline */
.activity-item {
    position: relative;
    padding-left: 2rem;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: 0.375rem;
    top: 0.5rem;
    bottom: -1rem;
    width: 2px;
    background-color: #E5E7EB;
}

.activity-item:last-child::before {
    display: none;
}

.activity-dot {
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #3B82F6;
    border: 3px solid white;
}

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

::-webkit-scrollbar-track {
    background: #F3F4F6;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Smooth Transitions */
.view-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Responsive Table */
@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
}

/* Chart Container */
canvas {
    max-height: 100%;
}

/* Modal Backdrop */
#createIncidentModal {
    backdrop-filter: blur(4px);
}

/* Button Hover Effects */
button {
    transition: all 0.2s ease-in-out;
}

button:active {
    transform: scale(0.98);
}

/* Card Shadow Effects */
.card-hover {
    transition: box-shadow 0.3s ease-in-out;
}

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

/* Utility Classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Country Flag Emoji */
.country-flag {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

/* Incident History Timeline */
.timeline-item {
    position: relative;
    padding-left: 2.5rem;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 1.5rem;
    bottom: 0;
    width: 2px;
    background-color: #E5E7EB;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: white;
    border: 3px solid #3B82F6;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

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

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