/* ========================================
   FLEET EXPLORER CSS
   ========================================
   Custom CSS for FleetExplorer frontend
   Works with Tailwind CSS for utilities
   ======================================== */

/* ========================================
   CSS VARIABLES & FOUNDATION
   ======================================== */
:root {
    --primary-color: #d4af37;
    --primary-dark: #b8941f;
    --secondary-color: #c0392b;
    --success-color: #d4af37;
    --warning-color: #c0392b;
    --danger-color: #c0392b;
    --background: #0a0a0a;
    --surface: #1a1a1a;
    --surface-elevated: #2a2a2a;
    --border: #444444;
    --text-primary: #f5f5f5;
    --text-secondary: #d4af37;
    --text-muted: #c0392b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.8), 0 1px 2px -1px rgb(0 0 0 / 0.8);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.8), 0 4px 6px -4px rgb(0 0 0 / 0.8);
    --gradient-primary: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
    --gradient-surface: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    --accent-red: #c0392b;
    --accent-red-dark: #a93226;
    --charcoal: #1a1a1a;
    --charcoal-dark: #0a0a0a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Override any potential blue elements */
* {
    color: inherit;
}

a {
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-dark);
}

button, input, select, textarea {
    color: var(--text-primary);
}

/* Ensure all borders use our color scheme */
* {
    border-color: var(--border);
}

/* Override any remaining blue elements */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

p, span, div {
    color: inherit;
}

/* Ensure form elements use our theme */
input[type="text"], input[type="email"], input[type="password"], 
input[type="number"], input[type="tel"], input[type="url"],
select, textarea {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

/* Fix autofill styling for inputs */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--surface-elevated) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background-color: var(--surface-elevated) !important;
    background: var(--surface-elevated) !important;
}

/* Fix dropdown/select styling */
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--surface-elevated) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background-color: var(--surface-elevated) !important;
    background: var(--surface-elevated) !important;
}

/* Firefox autofill */
input:-moz-autofill, select:-moz-autofill {
    background-color: var(--surface-elevated) !important;
    background: var(--surface-elevated) !important;
    color: var(--text-primary) !important;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, 
input[type="number"]:focus, input[type="tel"]:focus, input[type="url"]:focus,
select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(212 175 55 / 0.2);
    background: var(--surface);
}

/* Override any default button styles */
button {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
}

button:hover {
    background: var(--primary-dark) !important;
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

/* Force theme on all elements */
.header {
    background: var(--gradient-primary) !important;
    color: white !important;
}

.sidebar {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
}

.main-content {
    background: var(--background) !important;
    color: var(--text-primary) !important;
}

.search-panel {
    background: var(--gradient-surface) !important;
    color: var(--text-primary) !important;
}

.results-container {
    background: var(--gradient-surface) !important;
    color: var(--text-primary) !important;
}

/* Override any potential blue backgrounds */
* {
    background-color: inherit !important;
}

body {
    background: var(--background) !important;
    color: var(--text-primary) !important;
}

.header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: 60px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0; /* Allow shrinking */
}

.header-left .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
    min-width: 0;
}

.header-left .logo i {
    font-size: 2rem;
    flex-shrink: 0;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
    left: 0;
    top: 0;
}

.sidebar.collapsed {
    width: 60px !important;
    padding: 2rem 0 !important;
}

.sidebar.collapsed .sidebar-header {
    padding: 0 1rem !important;
    text-align: center !important;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-subtitle {
    display: none !important;
}

.sidebar.collapsed .nav-link {
    padding: 1rem !important;
    justify-content: center !important;
}

.sidebar.collapsed .nav-link span {
    display: none !important;
}

.sidebar.collapsed .nav-link i {
    font-size: 1.25rem !important;
}

.sidebar.collapsed .nav-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface-elevated);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    margin-left: 0.5rem;
}

.sidebar-header {
    padding: 0 2rem 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.sidebar-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--surface-elevated);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-link i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

.main-content.sidebar-collapsed {
    margin-left: 60px;
}

.main-content.sidebar-collapsed .header {
    margin-left: 0;
}

