/* ========================================= */
/* AIRCRAFT PARTS HUNTER - MOBILE-FIRST CSS */
/* ========================================= */

body {
    min-height: 100vh;
    background-color: #f8f9fa;
    font-size: 14px;
}

/* ========================================= */
/* CARDS */
/* ========================================= */
.card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    margin-bottom: 12px;
}

.card-header {
    font-weight: 600;
    font-size: 14px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.card-body {
    padding: 15px;
}

.card-title {
    color: #212529;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 10px;
}

/* ========================================= */
/* TYPOGRAPHY */
/* ========================================= */
h1 {
    color: #212529;
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 20px;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.lead {
    font-size: 1rem;
    color: #6c757d;
}

/* ========================================= */
/* BUTTONS */
/* ========================================= */
.btn {
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-sm {
    min-height: 32px;
    font-size: 12px;
    padding: 4px 10px;
}

.btn-lg {
    min-height: 48px;
    font-size: 16px;
}

/* ========================================= */
/* TABLES */
/* ========================================= */
.table {
    background-color: white;
    font-size: 13px;
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    background: #f8f9fa;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6c757d;
}

.table td, .table th {
    padding: 10px 12px;
    vertical-align: middle;
}

.table-responsive {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* ========================================= */
/* FORMS */
/* ========================================= */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    font-size: 14px;
    padding: 8px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
    color: #495057;
}

.input-group {
    gap: 0;
}

.input-group .form-control,
.input-group .form-select {
    border-radius: 0;
}

.input-group > :first-child {
    border-radius: 6px 0 0 6px;
}

.input-group > :last-child {
    border-radius: 0 6px 6px 0;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ========================================= */
/* BADGES */
/* ========================================= */
.badge {
    font-weight: 500;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
}

/* Status badges */
.badge.bg-success { background-color: #198754 !important; }
.badge.bg-warning { background-color: #ffc107 !important; color: #212529 !important; }
.badge.bg-danger { background-color: #dc3545 !important; }
.badge.bg-info { background-color: #0dcaf0 !important; color: #212529 !important; }
.badge.bg-secondary { background-color: #6c757d !important; }
.badge.bg-primary { background-color: #0d6efd !important; }

/* ========================================= */
/* LISTS */
/* ========================================= */
.list-group-item {
    border-left: 3px solid transparent;
    padding: 12px 15px;
    transition: all 0.2s;
}

.list-group-item:hover {
    border-left-color: #0d6efd;
    background: #f8f9fa;
}

.list-group-item.active {
    background-color: #e7f1ff;
    border-color: #e7f1ff;
    border-left-color: #0d6efd;
    color: #0d6efd;
}

/* ========================================= */
/* STAT CARDS */
/* ========================================= */
.stat-card {
    text-align: center;
    padding: 20px 15px;
    border-radius: 10px;
    color: white;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 5px;
}

.stat-card.bg-primary { background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%); }
.stat-card.bg-success { background: linear-gradient(135deg, #198754 0%, #146c43 100%); }
.stat-card.bg-warning { background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%); color: #212529; }
.stat-card.bg-info { background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%); }
.stat-card.bg-danger { background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%); }

/* ========================================= */
/* MODALS */
/* ========================================= */
.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-title {
    font-weight: 600;
    font-size: 16px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

/* ========================================= */
/* ALERTS & EMPTY STATES */
/* ========================================= */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
}

/* ========================================= */
/* QUICK FILTERS */
/* ========================================= */
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.quick-filters .btn {
    font-size: 12px;
    padding: 6px 12px;
    min-height: 32px;
}

/* ========================================= */
/* SPLIT VIEW (RFQ Workspace, Part Intel) */
/* ========================================= */
.split-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.split-list-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.2s;
}

.split-list-item:hover,
.split-list-item.active {
    background: #e7f1ff;
}

.split-detail {
    background: white;
    border-radius: 8px;
    min-height: 300px;
}

/* ========================================= */
/* TABS */
/* ========================================= */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
    gap: 5px;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    font-size: 13px;
    padding: 10px 15px;
    border-radius: 6px 6px 0 0;
}

.nav-tabs .nav-link:hover {
    color: #0d6efd;
    background: #f8f9fa;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    background: white;
    border-bottom: 2px solid #0d6efd;
    margin-bottom: -2px;
}

/* ========================================= */
/* MONOSPACE */
/* ========================================= */
.font-monospace, .part-number {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ========================================= */
/* MOBILE-SPECIFIC STYLES */
/* ========================================= */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.5rem !important;
        margin-bottom: 15px !important;
    }
    
    h2 {
        font-size: 1.1rem;
    }
    
    /* Mobile cards */
    .card {
        margin-bottom: 10px;
        border-radius: 8px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .card-header {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Mobile stats */
    .stat-card {
        padding: 15px 12px;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-card .stat-label {
        font-size: 11px;
    }
    
    /* Mobile tables */
    .table {
        font-size: 12px;
    }
    
    .table td, .table th {
        padding: 8px 6px;
    }
    
    .table-responsive {
        margin: 0 -12px;
        width: calc(100% + 24px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    /* Mobile buttons */
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 11px;
        min-height: 30px;
    }
    
    /* Stack button groups on mobile */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
    
    /* Mobile forms */
    .form-control, .form-select {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 10px 12px;
        min-height: 44px;
    }
    
    .form-label {
        font-size: 12px;
    }
    
    /* Mobile input groups - stack on small screens */
    .input-group {
        flex-wrap: wrap;
    }
    
    .input-group > * {
        flex: 1 1 100%;
        border-radius: 6px !important;
        margin-bottom: 5px;
    }
    
    .input-group > :last-child {
        margin-bottom: 0;
    }
    
    /* Mobile badges */
    .badge {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    /* Mobile modals */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px) !important;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-body .row > [class*="col-"] {
        margin-bottom: 12px;
    }
    
    /* Mobile split view - stack */
    .split-list {
        max-height: 250px;
        margin-bottom: 15px;
    }
    
    /* Mobile tabs - scroll horizontally */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Mobile quick filters - scroll */
    .quick-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }
    
    .quick-filters .btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Hide on mobile */
    .d-mobile-none {
        display: none !important;
    }
    
    /* Show only on mobile */
    .d-mobile-only {
        display: block !important;
    }
    
    /* Mobile empty state */
    .empty-state {
        padding: 30px 15px;
    }
    
    .empty-state-icon {
        font-size: 36px;
    }
    
    /* Mobile-friendly action buttons in tables */
    td .btn-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    td .btn-group .btn {
        width: 100%;
        margin: 0 !important;
    }
}

/* Very small phones */
@media (max-width: 375px) {
    h1 {
        font-size: 1.3rem !important;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    .table {
        font-size: 11px;
    }
    
    .table td, .table th {
        padding: 6px 4px;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Desktop-only */
@media (min-width: 769px) {
    .d-mobile-only {
        display: none !important;
    }
}

/* ========================================= */
/* UTILITIES */
/* ========================================= */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.sticky-top-mobile {
    position: sticky;
    top: 50px;
    z-index: 100;
    background: #f8f9fa;
    padding: 10px 0;
}

@media (min-width: 769px) {
    .sticky-top-mobile {
        top: 0;
    }
}
