/* Estilos para el frontend del plugin MRW Integration */

/* Sección de seguimiento principal */
.woocommerce-mrw-tracking-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.woocommerce-mrw-tracking-section h2 {
    margin-top: 0;
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Información básica de seguimiento */
.mrw-tracking-basic-info {
    margin-bottom: 20px;
}

.mrw-tracking-external-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: bold;
}

.mrw-tracking-external-link:hover {
    text-decoration: underline;
}

.mrw-tracking-external-link .dashicons {
    font-size: 14px;
    vertical-align: middle;
    margin-left: 5px;
}

.mrw-update-tracking-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.mrw-update-tracking-btn:hover {
    background: #005a87;
}

.mrw-update-tracking-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Estado actual */
.mrw-current-status {
    margin: 20px 0;
}

.mrw-current-status h3 {
    color: #333;
    margin-bottom: 15px;
}

.mrw-status-card {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mrw-status-icon {
    margin-right: 15px;
    font-size: 24px;
}

.mrw-status-info {
    flex: 1;
}

.mrw-status-description {
    font-size: 16px;
    margin: 0 0 5px 0;
    color: #333;
}

.mrw-status-date,
.mrw-status-location,
.mrw-status-notes {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

/* Historial de seguimiento */
.mrw-tracking-history {
    margin-top: 30px;
}

.mrw-tracking-history h4 {
    color: #333;
    margin-bottom: 20px;
}

.mrw-timeline {
    position: relative;
    padding-left: 30px;
}

.mrw-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.mrw-timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 20px;
}

.mrw-timeline-item.current .mrw-timeline-marker {
    background: #0073aa;
    border-color: #0073aa;
}

.mrw-timeline-marker {
    position: absolute;
    left: -22px;
    top: 5px;
    width: 12px;
    height: 12px;
    border: 3px solid #ccc;
    background: white;
    border-radius: 50%;
}

.mrw-timeline-content {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.mrw-timeline-status {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #333;
}

.mrw-timeline-date,
.mrw-timeline-location,
.mrw-timeline-notes {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
}

/* Última actualización */
.mrw-last-updated {
    text-align: right;
    margin-bottom: 15px;
    font-style: italic;
}

/* Mensajes */
.mrw-tracking-messages {
    margin-top: 15px;
}

.mrw-tracking-messages .notice {
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.mrw-tracking-messages .notice-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.mrw-tracking-messages .notice-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.mrw-tracking-messages .notice-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

/* Shortcode de seguimiento */
.mrw-tracking-shortcode {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mrw-tracking-form {
    margin-bottom: 20px;
}

.mrw-tracking-form p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.mrw-tracking-form label {
    font-weight: bold;
    margin-right: 10px;
}

.mrw-tracking-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.mrw-tracking-form button {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.mrw-tracking-form button:hover {
    background: #005a87;
}

/* Estados de error */
.mrw-error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.mrw-no-tracking {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Página de seguimiento independiente */
.mrw-tracking-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Información de envío en detalles del pedido (tema básico) */
.woocommerce-order-shipping-tracking {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.woocommerce-order-shipping-tracking h3 {
    margin-top: 0;
    color: #0073aa;
}

/* Responsive */
@media (max-width: 768px) {
    .mrw-status-card {
        flex-direction: column;
        text-align: center;
    }
    
    .mrw-status-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .mrw-tracking-form p {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mrw-tracking-form input[type="text"] {
        min-width: auto;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .mrw-timeline {
        padding-left: 20px;
    }
    
    .mrw-timeline-marker {
        left: -17px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mrw-tracking-details {
    animation: fadeIn 0.3s ease-in-out;
}

/* Estados de carga */
.mrw-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.mrw-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Compatibilidad con temas populares */
.woocommerce-account .mrw-tracking-shortcode,
.woocommerce .mrw-tracking-shortcode {
    background: var(--wc-background-color, #f8f9fa);
}

/* Ajustes para temas oscuros */
@media (prefers-color-scheme: dark) {
    .woocommerce-mrw-tracking-section {
        background: #2c2c2c;
        border-color: #555;
        color: #fff;
    }
    
    .mrw-status-card {
        background: #1e1e1e;
        color: #fff;
    }
    
    .mrw-timeline-content {
        background: #1e1e1e;
        border-color: #555;
        color: #fff;
    }
}