/* Custom styles for Shipment Management System */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
}

/* Button Styles */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
}

/* Table Styles */
.table {
    background-color: #fff;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
}

.table td {
    vertical-align: middle;
}

.table-responsive {
    border-radius: 0.5rem;
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

.alert-dismissible .btn-close {
    padding: 1rem 1rem;
}

/* Breadcrumb Styles */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--secondary-color);
}

/* Dashboard Stats Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-info,
.card.bg-danger {
    border: none;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-warning:hover,
.card.bg-info:hover,
.card.bg-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 0;
    list-style: none;
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    padding-bottom: 20px;
}

.timeline-item:not(:last-child):before {
    content: '';
    position: absolute;
    left: 20px;
    top: 35px;
    height: calc(100% - 15px);
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item.completed:not(:last-child):before {
    background-color: var(--success-color);
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--secondary-color);
    z-index: 1;
}

.timeline-item.completed .timeline-marker {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.timeline-item.current .timeline-marker {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

.timeline-content {
    margin-top: 5px;
}

/* Invoice Item Styles */
.invoice-item {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 1rem !important;
}

.invoice-item:last-child {
    border-bottom: none;
}

/* Search and Filter Styles */
.card .card-body form {
    margin: 0;
}

/* Pagination Styles */
.pagination {
    border-radius: 0.5rem;
}

.page-link {
    border: none;
    color: var(--primary-color);
    padding: 0.5rem 0.75rem;
}

.page-link:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Empty State Styles */
.text-center.py-5 {
    padding: 3rem 1.5rem !important;
}

.text-center.py-5 i {
    opacity: 0.5;
}

/* Footer Styles */
footer {
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group-sm > .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .timeline-item {
        padding-left: 40px;
    }
    
    .timeline-marker {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .timeline-item:not(:last-child):before {
        left: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .table {
        --bs-table-bg: var(--bs-dark);
        --bs-table-color: var(--bs-light);
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border-lg {
    width: 3rem;
    height: 3rem;
}

/* Chart container styles */
.chart-container {
    position: relative;
    height: 400px;
}

/* Status badge colors */
.badge.bg-pending {
    background-color: var(--warning-color) !important;
    color: var(--dark-color) !important;
}

.badge.bg-processing {
    background-color: var(--info-color) !important;
}

.badge.bg-shipped {
    background-color: var(--primary-color) !important;
}

.badge.bg-delivered {
    background-color: var(--success-color) !important;
}

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

.border-start-primary {
    border-left: 3px solid var(--primary-color) !important;
}

.border-start-success {
    border-left: 3px solid var(--success-color) !important;
}

.border-start-warning {
    border-left: 3px solid var(--warning-color) !important;
}

.border-start-danger {
    border-left: 3px solid var(--danger-color) !important;
}

/* Print styles */
@media print {
    .navbar,
    .breadcrumb,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    body {
        background-color: white !important;
    }
}
