/* Advanced Order Status Plugin CSS - Fixed Version */

/* Main Container */
.aos-tracking-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.aos-tracking-container h3 {
    margin-top: 0;
    color: #333;
    text-align: center;
}

/* Form Styles */
.aos-tracking-form {
    margin-bottom: 30px;
}

.tracking-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tracking-input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.tracking-input-group input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.tracking-input-group button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.tracking-input-group button:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,115,170,0.3);
}

.tracking-input-group button:active {
    transform: translateY(0);
}

/* Results Container */
.tracking-result {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tracking-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.tracking-header h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.order-info {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.order-info strong {
    color: #333;
}

/* Admin Note Section */
.admin-note-section {
    background: #f0f8ff;
    border: 1px solid #0073aa;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #0073aa;
}

.admin-note-header h5 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 16px;
    font-weight: 600;
}

.admin-note-text {
    background: white;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-bottom: 8px;
    line-height: 1.5;
    color: #333;
}

.admin-note-meta {
    font-size: 12px;
    color: #6c757d;
    text-align: right;
    font-style: italic;
}

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

.timeline-item {
    display: flex;
    margin-bottom: 20px;
    position: relative;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.4s ease-out;
    padding: 8px;
    border-radius: 8px;
}

.timeline-item:hover {
    background-color: rgba(248, 249, 250, 0.8);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    z-index: 2;
    position: relative;
    font-size: 14px;
}

.timeline-icon.completed {
    background: #46b450;
    box-shadow: 0 2px 4px rgba(70, 180, 80, 0.3);
}

.timeline-icon.current {
    background: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.4);
    animation: pulseCurrent 2s infinite;
}

.timeline-icon.pending {
    background: #ccc;
    color: #666;
}

/* Pulse animation for current status */
@keyframes pulseCurrent {
    0% {
        box-shadow: 0 2px 8px rgba(0, 115, 170, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 2px 12px rgba(0, 115, 170, 0.6);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 2px 8px rgba(0, 115, 170, 0.4);
        transform: scale(1);
    }
}

.timeline-content {
    flex: 1;
    padding-top: 5px;
}

.timeline-status {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 16px;
}

.timeline-date {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

/* Timeline connector lines */
.timeline-item:not(:last-child):after {
    content: '';
    position: absolute;
    left: 27px; /* Center of icon (19px + 8px padding) */
    top: 48px; /* Below icon */
    width: 2px;
    height: calc(100% - 28px);
    background: #ddd;
    z-index: 1;
}

.timeline-item.completed:not(:last-child):after {
    background: #46b450;
    animation: lineGrow 0.5s ease-out;
}

/* Line grow animation */
@keyframes lineGrow {
    0% {
        height: 0;
    }
    100% {
        height: calc(100% - 28px);
    }
}

/* Special status items */
.timeline-item.special-status {
    background-color: rgba(248, 249, 250, 0.9);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

.timeline-item.special-status .timeline-icon {
    animation: specialPulse 1s ease-in-out infinite;
}

@keyframes specialPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Error Display */
.tracking-error {
    background: #fff;
    border: 1px solid #dc3232;
    border-radius: 4px;
    padding: 15px;
    color: #dc3232;
    text-align: center;
    margin-top: 20px;
}

.tracking-error p {
    margin: 0;
    font-weight: 500;
}

/* Loading State */
.tracking-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin: 10px 0;
    animation: loadingPulse 1.5s ease-in-out infinite alternate;
}

@keyframes loadingPulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Mobile Responsive Design */
@media (max-width: 600px) {
    .aos-tracking-container {
        margin: 10px;
        padding: 15px;
    }
    
    .tracking-input-group {
        flex-direction: column;
    }
    
    .tracking-input-group button {
        margin-top: 10px;
        width: 100%;
    }
    
    .timeline-item.mobile-view {
        margin-bottom: 15px;
        padding: 5px;
    }
    
    .timeline-item.mobile-view .timeline-content {
        font-size: 14px;
    }
    
    .timeline-item.mobile-view .timeline-icon {
        width: 35px;
        height: 35px;
        font-size: 12px;
        margin-right: 12px;
    }
    
    .timeline-item.mobile-view:not(:last-child):after {
        left: 22px; /* Adjust for smaller icon */
    }
    
    .admin-note-section {
        padding: 12px;
    }
    
    .tracking-header h4 {
        font-size: 18px;
    }
}

/* Admin Panel Styles */
.aos-admin-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.aos-orders-list {
    flex: 2;
}

.aos-quick-actions {
    flex: 1;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.aos-quick-actions h3 {
    margin-top: 0;
    color: #333;
}

.aos-quick-actions input,
.aos-quick-actions select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.aos-quick-actions button {
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.aos-quick-actions button:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,115,170,0.3);
}

/* Status badges for admin */
.status-pending {
    color: #856404;
    background-color: #fff3cd;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.status-processing {
    color: #004085;
    background-color: #cce7ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.status-payment-received {
    color: #155724;
    background-color: #d4edda;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.status-product-packed {
    color: #0c5460;
    background-color: #bee5eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.status-handed-courier {
    color: #533f03;
    background-color: #ffeaa7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.status-delivery-assigned {
    color: #721c24;
    background-color: #f8d7da;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.status-out-delivery {
    color: #0f5132;
    background-color: #d1e7dd;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.status-delivery-complete,
.status-completed {
    color: #055160;
    background-color: #cff4fc;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.status-cancelled,
.status-customer-cancelled {
    color: #721c24;
    background-color: #f8d7da;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.status-no-phone-response {
    color: #664d03;
    background-color: #fff3cd;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Accessibility improvements */
.timeline-item:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 8px;
}

.tracking-input-group input:focus,
.aos-quick-actions input:focus,
.aos-quick-actions select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Print styles */
@media print {
    .aos-tracking-form,
    .aos-quick-actions,
    .tracking-loading {
        display: none !important;
    }
    
    .aos-tracking-container {
        box-shadow: none;
        background: white;
        margin: 0;
        padding: 20px;
    }
    
    .timeline-item {
        break-inside: avoid;
        margin-bottom: 15px;
    }
    
    .timeline-icon {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .admin-note-section {
        border: 2px solid #0073aa;
        background: #f0f8ff !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .timeline-icon.completed {
        background: #000;
        border: 2px solid #fff;
    }
    
    .timeline-icon.current {
        background: #000;
        border: 3px solid #fff;
    }
    
    .timeline-icon.pending {
        background: #666;
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .timeline-item,
    .tracking-input-group button,
    .aos-quick-actions button {
        transition: none;
    }
    
    .timeline-icon.current {
        animation: none;
    }
    
    @keyframes pulseCurrent,
    @keyframes lineGrow,
    @keyframes specialPulse,
    @keyframes loadingPulse {
        0%, 100% { 
            transform: none;
            opacity: 1;
        }
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus management */
.timeline-item:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Additional spacing and layout fixes */
.admin-note-section + .tracking-timeline {
    margin-top: 20px;
}

.tracking-result.loading {
    opacity: 0.6;
    pointer-events: none;
}

.tracking-result.loaded {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}