/* Custom CSS to complement Bootstrap */

/* General styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --white-color: #ffffff;
    --dark-color: #343a40;
}

.content {
    flex: 1;
    padding-top: 1rem;
}

.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: none;
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
    padding: 1rem 1.25rem;
}

.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.12);
}

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

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.form-control {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    border-width: 1px;
    background-color: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

/* Status badges */
.status-badge {
    font-size: 0.85rem;
    padding: 0.35em 0.65em;
}

.status-pending {
    background-color: var(--bs-warning);
    color: var(--bs-dark);
}

.status-assigned {
    background-color: var(--bs-info);
    color: var(--bs-dark);
}

.status-picked_up {
    background-color: var(--bs-primary);
    color: var(--bs-white);
}

.status-in_transit {
    background-color: var(--bs-secondary);
    color: var(--bs-white);
}

.status-delivered {
    background-color: var(--bs-success);
    color: var(--bs-white);
}

.status-cancelled {
    background-color: var(--bs-danger);
    color: var(--bs-white);
}

/* Message styles */
.chat-container {
    max-height: 400px;
    overflow-y: auto;
}

.message-bubble {
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    max-width: 80%;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.message-bubble .message-content {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0.5rem 0;
}

.message-sender {
    background-color: var(--bs-primary);
    color: var(--bs-white);
    margin-left: auto;
    border-top-right-radius: 0;
    border-bottom-left-radius: 1.5rem;
}

.message-receiver {
    background-color: var(--bs-secondary);
    color: var(--bs-white);
    margin-right: auto;
    border-top-left-radius: 0;
    border-bottom-right-radius: 1.5rem;
}

.message-timestamp {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.message-timestamp {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Dashboard stats */
.stat-card {
    transition: transform 0.2s;
}

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

/* Delivery cards */
.delivery-card {
    transition: all 0.2s;
}

.delivery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Form adjustments */
.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.15);
    border-left: 4px solid var(--success-color);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.15);
    border-left: 4px solid var(--info-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    border-left: 4px solid var(--warning-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.15);
    border-left: 4px solid var(--danger-color);
}

/* Quick Access Menu */
.quick-access-trigger {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    width: 3rem;
    height: 3rem;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.quick-access-trigger:hover {
    transform: scale(1.1);
}

.quick-access-trigger i {
    font-size: 1.5rem;
    color: white;
}

.quick-access-grid {
    position: fixed;
    top: 4.5rem;
    right: 1rem;
    width: 600px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(33, 37, 41, 0.95);
    border-radius: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 999;
    max-height: 80vh;
    overflow-y: auto;
}

.quick-access-menu {
    position: relative;
}

.quick-access-menu:hover .quick-access-grid {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 767.98px) {
    .quick-access-item {
        padding: 1rem;
    }
    
    .quick-access-icon {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .quick-access-title {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .quick-access-description {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
}

.quick-access-item {
    background: var(--dark-color);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.quick-access-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-color: var(--primary-color);
}

.quick-access-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.quick-access-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--white-color);
}

.quick-access-description {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1rem;
}

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

.rounded-xl {
    border-radius: 1rem !important;
}

.shadow-hover {
    transition: box-shadow 0.2s, transform 0.2s;
}

.shadow-hover:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Mobile Optimizations */
@media (max-width: 767.98px) {
    /* General typography and spacing */
    body {
        font-size: 0.95rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Card and navigation improvements */
    .card-header-tabs {
        display: flex;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .card-header-tabs .nav-link {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Tables and buttons */
    .table {
        min-width: 650px;
    }
    
    .table-responsive {
        border-radius: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Width utilities */
    .w-md-auto {
        width: 100% !important;
    }
    
    /* Fix for mobile nav menu */
    .navbar-collapse {
        margin-top: 0.75rem;
    }
    
    .nav-item {
        margin-bottom: 0.5rem;
    }
    
    /* Address tap target size */
    .nav-link, .btn {
        padding: 0.5rem 0.75rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Mobile spacing for forms */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
        min-height: 44px;
    }
}

/* Notifications */
.notification-list-item {
    transition: background-color 0.2s;
    border-left: 4px solid transparent;
}

.notification-list-item:hover {
    background-color: rgba(var(--bs-secondary-rgb), 0.1);
}

.notification-list-item.unread {
    border-left-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.notification-type-status_update {
    border-left-color: var(--bs-info);
}

.notification-type-assignment {
    border-left-color: var(--bs-success);
}

.notification-type-message {
    border-left-color: var(--bs-primary);
}

#notification-badge, #mobile-notification-badge {
    transform: translate(-50%, -50%) !important;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-timestamp {
    font-size: 0.75rem;
    color: var(--bs-secondary);
}

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

.notification-pulse {
    animation: pulse 2s infinite;
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}
