/* assets/css/style.css */

/* Importando a fonte hiper-moderna "Outfit" */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&display=swap');

:root {
    /* Fundo Absoluto (Full Black) com Brilho Ciano / A Pedido CEO */
    --bg-main: #000000;
    --bg-gradient: radial-gradient(circle at top center, rgba(131, 241, 247, 0.07), transparent 600px);

    /* Ciano Puro da Logo da DataPulse */
    --accent-cyan: #83f1f7;
    --accent-purple: #00e5ff; /* Trocado para Ciano brilhante para manter a harmonia monocromática Ciano no Plano PRO */

    --gradient-glow: linear-gradient(135deg, #83f1f7 0%, #00d2ff 100%);

    /* Cards Ultra Premium Escuros */
    --glass-bg: #080808;
    --glass-hover: #121212;
    --glass-border: #1a1a1a;

    /* Textos */
    --text-primary: #ffffff;
    --text-muted: #737373;
}

/* --- Reset Global de Caixas --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- Animações Globais --- */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
    }

    100% {
        box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    }
}

/* --- Reset e Base --- */
body {
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding: 0;
    /* <-- Zeramos o espaçamento externo aqui! */
    overflow: hidden;
    /* <-- Isso trava a rolagem global da página */
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeUp 0.8s ease-out forwards;
}

/* --- Cabeçalho --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 20px;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    margin: 5px 0 0 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 300;
}

.header a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: 0.3s;
}

.header a:hover {
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

/* --- Inputs e Botões Elegantes --- */
input,
select {
    width: 100%;
    padding: 12px 16px;
    background-color: #0A0A0A;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(131, 241, 247, 0.2);
}

button,
.btn {
    padding: 12px 24px;
    background: var(--gradient-glow);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(123, 97, 255, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* --- Cards de Vidro (Glassmorphism) --- */
.panel,
.card,
.kpi-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.panel:hover,
.card:hover,
.kpi-card:hover {
    background: var(--glass-hover);
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.panel h3,
.card h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
    font-weight: 500;
}

/* --- Grid de KPIs (Os números grandes) --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
}

/* Uma linha neon sutil no topo de cada card */
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
    opacity: 0.7;
    transition: 0.3s;
}

.kpi-card:hover::before {
    opacity: 1;
    height: 3px;
    box-shadow: 0 0 10px var(--accent-cyan);
}

.kpi-card h3 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    padding: 0;
    margin-bottom: 10px;
}

.kpi-card .value {
    font-size: 38px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* --- Outras Grids --- */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.grid-forms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.geo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* --- Tabelas Modernas --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    /* Cria barra de rolagem se a tabela for muito grande */
    background: transparent;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* FIX APLICADO AQUI: Garante que tabelas com scroll fiquem largas, 
mas tabelas nos painéis menores não empurrem os botões para fora */
.table-responsive table {
    min-width: 700px;
}

.panel table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
}

th,
td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.02);
}

td {
    font-size: 14px;
    font-weight: 300;
    word-break: break-word;
    /* FIX: URLs longas agora quebram linha em vez de esticar a tela */
}

tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* --- Barras de Progresso --- */
.progress-bar {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    height: 8px;
    margin-top: 8px;
    border: 1px solid var(--glass-border);
}

.progress-fill {
    background: var(--gradient-glow);
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

/* --- Tela de Login --- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: var(--glass-bg);
    padding: 50px 40px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 420px;
    animation: fadeUp 0.6s ease-out;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 28px;
}

/* --- Formulários e Botões --- */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* --- Animações Interativas da IA --- */

/* 1. Efeito do cursor piscando enquanto digita */
.typing-cursor::after {
    content: '|';
    animation: blink 0.8s step-end infinite;
    color: var(--accent-cyan);
    font-weight: bold;
    margin-left: 2px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* 2. Estado vazio (Convite para gerar análise) */
.ai-empty-state {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
}

.ai-empty-state span {
    font-size: 28px;
    display: block;
    margin-bottom: 12px;
    animation: floatSparkle 3s ease-in-out infinite;
}

@keyframes floatSparkle {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
        text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    }

    50% {
        transform: translateY(-5px) scale(1.1);
        opacity: 1;
        text-shadow: 0 0 20px rgba(0, 229, 255, 0.8);
    }
}

/* 3. Bolinhas de "IA Pensando" */
.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
    color: var(--accent-cyan);
    font-weight: 500;
    letter-spacing: 1px;
}

.ai-loading-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
    border-radius: 50%;
    animation: aiBounce 1.4s infinite ease-in-out both;
}

.ai-loading-dot:nth-child(2) {
    animation-delay: -0.32s;
}

.ai-loading-dot:nth-child(3) {
    animation-delay: -0.16s;
}

.ai-loading-dot:nth-child(4) {
    animation-delay: 0s;
}

