/* Real-time Order Tracking Styles */

/* Connection Status Indicator */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    transition: all 0.3s ease;
}

.connection-status.connected {
    background-color: #28a745;
    color: white;
}

.connection-status.connecting {
    background-color: #ffc107;
    color: black;
}

.connection-status.disconnected {
    background-color: #dc3545;
    color: white;
}

.connection-status.error {
    background-color: #dc3545;
    color: white;
    animation: pulse 2s infinite;
}

.connection-status.failed {
    background-color: #6c757d;
    color: white;
}

/* Order Status Progress Bar */
.order-progress {
    margin: 15px 0;
}

.order-progress .progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.order-progress .progress-bar {
    transition: width 0.6s ease;
    border-radius: 4px;
}

/* Order Status Badges */
.order-status {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.order-status.bg-warning {
    background-color: #ffc107 !important;
    color: #000;
}

.order-status.bg-info {
    background-color: #0dcaf0 !important;
    color: #000;
}

.order-status.bg-primary {
    background-color: #0d6efd !important;
    color: #fff;
}

.order-status.bg-success {
    background-color: #198754 !important;
    color: #fff;
}

.order-status.bg-secondary {
    background-color: #6c757d !important;
    color: #fff;
}

.order-status.bg-danger {
    background-color: #dc3545 !important;
    color: #fff;
}

/* Order Card Animations */
.order-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.order-card.pending {
    border-left-color: #ffc107;
}

.order-card.confirmed {
    border-left-color: #0dcaf0;
}

.order-card.preparing {
    border-left-color: #0d6efd;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
}

.order-card.ready {
    border-left-color: #198754;
    box-shadow: 0 0 10px rgba(25, 135, 84, 0.3);
    animation: readyPulse 2s infinite;
}

.order-card.served {
    border-left-color: #6c757d;
    opacity: 0.8;
}

.order-card.cancelled {
    border-left-color: #dc3545;
    opacity: 0.6;
    background-color: #f8f9fa;
}

/* New Order Animation */
@keyframes newOrderSlide {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.order-card.new-order {
    animation: newOrderSlide 0.5s ease-out;
}

/* Ready Order Pulse Animation */
@keyframes readyPulse {
    0% {
        box-shadow: 0 0 10px rgba(25, 135, 84, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(25, 135, 84, 0.6);
    }
    100% {
        box-shadow: 0 0 10px rgba(25, 135, 84, 0.3);
    }
}

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

/* Toast Notifications */
.toast-container {
    z-index: 1055 !important;
}

.toast {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast-header {
    background-color: transparent;
    border-bottom: none;
}

/* Order Status Timeline */
.order-timeline {
    position: relative;
    padding-left: 30px;
    margin: 20px 0;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e9ecef;
}

.order-timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-left: 25px;
}

.order-timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #6c757d;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #e9ecef;
}

.order-timeline-item.active::before {
    background-color: #0d6efd;
    box-shadow: 0 0 0 2px #0d6efd;
    animation: timelinePulse 2s infinite;
}

.order-timeline-item.completed::before {
    background-color: #198754;
    box-shadow: 0 0 0 2px #198754;
}

@keyframes timelinePulse {
    0% {
        box-shadow: 0 0 0 2px #0d6efd;
    }
    50% {
        box-shadow: 0 0 0 8px rgba(13, 110, 253, 0.3);
    }
    100% {
        box-shadow: 0 0 0 2px #0d6efd;
    }
}

/* Real-time Updates Indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    color: #198754;
    font-weight: 500;
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #198754;
    border-radius: 50%;
    margin-right: 6px;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Order Statistics Cards */
.stats-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stats-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* Kitchen Dashboard Specific Styles */
.kitchen-dashboard .order-card {
    margin-bottom: 1rem;
}

.kitchen-dashboard .order-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.kitchen-dashboard .btn-sm {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
}

/* Customer Order Tracking Styles */
.customer-tracking .order-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.customer-tracking .order-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.customer-tracking .order-time {
    opacity: 0.9;
}

.customer-tracking .status-current {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .connection-status {
        position: static;
        display: inline-block;
        margin-bottom: 1rem;
    }
    
    .order-timeline {
        padding-left: 20px;
    }
    
    .order-timeline-item {
        padding-left: 20px;
    }
    
    .kitchen-dashboard .order-actions {
        flex-direction: column;
    }
    
    .customer-tracking .order-header {
        text-align: center;
        padding: 1.5rem 1rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .order-card {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .order-timeline::before {
        background-color: #4a5568;
    }
    
    .order-timeline-item::before {
        border-color: #2d3748;
        box-shadow: 0 0 0 2px #4a5568;
    }
    
    .stats-card {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .stats-label {
        color: #a0aec0;
    }
}

/* Print Styles */
@media print {
    .connection-status,
    .toast-container,
    .order-actions {
        display: none !important;
    }
    
    .order-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}