/* Mobile-First Styles */

/* Professional Dashboard Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    color: var(--dark-color);
    margin: 0;
    padding: 0;
}

/* Professional Header */
.minimal-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.minimal-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.minimal-header h1 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.stat-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.stat-value {
    font-size: 0.875rem;
    color: var(--dark-color);
    font-weight: 600;
}

/* Main Content */
.dashboard-main {
    padding: 1rem 0;
    min-height: calc(100vh - 80px);
}

/* Compact Filter Bar */
.compact-filter-bar {
    background: var(--bg-color);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

/* Professional Tabs */
.nav-tabs {
    border: none;
    background: var(--bg-color);
    border-radius: 0.75rem;
    padding: 0.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    color: var(--secondary-color);
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover:not(.active) {
    background: var(--light-color);
    color: var(--text-color);
}

.nav-tabs .nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.nav-tabs .nav-link i {
    margin-right: 0.5rem;
}

/* Search Section */
.mobile-search {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

/* Table styling fixes */
.table {
    margin-bottom: 0;
    table-layout: fixed;
}

.table th, .table td {
    padding: 0.5rem;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column widths */
.table th:nth-child(1), .table td:nth-child(1) { width: 120px; } /* Bid # */
.table th:nth-child(2), .table td:nth-child(2) { width: 200px; } /* Official Name */
.table th:nth-child(3), .table td:nth-child(3) { width: 150px; } /* Department */
.table th:nth-child(4), .table td:nth-child(4) { width: 180px; } /* Categories */
.table th:nth-child(5), .table td:nth-child(5) { width: 100px; } /* Start Date */
.table th:nth-child(6), .table td:nth-child(6) { width: 100px; } /* End Date */
.table th:nth-child(7), .table td:nth-child(7) { width: 80px; } /* Actions */

.table th {
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

.table td {
    border-color: var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--light-color);
}

/* Detail Item Styles */
.detail-item {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.detail-item:hover {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.detail-label {
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-label i {
    color: #3b82f6;
}

.detail-value {
    font-size: 1rem;
    color: #1e293b;
    font-weight: 500;
}

.mobile-search .form-select,
.mobile-search .form-control {
    font-size: 0.875rem;
}

.mobile-search .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Loading State */
.mobile-loading {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    margin: 2rem 0;
}

.mobile-loading .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Results Section */
.mobile-results {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

/* Stats Cards */
.stat-card {
    border: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Table */
.mobile-table {
    font-size: 0.75rem;
}

.mobile-table .table th {
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding: 0.5rem;
    white-space: nowrap;
}

.mobile-table .table td {
    padding: 0.5rem;
    vertical-align: middle;
}

.mobile-table .table td:nth-child(3),
.mobile-table .table td:nth-child(4) {
    font-size: 0.625rem;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pagination */
.mobile-pagination .pagination {
    margin: 0;
}

.mobile-pagination .page-link {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Analytics Section */
.mobile-analytics {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.mobile-analytics .btn {
    font-size: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

#chartContainer {
    background: var(--light-color);
    border-radius: 0.25rem;
    padding: 1rem;
    min-height: 300px;
}

/* Modal Styles */
.modal-dialog {
    margin: 1rem;
}

.modal-content {
    border: none;
    box-shadow: var(--shadow);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Touch-Friendly Buttons */
.btn {
    min-height: 44px;
    touch-action: manipulation;
}

.btn-sm {
    min-height: 36px;
    font-size: 0.875rem;
}

/* Responsive Enhancements */
@media (max-width: 576px) {
    .mobile-header h1 {
        font-size: 1.25rem;
    }
    
    .mobile-search,
    .mobile-results,
    .mobile-analytics {
        margin: 0.5rem;
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .mobile-table {
        font-size: 0.625rem;
    }
}

@media (min-width: 768px) {
    .mobile-main {
        max-width: 768px;
        margin: 0 auto;
        padding: 2rem;
    }
    
    .mobile-search,
    .mobile-results,
    .mobile-analytics {
        padding: 1.5rem;
    }
}

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

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Error State */
.error-state {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    color: var(--danger-color);
}

/* Success State */
.success-state {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    color: var(--success-color);
}

/* Custom modal centering */
.modal-dialog {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    min-height: 100vh;
}

.modal-content {
    width: 100%;
    max-width: 500px;
}

/* Larger modal for bid details */
.modal-lg .modal-content {
    max-width: 800px;
}

/* Sticky header */
.minimal-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff !important;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    height: 70px; /* Fixed height */
}

/* Sticky navigation tabs */
.nav.nav-tabs {
    position: sticky;
    top: 70px; /* Adjusted to remove gap */
    z-index: 999;
    background: #ffffff !important;
    border: none;
    border-bottom: 1px solid #dee2e6 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 0 !important;
    padding: 0;
    border-radius: 0 !important;
    width: 100%;
}

.nav.nav-tabs .nav-link {
    border-radius: 0 !important;
    border: none;
    border-bottom: 2px solid transparent;
    margin: 0;
}

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

/* Remove container padding for edge-to-edge layout */
.container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
    --bs-gutter-x: 0 !important;
}

/* Ensure main content doesn't overlap header */
.dashboard-main {
    padding-top: 0;
}

/* Add space for sticky tabs */
.tab-content {
    padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Chart container styling */
#chartContainer {
    width: 100%;
    height: calc(100vh - 250px); /* Leave more space for axis labels */
    position: relative;
    min-height: 500px;
    max-height: 800px; /* Prevent it from being too tall */
    padding-bottom: 60px; /* Space for x-axis labels */
}

#analyticsChart {
    width: 100% !important;
    height: 100% !important;
}

/* Analytics panel full width */
.analytics-panel {
    width: 100% !important;
    max-width: none !important;
}

/* Remove card padding for full space */
.analytics-panel .card-body {
    padding: 1rem;
    height: calc(100vh - 280px);
    overflow: hidden;
}

/* Login Screen Styles */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 40px;
}

.logo {
    width: 60px;
    height: 60px;
    background: #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #ffffff;
    font-size: 24px;
}

.login-header h2 {
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.subtitle {
    color: #666666;
    font-size: 14px;
    margin: 0;
}

.subtle-cue {
    color: #999999;
    font-size: 12px;
    font-style: italic;
    margin: 8px 0 0 0;
    opacity: 0.7;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #1a1a1a;
    font-weight: 500;
    font-size: 14px;
}

.input-group {
    position: relative;
}

.input-group-text {
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    border-right: none;
    color: #666666;
}

.form-control {
    border: 1px solid #e5e5e5;
    border-left: none;
    padding: 12px 16px;
    font-size: 14px;
}

.form-control:focus {
    border-color: #1a1a1a;
    outline: none;
    box-shadow: none;
}

.login-btn {
    width: 100%;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 16px;
}

.login-btn:hover {
    background: #333333;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-footer p {
    color: #999999;
    font-size: 12px;
    margin: 0;
}

/* Stats Navigation Bar */
.stats-navbar {
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
    padding: 8px 0;
}

.stats-navbar .container-fluid {
    padding: 0 20px;
}
