/* Custom styles */
.gradient-text {
    background: linear-gradient(135deg, #0d6efd, #6f42c1, #dc3545);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar fixo com abertura de submenu por clique */
:root {
    --sidebar-width-collapsed: 64px;
    --sidebar-width-expanded: 260px;
}

#app-sidebar.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width-collapsed);
    background: #2b3a4a; /* cinza azulado */
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1040;
    transition: width 0.2s ease;
    display: flex;
    flex-direction: column;
}

#mainContent {
    margin-left: var(--sidebar-width-collapsed);
    padding-left: 16px; /* espaçamento interno suave do conteúdo */
    box-sizing: border-box;
    transition: margin-left 0.2s ease, padding-left 0.2s ease;
}

/* Layout específico da seção de Rapport: centralizado com padding lateral */
.rapport-container {
    max-width: 1000px;
    margin: 0 auto;
    padding-left: 100px;
    padding-right: 100px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .rapport-container { padding-left: 16px; padding-right: 16px; }
}

.sidebar-inner {
    padding: 12px 8px;
}

.menu-item,
.menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #ffffff; /* texto branco */
    text-decoration: none;
    cursor: pointer;
}

/* Garante que itens com submenu empilhem verticalmente */
.menu-item.has-sub {
    flex-direction: column;
    align-items: stretch;
}
.menu-item.has-sub .menu-head,
.menu-item.has-sub .submenu {
    width: 100%;
}

.menu-item:hover,
.menu-head:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.menu-item i,
.menu-head i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.menu-label {
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: #ffffff;
}

/* Expansão no hover (desktop) */
#app-sidebar:hover { width: var(--sidebar-width-expanded); }
#app-sidebar:hover ~ #mainContent { margin-left: var(--sidebar-width-expanded); }
#app-sidebar:hover .menu-label { opacity: 1; }

.menu-item.has-sub .submenu {
    display: none;
    flex-direction: column;
    padding-left: 24px; /* abre para baixo com leve indentação */
    margin-top: 6px;
}

.menu-item.has-sub.open .submenu {
    display: block; /* abre para baixo quando ativo por clique */
}

.submenu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: #ffffff; /* texto branco no submenu */
    text-decoration: none;
    border-radius: 6px;
}
/* Ícone de marcas nos submenus (ex.: Google) */
.submenu a .menu-icon {
    width: 20px;
    height: 20px;
}
/* Rótulo do submenu com transição para modo colapsado */
.submenu-label {
    transition: opacity 0.15s ease, width 0.2s ease;
    white-space: nowrap;
}

.submenu a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}
/* Quando colapsado (sem hover): mostrar apenas ícones nos submenus */
#app-sidebar:not(:hover) .menu-item.has-sub .submenu { padding-left: 0; }
#app-sidebar:not(:hover) .submenu-label { opacity: 0; width: 0; overflow: hidden; }
#app-sidebar:not(:hover) .submenu a { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
/* Quando em hover: labels e layout normal */
#app-sidebar:hover .submenu-label { opacity: 1; width: auto; }
#app-sidebar:hover .submenu a { justify-content: flex-start; gap: 8px; }

/* Tema claro */
[data-bs-theme="light"] #app-sidebar {
    background: #e9ecef;
}

[data-bs-theme="light"] .menu-item,
[data-bs-theme="light"] .menu-head {
    color: #0b1320;
}

[data-bs-theme="light"] .menu-item:hover,
[data-bs-theme="light"] .menu-head:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #111827;
}

[data-bs-theme="light"] .submenu a {
    color: #0b1320;
}

[data-bs-theme="light"] .submenu a:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #111827;
}

/* Cards pequenos e centralizados para estatísticas e gráficos */
.stats-card {
    background: #1e2a38; /* cinza azulado escuro */
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 225, 255, 0.25); /* neon sutil */
    box-shadow: 0 0 8px rgba(0, 225, 255, 0.15);
    max-width: 180px;
    margin: 0 auto; /* centraliza */
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(0, 225, 255, 0.35);
}

[data-bs-theme="dark"] .stats-card {
    background: #1e2a38;
}

[data-bs-theme="light"] .stats-card {
    background: #f1f3f5;
    border-color: rgba(13, 110, 253, 0.25);
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.15);
}

.chart-card {
    max-width: 300px;
    margin: 0 auto; /* centraliza os gráficos */
    border: 1px solid rgba(0, 225, 255, 0.25);
    box-shadow: 0 0 10px rgba(0, 225, 255, 0.2);
    background: #1b2735; /* tom cinza azulado mais profundo */
}

[data-bs-theme="light"] .chart-card {
    background: #f8f9fa;
    border-color: rgba(13, 110, 253, 0.25);
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.2);
}

/* Container das estatísticas centralizado com colunas ajustáveis */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    justify-items: center;
}

