/* ========================================================================
   ARQUIVO: css/style.css (Versão 3.0 – HEADER COMPLETAMENTE REFEITO)
   ------------------------------------------------------------------------
   - HEADER MODERNO baseado em Stripe, Linear, Vercel, Figma
   - Espaçamentos EXATOS de 1cm entre elementos
   - Layout limpo e profissional
   - Sem sobreposições ou elementos perdidos
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

/*--------------------------------------------------------------------------- 
  RESET & TIPOGRAFIA 
---------------------------------------------------------------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: "Inter", sans-serif;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--txt);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/*--------------------------------------------------------------------------- 
  VARIÁVEIS DE TEMA 
---------------------------------------------------------------------------*/
:root {
  /* ---------- Light Mode ---------- */
  --bg-light: #ffffff;
  --txt-light: #003366;
  --accent-light: #0080cc;
  --accent-light-hover: #006fa1;
  --bg-light-secondary: #f5f7fa;
  --bg-light-tertiary: #e9eef5;

  /* ---------- Dark Mode ---------- */
  --bg-dark: #0a0f1d;
  --txt-dark: #e6f2ff;
  --accent-dark: #d4af37;
  --accent-dark-hover: #b9952e;
  --bg-dark-secondary: #12161f;
  --bg-dark-tertiary: rgba(255, 255, 255, 0.05);

  /* ---------- Atuais (default: Dark) ---------- */
  --bg: var(--bg-dark);
  --txt: var(--txt-dark);
  --accent: var(--accent-dark);
  --accent-hover: var(--accent-dark-hover);
  --bg-secondary: var(--bg-dark-secondary);
  --bg-tertiary: var(--bg-dark-tertiary);

  /* Cores do Sidebar */
  --bg-sidebar: #0e1425;
  --sidebar-text: #e1e9f0;
  --sidebar-hover-bg: var(--accent-hover);
  --sidebar-active-bg: var(--accent);

  /* Dimensões fixas */
  --height-header: 70px;                  /* Header compacto e elegante */
  --sidebar-collapsed-width: 60px;
  --sidebar-expanded-width: 220px;
  --sidebar-mobile-height: 60px;
  --header-mobile-height: 64px;
  --radius: 8px;

  /* Sombras */
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-dark: 0 2px 8px rgba(0, 0, 0, 0.5);
  
  /* Espaçamentos EXATOS - 1cm = 37.8px */
  --space-1cm: 37.8px;                    /* 1 centímetro exato */
  --space-0-5cm: 18.9px;                  /* 0.5 centímetro */
  --space-0-25cm: 9.45px;                 /* 0.25 centímetro */
}

/* Tema claro × escuro */
body.theme-light {
  --bg: var(--bg-light);
  --txt: var(--txt-light);
  --accent: var(--accent-light);
  --accent-hover: var(--accent-light-hover);
  --bg-secondary: var(--bg-light-secondary);
  --bg-tertiary: var(--bg-light-tertiary);
}

body.theme-dark {
  --bg: var(--bg-dark);
  --txt: var(--txt-dark);
  --accent: var(--accent-dark);
  --accent-hover: var(--accent-dark-hover);
  --bg-secondary: var(--bg-dark-secondary);
  --bg-tertiary: var(--bg-dark-tertiary);
}

/*--------------------------------------------------------------------------- 
  LAYOUT BASE 
---------------------------------------------------------------------------*/
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

/*--------------------------------------------------------------------------- 
  HEADER COMPLETAMENTE REFEITO
---------------------------------------------------------------------------*/
.header-wrapper {
  position: fixed;
  top: 0;
  left: var(--sidebar-collapsed-width);
  right: 0;
  height: var(--height-header);
  background: rgba(10, 15, 29, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  z-index: 1000;
  transition: left 0.3s ease;
}

.sidebar:hover ~ .header-wrapper {
  left: var(--sidebar-expanded-width);
}

/* Container interno do header */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-1cm);
  gap: var(--space-1cm);
}

/* Logo e Brand */
.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-0-5cm);
  flex-shrink: 0;
  z-index: 10;
}

