/* ============================================================
   ViverFora — Global CSS
   Mobile-first. Breakpoints: sm=640, md=768, lg=1024, 2xl=1536
   ============================================================ */

:root {
  --primary:    #D9FF00;
  --bg-coal:    #0A0A0A;
  --surface:    #111111;
  --toxic:      #D9FF00;
  --border-coal: 2px solid #222;
  --sidebar-w:  270px;
  --sidebar-mini: 68px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-coal);
  color: #fff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── UTILITIES ─────────────────────────────────────────────── */
.text-toxic   { color: var(--primary); }
.gradient-text {
  background: linear-gradient(90deg, #D9FF00, #E5FF4D);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.liquid-bg { background: radial-gradient(circle at 50% 50%, #111 0%, #000 100%); }

/* ── SIDEBAR (shared across dashboard pages) ────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #000;
  border-right: 1px solid #1a1a1a;
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  /* Mobile: hidden by default */
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(0.23, 1, 0.32, 1);
}
.sidebar.open { transform: translateX(0); }

/* Desktop lg+: always visible */
@media (min-width: 1024px) {
  .sidebar { transform: translateX(0); }
}

/* ── MAIN WRAP ──────────────────────────────────────────────── */
.main-wrap {
  margin-left: 0;
  min-height: 100vh;
  transition: margin-left .28s cubic-bezier(0.23, 1, 0.32, 1);
}
@media (min-width: 1024px) {
  .main-wrap {
    margin-left: var(--sidebar-w);
  }
}

/* Full HD — limitar largura máxima do conteúdo interno */
@media (min-width: 1536px) {
  .main-wrap > * {
    max-width: 1440px;
  }
}

/* ── DASH HEADER (sticky header para páginas com sidebar) ────── */
/* Position-aware: respeita a largura do sidebar sem usar main-wrap */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(8px);
  margin-left: 0;
  transition: margin-left .28s cubic-bezier(0.23, 1, 0.32, 1);
}
@media (min-width: 1024px) {
  .dash-header {
    margin-left: var(--sidebar-w);
  }
}