@keyframes aiBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Efeito de Pulsar Neon para o Ao Vivo */
.live-dot {
    width: 12px;
    height: 12px;
    background-color: #10B981;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 10px #10B981;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* ==========================================
   NOVO LAYOUT: SIDEBAR & MAIN CONTENT
   ========================================== */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* --- Menu Lateral --- */
.sidebar {
    width: 260px;
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    flex-shrink: 0;
}

.sidebar-title {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    padding-left: 10px;
}

.sidebar-link {
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-cyan);
    border-left: 3px solid var(--accent-cyan);
}

/* --- Área de Conteúdo --- */
.main-content {
    flex: 1;
    padding: 0 40px 40px 40px;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* --- Top Header (Logo Centralizada e Fixo / Sticky) --- */
.top-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.logo-center {
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* --- Controle de tamanho da Logo --- */
.top-header img {
    height: 55px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.top-header img:hover {
    transform: scale(1.05);
}

/* --- Nova Grid para os Gráficos Principais --- */
.dual-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

/* Customização da Barra de Rolagem (Estilo Mac/Dark) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: #2D3748;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4A5568;
}

/* --- Estilização dos Ícones (Boxicons) --- */
.sidebar-link i {
    font-size: 20px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.sidebar-link:hover i,
.sidebar-link.active i {
    color: var(--accent-cyan);
}

.kpi-card h3 i,
.panel h3 i {
    font-size: 18px;
    margin-right: 6px;
    vertical-align: middle;
}

.kpi-card h3,
.panel h3 {
    display: flex;
    align-items: center;
}

/* ==========================================
   ANIMAÇÕES E UTILITÁRIOS NOVOS
   ========================================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin-right: 15px;
}

/* ==========================================
   MEDIA QUERIES (RESPONSIVIDADE PREMIUM)
   ========================================== */
@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dual-charts-grid {
        grid-template-columns: 1fr;
    }

    .geo-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    }

    .sidebar.sidebar-open {
        left: 0;
    }

    .main-content {
        padding: 15px;
    }

    .top-header {
        justify-content: flex-start;
        padding: 15px 0;
    }

    .logo-center {
        margin: 0 auto;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* Permite botões em grid principal quebrarem barra no topo */
    .dashboard-header-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .dashboard-header-actions .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .dashboard-header-actions select {
        width: 100%;
    }
}

/* ==========================================
   SELECTS PREMIUM & ONBOARDING
   ========================================== */
.premium-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.premium-select-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--accent-cyan);
    pointer-events: none;
    font-size: 16px;
    z-index: 2;
}

.premium-select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    padding-left: 38px;
    padding-right: 38px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 42px;
}

.premium-select-wrapper select:hover {
    border-color: rgba(131, 241, 247, 0.4);
    box-shadow: 0 0 10px rgba(131, 241, 247, 0.1);
}

.premium-select-wrapper::after {
    content: "\ebdb";
    /* bx-chevron-down */
    font-family: 'boxicons';
    font-size: 16px;
    color: var(--text-muted);
    position: absolute;
    right: 14px;
    pointer-events: none;
}

/* ==========================================
   ALERTA PROATIVO (Canto Superior Direito)
   ========================================== */
.header-actions-right {
    position: absolute;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.notif-bell {
    position: relative;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.notif-bell:hover {
    color: var(--accent-cyan);
}

.notif-bell .badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #EF4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--bg-main);
}

/* --- Notification Dropdown CSS --- */
.notif-container { position: relative; }
.notif-badge { 
    position: absolute; top: -5px; right: -5px; 
    background: #EF4444; color: white; font-size: 10px; 
    font-weight: bold; width: 16px; height: 16px; 
    border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; border: 2px solid var(--bg-main); 
}
.notif-popup { 
    display: none; position: absolute; top: calc(100% + 15px); 
    right: 0; width: 320px; background: var(--glass-bg); 
    border: 1px solid var(--glass-border); border-radius: 12px; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.8); z-index: 99999; 
    transform-origin: top right; 
    text-align: left;
}
.notif-popup.active { display: block; animation: fadeUp 0.15s ease-out; }
.notif-header { padding: 15px 20px; border-bottom: 1px solid var(--glass-border); }
.notif-header h4 { margin: 0; font-size: 14px; color: var(--text-primary); font-weight: 500; }
.notif-body { padding: 0; max-height: 350px; overflow-y: auto; }
.notif-item { display: flex; gap: 15px; padding: 15px 20px; border-bottom: 1px solid var(--glass-border); transition: 0.2s; cursor: pointer; }
.notif-item:hover { background: rgba(255,255,255,0.02); }
.notif-item:last-child { border-bottom: none; }
.notif-item strong { font-size: 13px; display: block; margin-bottom: 4px; color: var(--text-primary); }
.notif-item p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.notif-item small { font-size: 10px; color: #555; display: block; margin-top: 6px; }