/**
 * Estilos CSS para ACF + Woo Subscriptions Fascículos
 *
 * @package ACF_Woo_Fasciculos
 * @since 3.0.0
 */

/* Contenedor principal del plan de fascículos */
.acf-wcs-fasciculos {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

/* Título del plan */
.acf-wcs-fasciculos h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Tabla del plan */
.acf-wcs-fasciculos .shop_table {
    margin-bottom: 15px;
    background: #fff;
    border-collapse: collapse;
    width: 100%;
}

.acf-wcs-fasciculos .shop_table th {
    background: #f7f7f7;
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #e5e5e5;
}

.acf-wcs-fasciculos .shop_table td {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.acf-wcs-fasciculos .shop_table tr:last-child td {
    border-bottom: none;
}

.acf-wcs-fasciculos .shop_table tr:nth-child(even) {
    background: #f9f9f9;
}

/* Descripción del plan */
.acf-wcs-fasciculos .description {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin: 0;
}

/* Información del fascículo en el carrito */
.cart_item .fasciculo-info {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* Información del fascículo en el checkout */
.checkout .fasciculo-info {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* Información del fascículo en emails */
.woocommerce .fasciculo-info {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* Panel de administración - Información del plan */
.fasciculos-info {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-left: 3px solid #2271b1;
    font-size: 13px;
}

.fasciculos-info strong {
    color: #2271b1;
}

/* Responsive - Tabla */
@media screen and (max-width: 768px) {
    .acf-wcs-fasciculos .shop_table {
        font-size: 14px;
    }
    
    .acf-wcs-fasciculos .shop_table th,
    .acf-wcs-fasciculos .shop_table td {
        padding: 8px;
    }
}

/* Responsive - Contenedor */
@media screen and (max-width: 480px) {
    .acf-wcs-fasciculos {
        padding: 15px;
    }
    
    .acf-wcs-fasciculos h3 {
        font-size: 16px;
    }
}

/* Animaciones suaves */
.acf-wcs-fasciculos {
    transition: all 0.3s ease;
}

/* Hover effects */
.acf-wcs-fasciculos:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Print styles */
@media print {
    .acf-wcs-fasciculos {
        background: #fff;
        border: 1px solid #000;
    }
    
    .acf-wcs-fasciculos .shop_table {
        background: #fff;
    }
}

/* Tracking Status timeline styles */
.acf-wcs-tracking-status {
    margin: 32px 0;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    font-family: system-ui, -apple-system, sans-serif;
}

.acf-wcs-tracking-status h3 {
    margin: 0 0 12px 0 !important;
    color: #1e293b;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.acf-wcs-tracking-status h3 .dashicons {
    color: #3b82f6;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.acf-wcs-tracking-status .tracking-meta {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #cbd5e1;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.acf-wcs-tracking-status .tracking-meta strong {
    color: #334155;
    font-weight: 600;
}

.acf-wcs-tracking-status .tracking-meta code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.tracking-timeline {
    position: relative;
    padding-left: 28px;
    margin-top: 10px;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 12px;
    left: 9px;
    width: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.timeline-item:first-child {
    opacity: 1; /* El evento más reciente (primero en la lista) destaca más */
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    top: 6px;
    left: -28px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 2px #e2e8f0;
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-content {
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.timeline-item:hover .timeline-content {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.event-time {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 6px;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.event-status {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}

/* Status variants */
.timeline-item.status-delivered {
    opacity: 1;
}
.timeline-item.status-delivered .timeline-marker {
    background: #22c55e;
    box-shadow: 0 0 0 2px #22c55e, 0 0 12px rgba(34, 197, 94, 0.4);
}
.timeline-item.status-delivered .timeline-content {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.timeline-item.status-delivered .event-status {
    color: #166534;
}
.timeline-item.status-delivered .event-time {
    color: #15803d;
    border-color: #bbf7d0;
}

.timeline-item.status-in-transit .timeline-marker {
    background: #3b82f6;
    box-shadow: 0 0 0 2px #3b82f6, 0 0 12px rgba(59, 130, 246, 0.4);
}
.timeline-item.status-in-transit .timeline-content {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.timeline-item.status-in-transit .event-status {
    color: #1e40af;
}

.timeline-item.status-pending .timeline-marker {
    background: #f59e0b;
    box-shadow: 0 0 0 2px #f59e0b;
}
.timeline-item.status-pending .timeline-content {
    background: #fffbeb;
    border-color: #fde68a;
}
.timeline-item.status-pending .event-status {
    color: #b45309;
}

.timeline-item.status-cancelled .timeline-marker {
    background: #ef4444;
    box-shadow: 0 0 0 2px #ef4444;
}
.timeline-item.status-cancelled .timeline-content {
    background: #fef2f2;
    border-color: #fecaca;
}
.timeline-item.status-cancelled .event-status {
    color: #991b1b;
}

/* Animación de entrada */
@keyframes timelineFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.acf-wcs-tracking-status {
    animation: timelineFadeIn 0.5s ease-out forwards;
}