/* Custom styles for DeliveryMall Dashboard */

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Custom scrollbar for modal */
.max-h-\[90vh\]::-webkit-scrollbar {
    width: 6px;
}

.max-h-\[90vh\]::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.max-h-\[90vh\]::-webkit-scrollbar-thumb {
    background: #7CB342;
    border-radius: 3px;
}

.max-h-\[90vh\]::-webkit-scrollbar-thumb:hover {
    background: #689F38;
}

/* Navigation tabs active state */
.nav-tab {
    position: relative;
    transition: all 0.3s ease;
}

.nav-tab.active {
    color: #689F38;
    border-color: #7CB342;
}

.nav-tab:hover:not(.active) {
    color: #374737;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-assigned {
    background-color: #FEF3C7;
    color: #D97706;
}

.status-accepted {
    background-color: #DBEAFE;
    color: #2563EB;
}

.status-en-route {
    background-color: #E0E7FF;
    color: #7C3AED;
}

.status-delivered {
    background-color: #D1FAE5;
    color: #059669;
}

.status-failed {
    background-color: #FEE2E2;
    color: #DC2626;
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Progress bars */
.progress-bar {
    transition: width 0.5s ease;
    background: linear-gradient(90deg, #7CB342, #8BC34A);
}

/* Table styles */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table-row:hover {
    background-color: #F9FAFB;
}

/* Form elements */
.form-input {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    border-color: #7CB342;
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.1);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #7CB342, #689F38);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #689F38, #558B2F);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 179, 66, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #FFA000, #FF8F00);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #FF8F00, #FF6F00);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 160, 0, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #7CB342;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-tab {
        font-size: 0.875rem;
        padding: 0.75rem 0.25rem;
    }
    
    .nav-tab i {
        display: none;
    }
    
    .grid-responsive {
        grid-template-columns: 1fr;
    }
}

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Settings form styling */
.settings-section {
    border-left: 4px solid #7CB342;
    padding-left: 1rem;
    margin-bottom: 2rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Tooltip */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1F2937;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
}

/* Custom select styling */
.custom-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Date picker styling */
input[type="date"] {
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    color: #7CB342;
    cursor: pointer;
}

/* Success/Error messages */
.alert {
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #D1FAE5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

.alert-error {
    background-color: #FEE2E2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.alert-warning {
    background-color: #FEF3C7;
    border: 1px solid #FDE68A;
    color: #92400E;
}

/* Responsive table */
@media (max-width: 1024px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem;
    }
}

@media (max-width: 640px) {
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table-responsive th:nth-child(n+5),
    .table-responsive td:nth-child(n+5) {
        display: none;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .bg-white {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}