/* Sidebar toggle styling - Tailwind handles all layout and styling */

/* Sidebar toggle positioning - Tailwind handles all layout */

/* Desktop sidebar toggle - Tailwind handles all styling */

/* Sidebar styling - Tailwind handles all layout and responsive behavior */

/* Sidebar Overlay - Available on all screen sizes */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 2rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.search-panel {
    background: var(--gradient-surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.search-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.main-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Responsive grid utilities */
.grid-responsive {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-responsive-sm {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-responsive-lg {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-responsive-xl {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.search-options {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-options .form-group {
    min-width: 200px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.advanced-filters {
    background: var(--surface-elevated);
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.advanced-filters-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.advanced-filters-header h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.advanced-filters-header p {
    color: var(--text-secondary);
}

.advanced-filters-toggle {
    text-align: center;
    margin: 1.5rem 0;
}

/* ========================================
   FORM COMPONENTS
   ======================================== */

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input, .form-select {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--surface-elevated);
    color: var(--text-primary);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(212 175 55 / 0.2);
    background: var(--surface);
}

/* Fix whiteout dropdowns on Windows - CSS rendering issue */
.form-select {
    background: var(--surface-elevated) !important; /* Match other form elements */
    color: var(--text-primary) !important; /* Match theme text color */
    border: 2px solid var(--border) !important; /* Match other form elements border */
}

.form-select option {
    background: var(--surface-elevated) !important;
    color: var(--text-primary) !important;
}

/* Fix autofill for form classes */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--surface-elevated) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background-color: var(--surface-elevated) !important;
    background: var(--surface-elevated) !important;
}

.form-select:-webkit-autofill,
.form-select:-webkit-autofill:hover,
.form-select:-webkit-autofill:focus,
.form-select:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--surface-elevated) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background-color: var(--surface-elevated) !important;
    background: var(--surface-elevated) !important;
}

.form-input:-moz-autofill, .form-select:-moz-autofill {
    background-color: var(--surface-elevated) !important;
    background: var(--surface-elevated) !important;
    color: var(--text-primary) !important;
}

.search-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 1200px) {
    .search-actions {
        gap: 0.875rem;
        margin-top: 1.75rem;
    }
    
    .search-actions .btn {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .search-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .search-actions .btn {
        width: 100%;
        justify-content: center;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .search-actions {
        gap: 0.5rem;
        margin-top: 1rem;
    }
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    min-height: 44px; /* Touch-friendly minimum height */
    justify-content: center;
    text-align: center;
}

/* ========================================
   UI COMPONENTS
   ======================================== */

/* Button size variants */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    min-height: 52px;
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: 1.25rem;
    min-height: 60px;
}

/* Responsive button sizing - Progressive scaling */
@media (max-width: 1400px) {
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.4rem;
        font-size: 0.95rem;
    }
    
    .btn-sm {
        min-height: 40px;
        padding: 0.625rem 1.1rem;
        font-size: 0.85rem;
    }
    
    .btn-lg {
        min-height: 48px;
        padding: 0.875rem 1.8rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 1200px) {
    .btn {
        min-height: 46px;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        min-height: 42px;
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
    
    .btn-lg {
        min-height: 50px;
        padding: 0.875rem 1.6rem;
        font-size: 1rem;
    }
}

/* Custom Width - Tailwind handles width utilities */

/* Custom Responsive Width - Tailwind handles responsive utilities */

/* Custom Large Screen Width - Tailwind handles responsive utilities */

@media (max-width: 768px) {
    .btn-mobile-full {
        width: 100%;
    }
    
    .btn {
        min-height: 48px; /* Larger touch target on mobile */
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        min-height: 44px;
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .btn-lg {
        min-height: 52px;
        padding: 0.875rem 1.4rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .btn {
        min-height: 50px;
        padding: 0.75rem;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .btn-sm {
        min-height: 46px;
        padding: 0.625rem;
        font-size: 0.8rem;
    }
    
    .btn-lg {
        min-height: 54px;
        padding: 0.875rem;
        font-size: 1rem;
    }
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--gradient-surface);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-container {
    background: var(--surface-elevated);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

.pagination button {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 1rem;
}

.results-container {
    background: var(--gradient-surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.results-header {
    background: var(--surface-elevated);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
}

.sort-select {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--surface-elevated);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 140px;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgb(212 175 55 / 0.2);
}

.sort-order-btn {
    padding: 0.5rem;
    border: 2px solid var(--border);
    background: var(--surface-elevated);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.sort-order-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.sort-order-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem;
    border: 2px solid var(--border);
    background: var(--surface-elevated);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.carrier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

/* Responsive carrier grid */
@media (max-width: 1200px) {
    .carrier-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.25rem;
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .carrier-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
}

.carrier-card {
    background: var(--gradient-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    position: relative;
}

.carrier-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    background: var(--surface-elevated);
}

.carrier-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.carrier-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.carrier-dba {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.fleet-badge {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
}

.carrier-details {
    display: grid;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.detail-icon {
    width: 16px;
    text-align: center;
    color: var(--primary-color);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-authorized {
    background: #1a4d1a;
    color: #4ade80;
    border: 1px solid #4ade80;
}

.status-unauthorized {
    background: #4d1a1a;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.status-unknown {
    background: #2a2a2a;
    color: #c0392b;
    border: 1px solid #c0392b;
}

.distance-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

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

.error-message {
    background: #4d1a1a;
    color: #cc5500;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #cc5500;
    margin: 1rem 0;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border);
}

@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }
    
    .search-panel {
        padding: 1.5rem;
    }
    
    .main-search-grid {
        grid-template-columns: 1fr;
    }
    
    .search-options {
        flex-direction: column;
    }
    
    .search-options .form-group {
        min-width: auto;
    }
    
    .carrier-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-controls {
        justify-content: space-between;
    }
}

/* Location Tip Styling */
.location-tip {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.location-tip .form-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex: 1;
}

/* ========================================
   MODERN RESPONSIVE DESIGN SYSTEM
   Based on industry standards (Bootstrap/Tailwind inspired)
   ======================================== */

/* CSS Custom Properties for consistent spacing */
:root {
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */
    
    /* Breakpoints (mobile-first approach) */
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-2xl: 1400px;
    
    /* Container max-widths */
    --container-sm: 540px;
    --container-md: 720px;
    --container-lg: 960px;
    --container-xl: 1140px;
    --container-2xl: 1320px;
}

/* Modern Container System */
.container {
    width: 100%;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 576px) {
    .container { max-width: var(--container-sm); }
}

@media (min-width: 768px) {
    .container { max-width: var(--container-md); }
}

@media (min-width: 992px) {
    .container { max-width: var(--container-lg); }
}

@media (min-width: 1200px) {
    .container { max-width: var(--container-xl); }
}

@media (min-width: 1400px) {
    .container { max-width: var(--container-2xl); }
}

/* Custom Grid System - Tailwind handles grid utilities */

/* Custom Flexbox - Tailwind handles flex utilities */

/* Custom Spacing - Tailwind handles gap utilities */

/* Custom Display - Tailwind handles display utilities */

/* Sidebar toggle styling - Tailwind handles display and positioning */

/* Sidebar toggle visibility - Tailwind handles responsive display */

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Enhanced Mobile Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        padding: 1rem;
    }
    
    .search-panel {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .main-search-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .carrier-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1rem;
    }
    
    .stats-bar {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 0.75rem;
    }
    
    .search-panel {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .main-search-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-options {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-options .form-group {
        margin-bottom: 0;
        min-width: auto;
    }
    
    .search-results {
        margin-top: 1rem;
    }
    
    .carrier-card {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .carrier-card h3 {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .carrier-card .carrier-info {
        font-size: 0.9rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0 1rem;
    }
    
    .pagination button {
        width: 100%;
        padding: 0.75rem;
    }
    
    /* Header mobile improvements */
    .header {
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        min-height: auto;
    }
    
    .header-left {
        justify-content: center;
        order: 2;
    }
    
    .header-left .logo {
        font-size: 1.25rem;
    }
    
    .header-left .logo i {
        font-size: 1.5rem;
    }
    
    .user-info {
        order: 1;
        justify-content: center;
    }
    
    .auth-buttons {
        order: 3;
    }
    
    .user-info {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .user-actions {
        justify-content: center;
        width: 100%;
    }
    
    .user-actions .btn {
        flex: 1;
        text-align: center;
    }
    
    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .auth-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Form improvements */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px; /* Touch target size */
    }
    
    /* Modal improvements */
    .modal-content {
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
        width: calc(100% - 2rem);
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    /* Table responsiveness */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        position: relative;
    }
    
    .table-container::before {
        content: '← Scroll horizontally to see more data →';
        position: sticky;
        left: 0;
        top: 0;
        background: var(--surface-elevated);
        color: var(--text-secondary);
        padding: 0.5rem;
        font-size: 0.8rem;
        text-align: center;
        border-bottom: 1px solid var(--border);
        z-index: 10;
    }
    
    table {
        min-width: 600px;
        font-size: 0.9rem;
        width: 100%;
    }
    
    th, td {
        padding: 0.5rem;
        white-space: nowrap;
        border-bottom: 1px solid var(--border);
    }
    
    th {
        background: var(--surface-elevated);
        font-weight: 600;
        position: sticky;
        top: 0;
        z-index: 5;
    }
    
    /* Responsive table utilities */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 100%;
    }
    
    /* Hide less important columns on mobile */
    @media (max-width: 768px) {
        .table-hide-mobile {
            display: none;
        }
        
        .table-priority-1 { order: 1; }
        .table-priority-2 { order: 2; }
        .table-priority-3 { order: 3; }
        .table-priority-4 { order: 4; }
    }
    
    @media (max-width: 480px) {
        .table-hide-small-mobile {
            display: none;
        }
    }
    
    /* Card grid improvements */
    .carrier-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    /* Search form mobile layout */
    .search-form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-form .form-row {
        flex-direction: column;
    }
    
    .search-form .form-group {
        width: 100%;
    }
    
    /* Results controls mobile layout */
    .results-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .sort-controls,
    .pagination-controls,
    .view-toggle {
        justify-content: center;
    }
    
    .sort-controls .btn,
    .view-toggle .btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
    
    .sort-select,
    .sort-label {
        font-size: 0.9rem;
    }
    
    /* Location tip mobile */
    .location-tip {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .location-tip .btn {
        width: 100%;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .main-container {
        padding: 0.5rem;
    }
    
    .search-panel {
        padding: 0.75rem;
        margin: 0.25rem 0;
    }
    
    .register-container {
        margin: 10px auto;
        padding: 15px;
        max-width: 95%;
    }
    
    .register-header h1 {
        font-size: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .carrier-card {
        padding: 0.75rem;
    }
    
    .carrier-card h3 {
        font-size: 1rem;
    }
    
    .carrier-card .carrier-info {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.75rem;
        font-size: 0.9rem;
        min-height: 48px; /* Larger touch target for small screens */
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
        width: calc(100% - 1rem);
    }
    
    /* Even more compact spacing for small screens */
    .stats-bar {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .search-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-actions .btn {
        width: 100%;
    }
    
    /* Compact form inputs */
    .form-input, .form-select {
        padding: 0.75rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Compact table for small screens */
    table {
        font-size: 0.8rem;
        min-width: 500px;
    }
    
    th, td {
        padding: 0.25rem 0.5rem;
    }
}

/* Custom Display Utilities - Tailwind handles display utilities */

/* Custom Responsive Display - Tailwind handles responsive display utilities */

/* Custom Text Alignment - Tailwind handles text utilities */

/* Custom Responsive Text - Tailwind handles responsive text utilities */

/* Custom Spacing - Tailwind handles margin and padding utilities */

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .register-container {
        margin: 10px auto;
        padding: 20px;
    }
    
    .modal-content {
        max-height: 80vh;
    }
    
    .landing-main {
        padding: 1rem;
    }
    
    .landing-title {
        font-size: 2rem;
    }
    
    .landing-subtitle {
        font-size: 1.1rem;
    }
}
