/* Delivery Bidding System Styles */

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-bottom: 2px solid #e8eaed;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Filter Section */
.filters-section {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 0.75rem;
    border: 2px solid #e8eaed;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 150px;
}

/* Jobs Grid */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.job-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.job-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.job-info {
    margin-bottom: 1rem;
}

.job-info p {
    margin: 0.5rem 0;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.job-info i {
    color: var(--primary-color);
    width: 20px;
}

.job-status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.job-status-badge.open {
    background: #d4edda;
    color: #155724;
}

.job-status-badge.assigned {
    background: #cce5ff;
    color: #004085;
}

.job-status-badge.in_progress {
    background: #fff3cd;
    color: #856404;
}

.job-status-badge.completed {
    background: #d1ecf1;
    color: #0c5460;
}

.special-instructions {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.job-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.assigned-driver {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Driver Portal Styles */
.driver-section {
    margin-bottom: 3rem;
}

.driver-login,
.driver-profile {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    max-width: 500px;
    margin: 0 auto;
}

.driver-login h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.register-link {
    text-align: center;
    margin-top: 1rem;
}

.register-link a {
    color: var(--primary-color);
    text-decoration: underline;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.driver-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card i {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e8eaed;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    min-height: 400px;
}

/* Bids Grid */
.bids-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.bid-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: relative;
}

.bid-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.bid-status.pending {
    background: #fff3cd;
    color: #856404;
}

.bid-status.accepted {
    background: #d4edda;
    color: #155724;
}

.bid-status.rejected {
    background: #f8d7da;
    color: #721c24;
}

.bid-details {
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.bid-amount {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.bid-time {
    color: var(--text-light);
}

/* Bid Info */
.bid-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.bid-count {
    font-weight: 600;
    color: var(--text-dark);
}

.avg-bid {
    color: var(--primary-color);
    font-weight: 600;
}

/* Bids List in Modal */
.bids-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 2rem;
}

.bids-list h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.bid-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
}

.bid-driver strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.driver-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.driver-rating i {
    color: #ffc107;
}

.bid-message {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    font-style: italic;
    color: var(--text-light);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 900px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--text-dark);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
}

.modal form {
    padding: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid #e8eaed;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group small {
    color: var(--text-light);
    font-size: 0.875rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e8eaed;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.job-details {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e8eaed;
}

.job-summary {
    padding: 1.5rem;
    background: #f8f9fa;
    margin: -1.5rem -1.5rem 1.5rem;
}

.job-summary h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* No Results Messages */
.no-jobs,
.no-bids {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .jobs-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-section {
        flex-direction: column;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
    }
    
    .driver-stats {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .bid-item {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        overflow-x: auto;
    }
}