/* ── SIDEBAR OVERLAY (mobile) ───────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 40;
}
.sidebar-overlay.visible { display: block; }

/* ── NAV LINK ───────────────────────────────────────────────── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.nav-link:hover  { color: #fff; background: rgba(255,255,255,0.04); border-left-color: rgba(255,255,255,0.15); }
.nav-link.active { color: var(--primary); background: rgba(217,255,0,0.07); border-left-color: var(--primary); }
.nav-link i, .nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── BRUTAL BUTTONS ─────────────────────────────────────────── */
.brutal-btn {
  background: var(--primary);
  color: #000;
  font-weight: 900;
  text-transform: uppercase;
  padding: 1rem 2rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  box-shadow: 6px 6px 0 #000;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  width: 100%;
  justify-content: center;
}
.brutal-btn:hover   { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 #000; }
.brutal-btn:active  { transform: translate(2px,2px);   box-shadow: 2px 2px 0 #000; }
.brutal-btn-ghost {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
  padding: 1rem 2rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}
.brutal-btn-ghost:hover { border-color: rgba(255,255,255,.5); }

/* ── CARDS ──────────────────────────────────────────────────── */
.card, .dash-card {
  background: var(--surface);
  border: 1px solid #222;
  border-radius: 16px;
  transition: border-color .2s;
}
.card:hover { border-color: var(--primary); }
.dash-card { padding: 24px; position: relative; overflow: hidden; }

.stat-card-brutal {
  background: var(--surface);
  border: 2px solid #222;
  padding: 2rem;
  transition: all .2s;
}
.stat-card-brutal:hover {
  border-color: var(--primary);
  transform: translate(-4px,-4px);
  box-shadow: 8px 8px 0 var(--primary);
}

/* ── BADGE ──────────────────────────────────────────────────── */
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }

/* ── MIGRASCORE ─────────────────────────────────────────────── */
.pillar-strong { color: #059669; }
.pillar-medium { color: #d97706; }
.pillar-weak   { color: #dc2626; }
.pillar-bar { height: 4px; background: rgba(255,255,255,0.05); overflow: hidden; }

.quiz-step { display: none; animation: fadeIn .4s ease; }
.quiz-step.active { display: block; }

/* Answer buttons — migrascore */
.answer-btn {
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  text-align: left;
  border: 2px solid #222;
  background: #111;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  transition: all .2s;
  margin-bottom: 0.5rem;
  position: relative;
}
.answer-btn:hover  { border-color: var(--primary); color: var(--primary); background: #151515; transform: translate(-4px,-4px); box-shadow: 4px 4px 0 var(--primary); }
.answer-btn.selected { background: var(--primary); color: #000; border-color: var(--primary); }

/* Mobile answer btn: less padding */
@media (max-width: 640px) {
  .answer-btn { padding: .75rem 1rem; font-size: .83rem; }
}

/* ── PROGRESS ───────────────────────────────────────────────── */
.progress-track { height: 4px; background: #222; width: 100%; }
.progress-fill  { height: 100%; background: var(--primary); transition: width .5s cubic-bezier(0.23,1,0.32,1); box-shadow: 0 0 12px rgba(217,255,0,0.3); }

/* ── SHARE BUTTONS ──────────────────────────────────────────── */
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; color: #fff; font-weight: 700;
  border-radius: 10px; text-decoration: none; transition: all .2s;
  font-size: 12px; letter-spacing: .05em;
}
.share-btn:hover  { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.share-whatsapp   { background: #25d366; }
.share-linkedin   { background: #0a66c2; }
.share-facebook   { background: #1877f2; }
.share-twitter    { background: #1da1f2; }

/* ── SCORE RING ─────────────────────────────────────────────── */
.score-ring { position: relative; width: 140px; height: 140px; }

/* ── LANDING PAGE ───────────────────────────────────────────── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .12;
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-25px)} }

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.fade-up { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── FORM INPUTS ────────────────────────────────────────────── */
.input-field {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: 12px;
  padding: 1rem;
  width: 100%;
  outline: none;
  transition: all .2s;
  font-family: inherit;
}
.input-field:focus { border-color: var(--primary); background: rgba(255,255,255,0.08); }
.input-field::placeholder { color: rgba(255,255,255,.3); }

/* --- INPUT DARK (Módulo Financeiro) --- */
.input-dark {
  background: #161616;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  width: 100%;
  outline: none;
  transition: all .2s;
  font-family: inherit;
}
select.input-dark {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.input-dark:focus { border-color: var(--primary); background: #1a1a1a; }
.input-dark::placeholder { color: rgba(255,255,255,.2); }
.input-dark option { background: #111; color: #fff; }

/* --- TOGGLE SWITCH (Módulo Financeiro) --- */
.switch-label {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}
.switch-label input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.4);
  transition: .3s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(14px);
  background-color: #000;
}



/* ── PRINT ──────────────────────────────────────────────────── */
/* ── PRINT ──────────────────────────────────────────────────── */
@media print {
  @page { margin: 1cm; }
  
  /* Hide non-essential UI */
  .no-print, 
  .sidebar, 
  .sidebar-overlay, 
  .dash-header, 
  .av-menu,
  nav,
  button:not(.print-only),
  .mobile-menu-toggle { 
    display: none !important; 
  }

  /* Reset Layout */
  .main-wrap { 
    margin: 0 !important; 
    padding: 0 !important; 
    width: 100% !important;
  }

  /* Base Typography & Background */
  body { 
    background: #fff !important; 
    color: #000 !important; 
    -webkit-print-color-adjust: exact; 
    print-color-adjust: exact;
  }

  /* Force High Contrast for all elements */
  * {
    color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    border-color: #eee !important;
  }

  /* Specific fix for "faded" white/opacity text */
  [class*="text-white/"],
  [class*="text-white\\/"] {
    color: #333 !important;
  }
  .text-white\/10, .text-white\/20 { color: #888 !important; }
  .text-white\/30, .text-white\/40 { color: #555 !important; }
  .text-white\/50, .text-white\/60 { color: #333 !important; }

  /* Fix Lucide Icons (Premium look in print) */
  svg.lucide, 
  [data-lucide] svg {
    stroke: #000 !important;
    fill: none !important;
    stroke-width: 2px !important;
  }

  /* Fix Cards */
  .dash-card, .kpi-card {
    background: #fff !important;
    border: 1px solid #ddd !important;
    color: #000 !important;
    break-inside: avoid;
    padding: 1.5rem !important;
    border-radius: 8px !important;
  }

  /* Fix Background/Special items */
  .bg-white\/3, .bg-white\/5, .bg-toxic\/5, .bg-toxic\/10 {
    background: #f9f9f9 !important;
    border: 1px solid #eee !important;
  }

  /* Brand Colors in Print */
  .text-toxic { 
    color: #8a9c00 !important; /* Darker greenish-yellow for better contrast on white */
    font-weight: 900 !important;
  }
  .bg-toxic {
    background: #D9FF00 !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  /* Link Fixes */
  a { text-decoration: none !important; color: #000 !important; }
}

/* ── SCROLLBAR HIDE ─────────────────────────────────────────── */
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ── CHART ──────────────────────────────────────────────────── */
.chart-container { position: relative; }

/* ── CUSTOM MODALS & TOASTS (ViverFora System) ──────────────── */
.v-modal { display: none; position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); }
.v-modal.active { display: flex; }
.v-modal-card { background: #111; border: 2px solid #222; border-radius: 20px; padding: 32px; max-width: 400px; width: 100%; text-align: center; }
.v-modal-card h4 { font-size: 18px; font-weight: 900; margin-bottom: 12px; color: #fff; }
.v-modal-card p { font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.6; margin-bottom: 24px; }
.v-btn-group { display: flex; gap: 12px; }
.v-btn { flex: 1; padding: 12px; border-radius: 10px; font-size: 11px; font-weight: 900; text-transform: uppercase; cursor: pointer; transition: all 0.2s; border: none; }
.v-btn-confirm { background: #ef4444; color: #fff; }
.v-btn-cancel { background: #222; color: rgba(255,255,255,0.6); }
.v-btn-confirm:hover { background: #f87171; transform: translateY(-2px); }
.v-btn-cancel:hover { background: #333; color: #fff; }
.v-toast { position: fixed; bottom: 30px; right: 30px; z-index: 300; background: var(--primary); color: #000; padding: 16px 24px; border-radius: 12px; font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; display: none; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 2px solid #000; }
/* ── DANGER ZONE & MODAL (Shared across dashboard) ──────────── */
.danger-zone { margin-top: 48px; border-top: 1px solid rgba(220, 38, 38, 0.1); padding-top: 24px; }
.danger-card { 
  background: rgba(220, 38, 38, 0.04); 
  border: 1px dashed rgba(220, 38, 38, 0.3); 
  border-radius: 16px; 
  padding: 32px; 
  transition: all 0.2s; 
  margin-top: 16px; 
}
.danger-card:hover { 
  background: rgba(220, 38, 38, 0.08); 
  border-color: #ef4444; 
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.1);
}
.btn-danger { 
  background: #ef4444; 
  color: #fff; 
  border: none; 
  border-radius: 10px; 
  padding: 13px 28px; 
  font-size: 13px; 
  font-weight: 900; 
  letter-spacing: .08em; 
  text-transform: uppercase; 
  cursor: pointer; 
  transition: all .2s; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px; 
}
.btn-danger:hover { 
  background: #dc2626; 
  transform: translateY(-1px); 
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); 
}

/* Modal System */
.modal-backdrop { 
  position: fixed; 
  inset: 0; 
  background: rgba(0,0,0,0.85); 
  backdrop-filter: blur(8px); 
  z-index: 1000; 
  display: none; 
  align-items: center; 
  justify-content: center; 
  padding: 20px; 
}
.modal-backdrop.active { display: flex; }
.modal-content { 
  background: #111; 
  border: 1px solid #333; 
  border-radius: 24px; 
  width: 100%; 
  max-width: 450px; 
  padding: 40px; 
  position: relative; 
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); 
  animation: modalIn .3s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
