<?php $__env->startSection('title', __('Dashboard')); ?>

<?php $__env->startSection('content'); ?>
    <div class="container-fluid px-0">
        
        <div class="mb-5 mt-2">
            <h1 class="h2 fw-extrabold text-dark mb-1" style="letter-spacing: -0.02em;"><?php echo e(__('Hola, :name', ['name' => explode(' ', Auth::user()->name)[0]])); ?> 👋</h1>
            <p class="text-muted" style="font-size: 0.95rem;"><?php echo e(__('Esto es lo que está pasando en tu plataforma hoy.')); ?></p>
        </div>

        
        <div class="row g-4 mb-5">
            
            <div class="col-xl-3 col-md-6">
                <div class="card h-100 border-0 shadow-sm transition-hover" style="border-radius: 24px; background: #ffffff;">
                    <div class="card-body p-4">
                        <div class="d-flex align-items-center justify-content-between mb-4">
                            <div class="rounded-circle d-flex align-items-center justify-content-center shadow-sm" 
                                 style="width: 52px; height: 52px; background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); color: #16a34a;">
                                <i class="fas fa-wallet fa-lg"></i>
                            </div>
                            <span class="badge rounded-pill bg-success-subtle text-success border-0 px-3 py-2" style="font-size: 0.65rem; font-weight: 800;">+12.5%</span>
                        </div>
                        <h6 class="text-muted small fw-bold text-uppercase mb-2" style="letter-spacing: 0.08em;"><?php echo e(__('Ingresos Netos')); ?></h6>
                        <div class="d-flex align-items-baseline">
                            <h2 class="fw-black text-dark mb-0" style="font-size: 1.85rem;">$<?php echo e(number_format($stats['organizer_net'], 2)); ?></h2>
                            <span class="ms-2 text-muted small">USD</span>
                        </div>
                    </div>
                </div>
            </div>

            
            <div class="col-xl-3 col-md-6">
                <div class="card h-100 border-0 shadow-sm transition-hover" style="border-radius: 24px; background: #ffffff;">
                    <div class="card-body p-4">
                        <div class="d-flex align-items-center justify-content-between mb-4">
                            <div class="rounded-circle d-flex align-items-center justify-content-center shadow-sm" 
                                 style="width: 52px; height: 52px; background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); color: #2563eb;">
                                <i class="fas fa-ticket-alt fa-lg"></i>
                            </div>
                            <span class="badge rounded-pill bg-primary-subtle text-primary border-0 px-3 py-2" style="font-size: 0.65rem; font-weight: 800;"><?php echo e(__('EN VIVO')); ?></span>
                        </div>
                        <h6 class="text-muted small fw-bold text-uppercase mb-2" style="letter-spacing: 0.08em;"><?php echo e(__('Tickets Vendidos')); ?></h6>
                        <h2 class="fw-black text-dark mb-0" style="font-size: 1.85rem;"><?php echo e(number_format($stats['orders_count'])); ?></h2>
                    </div>
                </div>
            </div>

            
            <div class="col-xl-3 col-md-6">
                <div class="card h-100 border-0 shadow-sm transition-hover" style="border-radius: 24px; background: #ffffff;">
                    <div class="card-body p-4">
                        <div class="d-flex align-items-center justify-content-between mb-4">
                            <div class="rounded-circle d-flex align-items-center justify-content-center shadow-sm" 
                                 style="width: 52px; height: 52px; background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%); color: var(--rt-cherry);">
                                <i class="fas fa-chart-pie fa-lg"></i>
                            </div>
                            <i class="fas fa-info-circle text-muted opacity-25"></i>
                        </div>
                        <h6 class="text-muted small fw-bold text-uppercase mb-2" style="letter-spacing: 0.08em;"><?php echo e(__('Fees Plataforma')); ?></h6>
                        <div class="d-flex align-items-baseline">
                            <h2 class="fw-black text-dark mb-0" style="font-size: 1.85rem;">$<?php echo e(number_format($stats['platform_fees'], 2)); ?></h2>
                            <span class="ms-2 text-muted small">USD</span>
                        </div>
                    </div>
                </div>
            </div>

            
            <div class="col-xl-3 col-md-6">
                <div class="card h-100 border-0 shadow-sm transition-hover" style="border-radius: 24px; background: #ffffff;">
                    <div class="card-body p-4">
                        <div class="d-flex align-items-center justify-content-between mb-4">
                            <div class="rounded-circle d-flex align-items-center justify-content-center shadow-sm" 
                                 style="width: 52px; height: 52px; background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); color: #475569;">
                                <i class="fas fa-coins fa-lg"></i>
                            </div>
                            <div class="d-flex gap-1">
                                <div style="width: 6px; height: 6px; border-radius: 50%; background: #22c55e;"></div>
                                <div style="width: 6px; height: 6px; border-radius: 50%; background: #e2e8f0;"></div>
                                <div style="width: 6px; height: 6px; border-radius: 50%; background: #e2e8f0;"></div>
                            </div>
                        </div>
                        <h6 class="text-muted small fw-bold text-uppercase mb-2" style="letter-spacing: 0.08em;"><?php echo e(__('Recaudación Total')); ?></h6>
                        <h2 class="fw-black text-dark mb-0" style="font-size: 1.85rem;">$<?php echo e(number_format($stats['total_revenue'], 2)); ?></h2>
                    </div>
                </div>
            </div>
        </div>

        
        <div class="row g-4">
            <div class="col-12">
                <div class="card border-0 shadow-sm" style="border-radius: 24px; background: #ffffff;">
                    <div class="card-header bg-transparent border-0 px-4 pt-4 pb-0">
                        <div class="d-flex align-items-center justify-content-between">
                            <div>
                                <h5 class="fw-bold text-dark mb-0"><?php echo e(__('Análisis de Rendimiento')); ?></h5>
                                <p class="text-muted small mb-0"><?php echo e(__('Volumen de ventas de los últimos 7 días')); ?></p>
                            </div>
                            <div class="btn-group shadow-sm" role="group" style="border-radius: 12px; overflow: hidden;">
                                <button type="button" class="btn btn-white btn-sm active border-0 px-3"><?php echo e(__('7 Días')); ?></button>
                                <button type="button" class="btn btn-white btn-sm border-0 px-3 text-muted"><?php echo e(__('30 Días')); ?></button>
                            </div>
                        </div>
                    </div>
                    <div class="card-body p-4">
                        <div style="height: 350px;">
                            <canvas id="salesChart"></canvas>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <style>
        .fw-extrabold { font-weight: 800; }
        .fw-black { font-weight: 900; }
        .transition-hover { transition: all 0.3s cubic-bezier(.25,.8,.25,1); }
        .transition-hover:hover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(0,0,0,0.08) !important; }
        .btn-white { background: #ffffff; color: #1c1c1e; }
        .btn-white.active { background: #1c1c1e; color: #ffffff; }
    </style>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
<script>
    const ctx = document.getElementById('salesChart').getContext('2d');
    
    const gradient = ctx.createLinearGradient(0, 0, 0, 350);
    gradient.addColorStop(0, 'rgba(185, 24, 48, 0.15)');
    gradient.addColorStop(0.5, 'rgba(185, 24, 48, 0.05)');
    gradient.addColorStop(1, 'rgba(185, 24, 48, 0)');

    new Chart(ctx, {
        type: 'line',
        data: {
            labels: <?php echo json_encode($chartLabels, 15, 512) ?>,
            datasets: [{
                label: '<?php echo e(__("Ventas")); ?>',
                data: <?php echo json_encode($chartTotals, 15, 512) ?>,
                borderColor: '#b91830',
                borderWidth: 4,
                fill: true,
                backgroundColor: gradient,
                tension: 0.45,
                pointRadius: 0,
                pointHoverRadius: 8,
                pointHoverBackgroundColor: '#b91830',
                pointHoverBorderColor: '#ffffff',
                pointHoverBorderWidth: 4,
            }]
        },
        options: {
            responsive: true,
            maintainAspectRatio: false,
            interaction: {
                intersect: false,
                mode: 'index',
            },
            plugins: {
                legend: { display: false },
                tooltip: {
                    backgroundColor: '#1c1c1e',
                    titleFont: { size: 14, weight: 'bold' },
                    bodyFont: { size: 13 },
                    padding: 12,
                    cornerRadius: 12,
                    displayColors: false,
                    callbacks: {
                        label: function(context) {
                            return '$' + context.parsed.y.toLocaleString();
                        }
                    }
                }
            },
            scales: {
                y: {
                    beginAtZero: true,
                    grid: { color: 'rgba(0,0,0,0.04)', drawBorder: false },
                    ticks: { 
                        font: { size: 11, weight: '500' }, 
                        color: '#8e8e93',
                        padding: 10,
                        callback: value => '$' + value
                    }
                },
                x: {
                    grid: { display: false },
                    ticks: { 
                        font: { size: 11, weight: '500' }, 
                        color: '#8e8e93',
                        padding: 10
                    }
                }
            }
        }
    });
</script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.dashboard', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/resources/views/dashboard/index.blade.php ENDPATH**/ ?>