/**
 * TruckList V2 - Main Application Styles
 *
 * This file contains core application styles and design system variables
 */

/* ============================================
   CSS VARIABLES (Design Tokens)
   ============================================ */

:root {
    /* Primary Colors */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;

    /* Status Colors */
    --status-available: #10b981;
    --status-in-transit: #3b82f6;
    --status-delivering: #f59e0b;
    --status-delivered: #8b5cf6;
    --status-breakdown: #ef4444;
    --status-home: #6b7280;
    --status-maintenance: #f97316;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-900);
    background-color: var(--gray-50);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-muted { color: var(--gray-500); }

.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }
.bg-danger { background-color: var(--danger); }
.bg-info { background-color: var(--info); }

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.status-available { background-color: var(--status-available); }
.status-in-transit { background-color: var(--status-in-transit); }
.status-delivering { background-color: var(--status-delivering); }
.status-delivered { background-color: var(--status-delivered); }
.status-breakdown { background-color: var(--status-breakdown); }
.status-home { background-color: var(--status-home); }
.status-maintenance { background-color: var(--status-maintenance); }

/* ============================================
   CARD COMPONENTS
   ============================================ */

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.card-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
}

.card-body {
    padding: var(--space-4);
}

/* ============================================
   TABLE STYLES
   ============================================ */

.table-wrapper {
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    font-size: 13px;
}

table.data-table thead th {
    background-color: var(--gray-100);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: var(--space-3) var(--space-4);
    border-bottom: 2px solid var(--gray-300);
}

table.data-table tbody td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--gray-200);
}

table.data-table tbody tr:hover {
    background-color: var(--gray-50);
}

/* ============================================
   BUTTON ENHANCEMENTS
   ============================================ */

.btn {
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    min-width: 300px;
    margin-bottom: var(--space-2);
    padding: var(--space-4);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    animation: slideIn 0.3s ease-out;
}

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

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .card {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 13px;
    }

    table.data-table {
        font-size: 12px;
    }
}
