/* Delivery Estimator Frontend Styles */

.delivery-estimator {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Stock Status */
.delivery-stock-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0fdf4 100%);
    border: 1px solid #bbf7d0;
    margin-bottom: 8px;
    border-radius: 8px;
}

.stock-icon {
    font-size: 16px;
    color: #059669;
}

.stock-text {
    color: #065f46;
    font-weight: 500;
    font-size: 14px;
}

/* Countdown Format */
.delivery-countdown-format {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.delivery-urgency {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
    border-bottom: 1px solid #f59e0b;
    position: relative;
    overflow: hidden;
}

.delivery-urgency::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #d97706, #f59e0b);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.urgency-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.urgency-content {
    flex: 1;
    min-width: 0;
}

.urgency-message {
    font-size: 16px;
    font-weight: 600;
    color: #92400e;
    line-height: 1.4;
    margin-bottom: 4px;
}

.estimated-arrival {
    font-size: 14px;
    color: #a16207;
    font-weight: 500;
}

.countdown-timer {
    background: rgba(146, 64, 14, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    color: #92400e;
    border: 1px solid rgba(146, 64, 14, 0.2);
    transition: all 0.3s ease;
}

.countdown-timer.pulse {
    animation: pulse-timer 1s ease-in-out;
}

@keyframes pulse-timer {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Standard delivery */
.delivery-standard {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.standard-icon {
    font-size: 24px;
    color: #0284c7;
}

.standard-message {
    font-size: 16px;
    font-weight: 600;
    color: #0c4a6e;
}

/* Express option */
.delivery-express-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fef7ff 0%, #f3e8ff 100%);
    border-top: 1px solid #e9d5ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delivery-express-option:hover {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    transform: translateY(-1px);
}

.express-icon {
    font-size: 18px;
    color: #7c3aed;
}

.express-content {
    flex: 1;
}

.express-label {
    display: block;
    font-weight: 600;
    color: #581c87;
    font-size: 14px;
}

.express-description {
    display: block;
    color: #7c2d12;
    font-size: 12px;
    margin-top: 2px;
}

/* Simple Format */
.delivery-simple-format {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.delivery-icon {
    font-size: 20px;
    color: #059669;
}

.delivery-message {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
}

.delivery-date {
    font-weight: 700;
    color: #059669;
}

/* Timeline Format */
.delivery-timeline-format {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.timeline-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    position: relative;
    z-index: 2;
    min-width: 0;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.timeline-item.completed .timeline-icon {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.timeline-item.active .timeline-icon {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    animation: pulse-active 2s ease-in-out infinite;
}

.timeline-item.pending .timeline-icon {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}

@keyframes pulse-active {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
}

.timeline-connector {
    position: absolute;
    top: 20px;
    left: calc(16.67% + 20px);
    right: calc(16.67% + 20px);
    height: 2px;
    background: #cbd5e1;
    z-index: 1;
}

.timeline-connector::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 50%;
    background: #3b82f6;
}

.timeline-date {
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
    margin-bottom: 4px;
    white-space: nowrap;
}

.timeline-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    line-height: 1.2;
    max-width: 80px;
    word-wrap: break-word;
}

/* Timeline Express Option */
.timeline-express-option {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.express-callout {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.express-callout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9, #0284c7, #0ea5e9);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

.express-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.express-icon {
    font-size: 18px;
    color: #0284c7;
}

.express-title {
    font-weight: 700;
    color: #0c4a6e;
    font-size: 16px;
}

.express-message {
    color: #075985;
    font-size: 14px;
    font-weight: 500;
}

.countdown-timer-small {
    background: rgba(8, 145, 178, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    color: #0891b2;
    border: 1px solid rgba(8, 145, 178, 0.2);
}

/* Urgency States */
.delivery-estimator.urgency-high .delivery-urgency {
    background: linear-gradient(135deg, #fecaca 0%, #ef4444 100%);
    border-color: #dc2626;
}

.delivery-estimator.urgency-high .urgency-message,
.delivery-estimator.urgency-high .estimated-arrival {
    color: #991b1b;
}

.delivery-estimator.urgency-high .countdown-timer {
    background: rgba(153, 27, 27, 0.1);
    color: #991b1b;
    border-color: rgba(153, 27, 27, 0.2);
    animation: urgent-blink 2s ease-in-out infinite;
}

@keyframes urgent-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.delivery-estimator.urgency-medium .delivery-urgency {
    background: linear-gradient(135deg, #fed7aa 0%, #f97316 100%);
    border-color: #ea580c;
}

.delivery-estimator.urgency-medium .urgency-message,
.delivery-estimator.urgency-medium .estimated-arrival {
    color: #c2410c;
}

/* Timer Expired */
.delivery-estimator.timer-expired .countdown-timer {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Hover Effects */
.delivery-urgency.hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .delivery-estimator {
        margin: 16px 0;
        border-radius: 8px;
    }
    
    .delivery-urgency,
    .delivery-standard,
    .delivery-timeline-format {
        padding: 16px;
    }
    
    .urgency-message {
        font-size: 15px;
    }
    
    .estimated-arrival {
        font-size: 13px;
    }
    
    .timeline-container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .timeline-item {
        margin: 0 2px;
    }
    
    .timeline-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .timeline-date {
        font-size: 11px;
    }
    
    .timeline-label {
        font-size: 9px;
        max-width: 60px;
    }
    
    .timeline-connector {
        left: calc(16.67% + 16px);
        right: calc(16.67% + 16px);
        top: 16px;
    }
}

@media (max-width: 480px) {
    .urgency-message {
        font-size: 14px;
    }
    
    .delivery-urgency {
        gap: 12px;
    }
    
    .urgency-icon {
        font-size: 20px;
    }
    
    .express-callout {
        padding: 12px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .delivery-estimator {
        border: 2px solid;
    }
    
    .countdown-timer,
    .countdown-timer-small {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .delivery-estimator,
    .countdown-timer,
    .timeline-icon,
    .delivery-express-option {
        transition: none;
    }
    
    .delivery-urgency::before,
    .express-callout::before {
        animation: none;
    }
    
    .countdown-timer.pulse,
    .timeline-item.active .timeline-icon {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .delivery-estimator {
        background: #1f2937;
        border-color: #374151;
    }
    
    .delivery-simple-format,
    .delivery-countdown-format,
    .delivery-timeline-format {
        background: #1f2937;
        border-color: #374151;
    }
    
    .delivery-message,
    .urgency-message,
    .standard-message,
    .timeline-date {
        color: #f9fafb;
    }
    
    .estimated-arrival,
    .timeline-label {
        color: #d1d5db;
    }
} 