.header-logo-link {
  text-decoration: none;
  display: block;
  transition: transform 0.2s ease;
}

.header-logo-link:hover {
  transform: scale(1.05);
}

.header-logo-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-logo-circle:hover {
  border-color: var(--accent-hover);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
}

.header-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.header-slogan {
  color: var(--txt);
  font-family: 'Playfair Display', serif;
  font-size: 0.875rem;
  line-height: 1.3;
  font-style: italic;
  letter-spacing: 0.2px;
  max-width: 160px;
  white-space: normal;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.header-slogan:hover {
  opacity: 1;
  color: var(--accent);
}

/* Navegação Principal - ESPAÇAMENTO EXATO DE 1CM */
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-1cm); /* EXATAMENTE 1cm entre cada item */
  padding: 0;
  flex: 1;
  justify-content: center;
  color: var(--txt);
  margin: 0 auto;
  max-width: 800px;
}

.nav-menu .nav-item {
  position: relative;
  padding: var(--space-0-25cm) var(--space-0-5cm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--txt);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-menu .nav-item:hover {
  color: var(--accent);
  background-color: rgba(212, 175, 55, 0.1);
}

.nav-menu .nav-item.active {
  background-color: rgba(212, 175, 55, 0.15);
  color: var(--accent);
}

.nav-menu .nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background-color: var(--accent);
  border-radius: 1px;
}

/* Área de busca */
.desktop-only .relative {
  position: relative;
  z-index: 5;
  width: 200px;
  flex-shrink: 0;
}

/* User Menu */
.user-menu-wrapper {
  flex-shrink: 0;
  margin-left: var(--space-0-5cm);
}

/* Switch de tema */
.theme-switch-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: var(--space-0-5cm);
  flex-shrink: 0;
}

/* ==========================================
   TICKER 
   ========================================== */
.ticker {
  position: fixed;
  top: var(--height-header);
  left: var(--sidebar-collapsed-width);
  right: 0;
  height: 40px;
  background-color: var(--bg-secondary);
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  overflow: hidden;
  z-index: 1700;
  transition: left 0.3s ease;
}

.sidebar:hover ~ .ticker {
  left: var(--sidebar-expanded-width);
}

.ticker-inner {
  display: flex;
  align-items: center !important; /* Alinha no centro */
  height: 100%;
  animation: ticker-scroll 60s linear infinite;
  white-space: nowrap;
}

.ticker-inner p {
  color: var(--txt);
  font-size: 0.8rem;
  margin: 0;
  padding: 0 var(--space-0-5cm); /* Removido padding-bottom */
  white-space: nowrap;
  transition: color 0.3s ease;
  opacity: 0.8;
}

.ticker-inner p:hover {
  color: var(--accent);
  opacity: 1;
}

.ticker-inner a {
  color: var(--accent);
  text-decoration: none;
}

.ticker-inner a:hover {
  text-decoration: underline;
}

.ticker-inner span {
  color: var(--accent);
  font-weight: 600;
}

@keyframes ticker-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ==========================================
   RESPONSIVIDADE 
   ========================================== */
@media (max-width: 768px) {
  .sidebar {
    top: 0;
    left: 0;
    width: 100%;
    height: var(--sidebar-mobile-height);
    flex-direction: row;
    padding: 0 var(--space-0-5cm);
    z-index: 2000;
  }

  .sidebar:hover {
    width: 100%;
  }

  .sidebar-nav ul {
    flex-direction: row;
    gap: var(--space-0-25cm);
  }

  .sidebar-item {
    padding: var(--space-0-25cm);
  }

  .sidebar-icon {
    width: 20px;
    height: 20px;
  }

  .sidebar-text {
    display: none;
  }

  .sidebar-item[data-tooltip]:hover::after {
    display: none;
  }

  .header {
    left: 0;
    height: var(--header-mobile-height);
    padding: 0 var(--space-0-5cm);
    gap: var(--space-0-25cm);
  }

  .header-left {
    gap: var(--space-0-25cm);
  }

  .header-center {
    display: none;
  }

  .header-right {
    gap: var(--space-0-25cm);
  }

  .slogan {
    display: none;
  }

  .nav-menu {
    display: none; /* Esconde no mobile */
  }

  .desktop-only {
    display: none !important;
  }

  .theme-switch-wrapper {
    margin-left: var(--space-0-25cm);
  }

  .ticker {
    left: 0;
    top: var(--header-mobile-height);
  }

  .main-content {
    margin-top: calc(var(--sidebar-mobile-height) + var(--header-mobile-height) + 32px);
  }
}

