/* TruckWe Unified Theme - Cross-Browser Compatible */
/* This ensures consistent appearance across all devices and browsers */

/* CSS Custom Properties with Fallbacks for Older Browsers */
:root {
    /* Primary Brand Colors */
    --truckwe-blue: #2D7DD2;
    --truckwe-dark-blue: #1E3A5F;
    --truckwe-light-blue: #4A94E8;
    --truckwe-accent: #87CEEB;
    
    /* Status Colors */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Neutral Colors */
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --white: #ffffff;
    --black: #000000;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2D7DD2 0%, #1E3A5F 100%);
    --gradient-light: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.6;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 15px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
}

/* Browser Compatibility Reset */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Cross-Browser Compatibility for CSS Variables */
.truckwe-blue { background-color: #2D7DD2; }
.truckwe-dark-blue { background-color: #1E3A5F; }
.truckwe-light-blue { background-color: #4A94E8; }
.truckwe-accent { background-color: #87CEEB; }
.success-color { background-color: #28a745; }
.warning-color { background-color: #ffc107; }
.danger-color { background-color: #dc3545; }

/* Base Styles with Browser Fallbacks */
html {
    font-size: 16px; /* Fallback */
    font-size: var(--font-size-base, 1rem);
    line-height: 1.6; /* Fallback */
    line-height: var(--line-height-base, 1.6);
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; /* Fallback */
    font-family: var(--font-family, 'Inter', sans-serif);
    color: #333; /* Fallback */
    color: var(--dark-gray, #333);
    background-color: #ffffff; /* Fallback */
    background-color: var(--white, #ffffff);
    overflow-x: hidden;
}

/* Navigation Styles */
.navbar-truckwe {
    background: #2D7DD2; /* Fallback */
    background: var(--gradient-primary, linear-gradient(135deg, #2D7DD2 0%, #1E3A5F 100%));
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1.2rem 0;
    box-shadow: 0 2px 20px rgba(45, 125, 210, 0.2);
    position: relative;
    z-index: 1000;
}

.navbar-brand-truckwe {
    color: white !important;
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
}

.navbar-brand-truckwe img {
    height: 40px;
    filter: brightness(0) invert(1);
    vertical-align: middle;
}

.nav-link-truckwe {
    color: white !important;
    font-weight: 500;
    margin: 0 10px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-link-truckwe:hover {
    color: #87CEEB !important; /* Fallback */
    color: var(--truckwe-accent, #87CEEB) !important;
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

/* Button Styles */
.btn-truckwe {
    background: #2D7DD2; /* Fallback */
    background: var(--truckwe-blue, #2D7DD2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px; /* Fallback */
    border-radius: var(--border-radius-md, 8px);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.btn-truckwe:hover {
    background: #1E3A5F; /* Fallback */
    background: var(--truckwe-dark-blue, #1E3A5F);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 125, 210, 0.3);
    color: white;
}

.btn-truckwe-outline {
    background: transparent;
    color: #2D7DD2; /* Fallback */
    color: var(--truckwe-blue, #2D7DD2);
    border: 2px solid #2D7DD2; /* Fallback */
    border: 2px solid var(--truckwe-blue, #2D7DD2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px; /* Fallback */
    border-radius: var(--border-radius-md, 8px);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.btn-truckwe-outline:hover {
    background: #2D7DD2; /* Fallback */
    background: var(--truckwe-blue, #2D7DD2);
    color: white;
    transform: translateY(-2px);
}

/* Card Styles */
.card-truckwe {
    background: white;
    border-radius: 12px; /* Fallback */
    border-radius: var(--border-radius-lg, 12px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Fallback */
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
    border: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-truckwe:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2); /* Fallback */
    box-shadow: var(--shadow-lg, 0 8px 15px rgba(0, 0, 0, 0.2));
}

.card-header-truckwe {
    background: #f8f9fa; /* Fallback */
    background: var(--light-gray, #f8f9fa);
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body-truckwe {
    padding: 1.5rem;
}

/* Status Indicators */
.status-active {
    color: #28a745; /* Fallback */
    color: var(--success-color, #28a745);
    font-weight: bold;
}

.status-pending {
    color: #ffc107; /* Fallback */
    color: var(--warning-color, #ffc107);
    font-weight: bold;
}

.status-completed {
    color: #6c757d;
    font-weight: bold;
}

.status-urgent {
    color: #dc3545; /* Fallback */
    color: var(--danger-color, #dc3545);
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

/* Badge Styles */
.badge-truckwe {
    padding: 0.5rem 1rem;
    border-radius: 20px; /* Fallback */
    border-radius: var(--border-radius-xl, 20px);
    font-weight: bold;
    font-size: 0.875rem;
    display: inline-block;
}

.badge-premium {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.badge-standard {
    background: #6c757d;
    color: white;
}

/* Layout Helpers */
.container-truckwe {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row-truckwe {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col-truckwe {
    flex: 1;
    padding: 0 0.5rem;
    min-width: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .col-truckwe {
        flex: 100%;
        margin-bottom: 1rem;
    }
    
    .navbar-truckwe {
        padding: 0.8rem 0;
    }
    
    .btn-truckwe,
    .btn-truckwe-outline {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Chat Interface Styles */
.chat-container {
    background: white;
    border-radius: 12px; /* Fallback */
    border-radius: var(--border-radius-lg, 12px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Fallback */
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: #2D7DD2; /* Fallback */
    background: var(--gradient-primary, linear-gradient(135deg, #2D7DD2 0%, #1E3A5F 100%));
    color: white;
    padding: 1rem;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f8f9fa; /* Fallback */
    background: var(--light-gray, #f8f9fa);
}

.chat-input-container {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background: white;
}

/* Dashboard Specific Styles */
.dashboard-metric {
    text-align: center;
    padding: 1.5rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2D7DD2; /* Fallback */
    color: var(--truckwe-blue, #2D7DD2);
    line-height: 1;
    margin-bottom: 0.5rem;
}

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

/* Load Card Styles */
.load-card {
    border-left: 4px solid #28a745; /* Fallback */
    border-left: 4px solid var(--success-color, #28a745);
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    margin-bottom: 0.5rem;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.load-card:hover {
    background: #f8f9fa; /* Fallback */
    background: var(--light-gray, #f8f9fa);
    border-left-color: #20c997;
    transform: translateX(4px);
}

.urgent-load {
    border-left-color: #dc3545 !important; /* Fallback */
    border-left-color: var(--danger-color, #dc3545) !important;
    background: linear-gradient(90deg, #fff5f5, #ffffff);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545; /* Fallback */
    background: var(--danger-color, #dc3545);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Print Styles */
@media print {
    .navbar-truckwe,
    .btn-truckwe,
    .btn-truckwe-outline {
        display: none !important;
    }
    
    .card-truckwe {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn-truckwe {
        border: 2px solid #000;
    }
    
    .card-truckwe {
        border: 1px solid #333;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}