/* Custom styles for Radar do Casal Investidor */
:root {
  --sidebar-width: 17rem;
  --sidebar-width-icon: 4.5rem;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-active-bg: #f0fdf4;
  --sidebar-active-text: #166534;
  --sidebar-active-border: #bbf7d0;
}

html, body {
  overflow-x: clip;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
}

/* ======================================================== */
/* ESTRUTURA DA SIDEBAR (SHADCN INSPIRAÇÃO) */
/* ======================================================== */

.sidebar-provider {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* Sidebar Desktop */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Estado Colapsado da Sidebar (Modo Ícones) */
.sidebar[data-collapsible="collapsed"] {
  width: var(--sidebar-width-icon);
  min-width: var(--sidebar-width-icon);
}

.sidebar[data-collapsible="collapsed"] .sidebar-hide-on-collapse {
  display: none !important;
}

.sidebar[data-collapsible="collapsed"] .sidebar-menu-btn {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar[data-collapsible="collapsed"] .sidebar-menu-btn span.menu-icon {
  margin: 0 auto;
}

/* Trilho interativo para colapsar/expandir (SidebarRail) */
.sidebar-rail {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 45;
  transition: background 0.15s ease;
}

.sidebar-rail:hover {
  background: rgba(34, 197, 94, 0.35);
}

/* Sidebar Inset (Área de Conteúdo Principal) */
.sidebar-inset {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: #f8fafc;
}

/* Header Fixo / Sticky com transição de elevação */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

/* Sombra aprimorada quando rolar a página */
.app-header.scrolled {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.07), 0 2px 6px -2px rgba(0, 0, 0, 0.04);
  border-bottom-color: #cbd5e1;
}

/* Itens de Menu da Sidebar */
.sidebar-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
}

.sidebar-menu-btn:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}

.sidebar-menu-btn.active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 700;
  border-color: var(--sidebar-active-border);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.sidebar-menu-btn.active .menu-icon {
  transform: scale(1.1);
}

/* Mobile Drawer & Backdrop */
.sidebar-mobile-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 49;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
}

.sidebar-mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }
}

/* ======================================================== */
/* COMPONENTES & VISUAIS */
/* ======================================================== */

/* Transições de Cards */
.card-hover {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

/* Semáforos e badges */
.badge-verde {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-amarelo {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-vermelho {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

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

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

/* Dropdown de busca elevado */
#searchDropdown, #topSearchDropdown {
  z-index: 70 !important;
}

/* Esconder barra de rolagem horizontal em abas */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Animação suave para troca de telas */
.view-section {
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