/* ==========================================
   ELEMENTOS MOBILE - APENAS MOBILE
   ========================================== */
.menu-toggle {
  display: none; /* ESCONDE NO DESKTOP */
  position: fixed;
  bottom: var(--space-0-5cm);
  left: var(--space-0-5cm);
  width: 48px;
  height: 48px;
  background-color: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2000;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.menu-toggle:hover {
  background-color: var(--accent-hover);
  transform: scale(1.1);
}

.menu-toggle img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }

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

  .header-wrapper {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }

  .header-wrapper.mobile-open {
    transform: translateY(0);
  }

  .menu-toggle {
    display: flex; /* MOSTRA APENAS NO MOBILE */
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    position: fixed;
    top: calc(var(--sidebar-mobile-height) + var(--header-mobile-height));
    left: 0;
    right: 0;
    background-color: var(--bg);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding: var(--space-0-5cm);
    flex-direction: column;
    gap: var(--space-0-25cm);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 1700;
    display: flex; /* Mostra quando mobile menu está ativo */
  }

  .nav-menu.show {
    transform: translateY(0);
  }

  .nav-item {
    padding: var(--space-0-5cm);
    border-radius: 6px;
    transition: background-color 0.2s ease;
    width: 100%;
    text-align: left;
  }

  .nav-item:hover {
    background-color: var(--bg-secondary);
  }

  .nav-item.active {
    background-color: var(--accent);
    color: #ffffff;
  }

  .main-content {
    margin-top: calc(var(--sidebar-mobile-height) + var(--header-mobile-height) + 32px);
  }
}

@media (max-width: 480px) {
  .nav-menu {
    padding: var(--space-0-25cm);
  }

  .sidebar-item {
    padding: var(--space-0-25cm);
  }

  .sidebar-icon {
    width: 18px;
    height: 18px;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
  }

  .header-wrapper {
    height: 60px;
  }
}

/* ==========================================
   HEADER ESTRUTURA CORRETA
   ========================================== */
.header {
  position: fixed;
  top: 0;
  left: var(--sidebar-collapsed-width);
  right: 0;
  height: var(--height-header);
  background: rgba(10, 15, 29, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  z-index: 1000;
  transition: left 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-1cm);
  gap: var(--space-1cm);
}

.sidebar:hover ~ .header {
  left: var(--sidebar-expanded-width);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-0-5cm);
  flex-shrink: 0;
  z-index: 10;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-0-5cm);
  flex-shrink: 0;
}

/* ==========================================
   ÍCONES MOBILE ALINHADOS
   ========================================== */
.mobile-icons-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--txt);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-search-toggle:hover {
  color: var(--accent);
}

.user-menu-mobile {
  display: flex;
  align-items: center;
}

/* ==========================================
   BOTÕES FLUTUANTES
   ========================================== */
.floating-buttons {
  position: fixed;
  bottom: var(--space-0-5cm);
  right: var(--space-0-5cm);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-0-25cm);
}

.whatsapp-button,
.floating-whatsapp-button {
  width: 56px;
  height: 56px;
  background-color: #25D366;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
  position: fixed;
  bottom: var(--space-0-5cm);
  right: var(--space-0-5cm);
}

.whatsapp-button:hover,
.floating-whatsapp-button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}

.whatsapp-button img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

.whatsapp-button svg {
  width: 28px;
  height: 28px;
  color: white;
}

.whatsapp-button svg path {
  fill: white !important;
}

.whatsapp-button * {
  color: white !important;
  fill: white !important;
}
