/**
 * Chronopost WooCommerce - Frontend Tracking Styles
 *
 * @package MX\ChronopostWoo
 */

/* ==========================================
   Tracking Status Display
   ========================================== */

.cpw-tracking-info {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.cpw-tracking-number {
    font-family: monospace;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

.cpw-tracking-number a {
    color: #0073aa;
    text-decoration: none;
}

.cpw-tracking-number a:hover {
    text-decoration: underline;
}

/* ==========================================
   Status Badges
   ========================================== */

.cpw-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.cpw-status-label {
    font-weight: 500;
}

.cpw-status-date {
    font-size: 11px;
    opacity: 0.8;
}

/* Status colors */
.cpw-status-delivered {
    background: #d4edda;
    color: #155724;
    border-left: 3px solid #28a745;
}

.cpw-status-transit {
    background: #cce5ff;
    color: #004085;
    border-left: 3px solid #007bff;
}

.cpw-status-pending {
    background: #fff3cd;
    color: #856404;
    border-left: 3px solid #ffc107;
}

.cpw-status-exception {
    background: #f8d7da;
    color: #721c24;
    border-left: 3px solid #dc3545;
}

/* ==========================================
   Refresh Button
   ========================================== */

.cpw-refresh-tracking {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    transition: all 0.2s ease;
}

.cpw-refresh-tracking:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

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

.cpw-refresh-tracking .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.cpw-refresh-tracking.loading .dashicons {
    animation: cpw-spin 1s linear infinite;
}

@keyframes cpw-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================
   Order Details - Tracking Section
   ========================================== */

.cpw-order-tracking {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.cpw-order-tracking h3 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

.cpw-tracking-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cpw-tracking-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cpw-tracking-list li:last-child {
    border-bottom: none;
}

/* ==========================================
   Timeline View (if multiple events)
   ========================================== */

.cpw-tracking-timeline {
    position: relative;
    padding-left: 30px;
    margin: 15px 0;
}

.cpw-tracking-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: #ddd;
}

.cpw-timeline-event {
    position: relative;
    padding: 10px 0;
}

.cpw-timeline-event::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0073aa;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #0073aa;
}

.cpw-timeline-event.delivered::before {
    background: #28a745;
    box-shadow: 0 0 0 2px #28a745;
}

.cpw-timeline-event.exception::before {
    background: #dc3545;
    box-shadow: 0 0 0 2px #dc3545;
}

.cpw-timeline-date {
    font-size: 11px;
    color: #666;
    margin-bottom: 3px;
}

.cpw-timeline-label {
    font-size: 13px;
    color: #333;
}

.cpw-timeline-location {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* ==========================================
   My Account - Orders Table Column
   ========================================== */

.woocommerce-orders-table .cpw-tracking-column {
    min-width: 150px;
}

.cpw-mini-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.cpw-mini-status.delivered {
    background: #d4edda;
    color: #155724;
}

.cpw-mini-status.transit {
    background: #cce5ff;
    color: #004085;
}

.cpw-mini-status.pending {
    background: #fff3cd;
    color: #856404;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
    .cpw-tracking-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .cpw-status {
        width: 100%;
        justify-content: center;
    }
    
    .cpw-order-tracking {
        padding: 15px;
    }
}
