/* ═══════════════════════════════════════════════════════════
   Tráfego Pago SaaS — Estilos Customizados
   Complementa Preline UI v4.1.2 / Tailwind CSS
   ═══════════════════════════════════════════════════════════ */

/* ─── Fontes ──────────────────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Scrollbar customizada ──────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ─── Transições suaves ──────────────────────────────── */
a, button, input, select, textarea {
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Toast container ─────────────────────────────────── */
#toast-container {
    pointer-events: none;
}

#toast-container > * {
    pointer-events: auto;
}

/* ─── Sidebar ativa — indicador lateral ───────────────── */
.sidebar-link-active {
    position: relative;
}

.sidebar-link-active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #3b82f6;
    border-radius: 0 3px 3px 0;
}

/* ─── Stat cards com gradiente sutil ─────────────────── */
.stat-card-gradient {
    position: relative;
    overflow: hidden;
}

.stat-card-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.05;
    transform: translate(30%, -30%);
}

.stat-card-gradient.stat-blue::before { background: #3b82f6; }
.stat-card-gradient.stat-green::before { background: #10b981; }
.stat-card-gradient.stat-purple::before { background: #8b5cf6; }
.stat-card-gradient.stat-orange::before { background: #f59e0b; }
.stat-card-gradient.stat-teal::before { background: #14b8a6; }
.stat-card-gradient.stat-red::before { background: #ef4444; }
.stat-card-gradient.stat-indigo::before { background: #6366f1; }
.stat-card-gradient.stat-cyan::before { background: #06b6d4; }

/* ─── Tabelas responsivas ─────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─── Badge de mídia ──────────────────────────────────── */
.badge-google {
    background-color: #fee2e2;
    color: #dc2626;
}
.badge-meta {
    background-color: #dbeafe;
    color: #2563eb;
}
.badge-linkedin {
    background-color: #cffafe;
    color: #0891b2;
}
.badge-tiktok {
    background-color: #f3f4f6;
    color: #1f2937;
}

.dark .badge-google {
    background-color: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
}
.dark .badge-meta {
    background-color: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
}
.dark .badge-linkedin {
    background-color: rgba(8, 145, 178, 0.15);
    color: #67e8f9;
}
.dark .badge-tiktok {
    background-color: rgba(107, 114, 128, 0.15);
    color: #d1d5db;
}

/* ─── Loading overlay para ações ──────────────────────── */
.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    border-radius: inherit;
    z-index: 10;
}

.dark .loading-overlay {
    background: rgba(23, 23, 23, 0.7);
}

/* ─── Animação fade in ────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* ─── Cards com hover sutil ───────────────────────────── */
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

.dark .card-hover:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
}

/* ─── Pulsação para indicadores de status ─────────────── */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot-ativo {
    background-color: #10b981;
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot-inativo {
    background-color: #ef4444;
}

.status-dot-pendente {
    background-color: #f59e0b;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ─── Formulários: grupo com ícone ────────────────────── */
.input-group {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.input-group input {
    padding-left: 40px;
}

/* ─── Tabs ativos ─────────────────────────────────────── */
.tab-active {
    border-bottom: 2px solid #3b82f6;
    color: #3b82f6;
    font-weight: 600;
}

.dark .tab-active {
    border-bottom-color: #60a5fa;
    color: #60a5fa;
}

/* ─── KPI cards do relatório ──────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

@media (min-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ─── Print styles (para PDF) ─────────────────────────── */
@media print {
    .no-print { display: none !important; }

    body {
        background: white !important;
        color: black !important;
    }

    .print-break {
        page-break-before: always;
    }
}

/* ─── Toggle switch customizado ───────────────────────── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3b82f6;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* ─── Empty state ilustração ──────────────────────────── */
.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

/* ─── Responsividade da sidebar no conteúdo ───────────── */
@media (max-width: 1023px) {
    .lg\:ps-\[260px\] {
        padding-inline-start: 0 !important;
    }
}