/* Responsividade: mobile até 768px */
@media (max-width: 768px) {
    #app-sidebar.sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width-expanded);
        box-shadow: 0 0 12px rgba(0,0,0,0.3);
    }
    #app-sidebar.sidebar.open {
        transform: translateX(0);
    }
    #mainContent {
        margin-left: 0; /* conteúdo ocupa largura total */
        padding-left: 16px; /* espaçamento suave no mobile */
    }
    /* No mobile, exibe labels normalmente quando aberto */
    #app-sidebar.sidebar .menu-label,
    #app-sidebar.sidebar .submenu-label { opacity: 1; width: auto; }
    #app-sidebar.sidebar .submenu a { justify-content: flex-start; gap: 8px; }
    /* Ajuste dos cards no mobile */
    .chart-card { max-width: 100%; }
    .stats-card { max-width: 100%; }
}

/* Desktop: garante que o conteúdo acompanhe a largura do menu */
@media (min-width: 769px) {
    #mainContent { margin-left: var(--sidebar-width-collapsed); }
    #app-sidebar:hover ~ #mainContent { margin-left: var(--sidebar-width-expanded); }
}

.gradient-bg {
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    width: 100px;
}

.gradient-bg-infinite {
    background: linear-gradient(135deg, #0d6efd, #6f42c1, #dc3545, #198754);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    text-align: center;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.search-type-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.search-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-type-card.active {
    border-color: #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.1);
}

.platform-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.platform-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.platform-card.active {
    border-color: #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.1);
}

.prospect-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.prospect-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.prospect-card.selected {
    border: 2px solid #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.1);
}

.stats-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .stats-card {
    background: linear-gradient(135deg, #212529, #495057);
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.export-section {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1), rgba(13, 110, 253, 0.1));
    border-radius: 15px;
    border: 2px dashed #198754;
}

.search-header {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(111, 66, 193, 0.1));
    border-radius: 15px;
}

.loading-spinner {
    display: none;
}

.hero-section {
    background: linear-gradient(135deg, #0d6efd, #6f42c1, #dc3545);
    color: white;
    border-radius: 20px;
    margin-bottom: 2rem;
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
}

.pagination-controls {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05), rgba(111, 66, 193, 0.05));
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.filter-status {
    background: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.whatsapp-status {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 12px;
}

.rating-stars {
    color: #ffc107;
}

.export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.linkedin-gradient {
    background: linear-gradient(135deg, #0077b5, #004182);
    width: 100px;
}

.instagram-gradient {
    background: linear-gradient(135deg, #e4405f, #833ab4);
    width: 100px;
}

.maps-gradient {
    background: linear-gradient(135deg, #4285f4, #34a853);
    width: 100px;
}

#minimap {
    height: 300px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.platform-example {
    font-size: 0.85rem;
    opacity: 0.8;
}

.search-mode-section {
    transition: all 0.3s ease;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d6efd, #6f42c1, #dc3545);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .login-card {
    background: rgba(33, 37, 41, 0.95);
    color: white;
}

.main-content {
    display: block;
}

.main-content.authenticated {
    display: block;
}

.login-form .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.login-loading {
    display: none;
}

.pulse-animation {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* ==== Login Page Theme (cinza-azulado, botões azul neon, texto claro) ==== */
.login-page {
    background: linear-gradient(135deg, #0f1f2e 0%, #1a2f4a 100%);
    min-height: 100vh;
    color: #e9f3ff;
}

.login-page .login-card {
    background: rgba(22, 32, 44, 0.92);
    color: #e9f3ff;
    border: none;
    border-radius: 18px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}

.login-page .form-label,
.login-page p { color: #dbe7f5; }

.login-page .form-control {
    background-color: #1b2a3a;
    border-color: #2a4d73;
    color: #e9f3ff;
}
.login-page .form-control::placeholder { color: #a8bfd6; }
.login-page .form-control:focus {
    border-color: #00b3ff;
    box-shadow: 0 0 0 0.2rem rgba(0, 179, 255, 0.25);
}

.login-page .btn-primary {
    background-color: #00b3ff;
    border-color: #00b3ff;
    color: #001320;
    text-shadow: 0 0 2px rgba(255,255,255,0.4);
    box-shadow: 0 0 10px rgba(0, 179, 255, 0.7), inset 0 0 12px rgba(0, 179, 255, 0.25);
}
.login-page .btn-primary:hover {
    background-color: #15c8ff;
    border-color: #15c8ff;
    box-shadow: 0 0 14px rgba(21, 200, 255, 0.8), inset 0 0 16px rgba(21, 200, 255, 0.35);
}

.login-page .btn-outline-secondary {
    color: #cfe4ff;
    border-color: #4a6a8b;
}
.login-page .btn-outline-secondary:hover {
    background-color: #23364b;
}

.login-page .alert-danger {
    background-color: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.4);
    color: #ffd5db;
}

.login-footer { color: #a8bfd6; }
