/* ============================================================
   PRIMECHAT — BASE.CSS
   Reset, variáveis, tipografia global, utilitários base
   ============================================================ */

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* === FIX GLOBAL: atributo hidden sempre esconde, independente do display CSS === */
[hidden] { display: none !important; }

/* === CSS CUSTOM PROPERTIES === */
:root {
  /* Backgrounds */
  --bg-base:        #0d0f14;
  --bg-surface:     #13161e;
  --bg-elevated:    #1a1f2e;
  --bg-overlay:     #1f2537;

  /* Accent */
  --accent:         #4f8ef7;
  --accent-hover:   #3a7ae8;
  --accent-glow:    rgba(79, 142, 247, 0.15);
  --accent-glow-sm: rgba(79, 142, 247, 0.08);

  /* Semantic */
  --success:        #22c55e;
  --success-bg:     rgba(34, 197, 94, 0.12);
  --warning:        #f59e0b;
  --warning-bg:     rgba(245, 158, 11, 0.12);
  --danger:         #ef4444;
  --danger-bg:      rgba(239, 68, 68, 0.12);
  --info:           #06b6d4;
  --info-bg:        rgba(6, 182, 212, 0.12);

  /* Text */
  --text-primary:   #f0f2f8;
  --text-secondary: #8892a4;
  --text-muted:     #4a5568;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.07);
  --border-strong:  rgba(255, 255, 255, 0.12);
  --border-accent:  rgba(79, 142, 247, 0.4);

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:      0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg:      0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow:    0 0 30px rgba(79, 142, 247, 0.2);
  --shadow-glow-sm: 0 0 16px rgba(79, 142, 247, 0.15);

  /* Layout */
  --sidebar-width:       260px;
  --sidebar-width-sm:    72px;
  --topbar-height:       64px;
  --inbox-list-width:    340px;
  --contact-panel-width: 320px;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast:   all 0.15s ease;
  --transition-base:   all 0.2s ease;
  --transition-slow:   all 0.35s ease;

  /* Z-index layers */
  --z-sidebar:         100;
  --z-topbar:          200;
  --z-dropdown:        300;
  --z-modal:           400;
  --z-toast:           500;
  --z-command-palette: 600;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === TIPOGRAFIA === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
}

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

code, pre, .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
}

strong { font-weight: 600; color: var(--text-primary); }
small  { font-size: 0.8em; color: var(--text-secondary); }

/* === SCROLLBAR CUSTOMIZADA === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* === SELEÇÃO DE TEXTO === */
::selection {
  background: var(--accent-glow);
  color: var(--accent);
}

/* === UTILITÁRIOS DE DISPLAY === */
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-block  { display: block; }
.d-none   { display: none; }
.d-inline { display: inline; }
.d-inline-flex { display: inline-flex; }

/* === UTILITÁRIOS FLEX === */
.flex-col        { flex-direction: column; }
.flex-row        { flex-direction: row; }
.flex-1          { flex: 1; }
.flex-shrink-0   { flex-shrink: 0; }
.align-center    { align-items: center; }
.align-start     { align-items: flex-start; }
.align-end       { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-wrap       { flex-wrap: wrap; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* === UTILITÁRIOS DE TEXTO === */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }
.text-info      { color: var(--info); }

.text-xs   { font-size: 11px; }
.text-sm   { font-size: 12px; }
.text-base { font-size: 14px; }
.text-md   { font-size: 16px; }
.text-lg   { font-size: 18px; }
.text-xl   { font-size: 22px; }
.text-2xl  { font-size: 28px; }
.text-3xl  { font-size: 36px; }

.font-300 { font-weight: 300; }
.font-400 { font-weight: 400; }
.font-500 { font-weight: 500; }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.font-800 { font-weight: 800; }

.font-syne { font-family: 'Syne', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* === UTILITÁRIOS DE ESPAÇAMENTO === */
.p-0  { padding: 0; }
.p-4  { padding: 4px; }
.p-8  { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }

.px-8  { padding-left: 8px;  padding-right: 8px; }
.px-12 { padding-left: 12px; padding-right: 12px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.px-24 { padding-left: 24px; padding-right: 24px; }

.py-8  { padding-top: 8px;  padding-bottom: 8px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }

.m-0  { margin: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12{ margin-bottom: 12px; }
.mb-16{ margin-bottom: 16px; }
.mb-24{ margin-bottom: 24px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12{ margin-top: 12px; }
.mt-16{ margin-top: 16px; }
.mt-24{ margin-top: 24px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* === UTILITÁRIOS VISUAIS === */
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 50%; }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.w-auto  { width: auto; }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.relative        { position: relative; }
.absolute        { position: absolute; }
.sticky          { position: sticky; }
.cursor-pointer  { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.select-none     { user-select: none; }

/* === DIVISOR === */
.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 16px 0;
}

.divider-vertical {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

/* === SURFACE UTILITÁRIOS === */
.bg-base     { background: var(--bg-base); }
.bg-surface  { background: var(--bg-surface); }
.bg-elevated { background: var(--bg-elevated); }
.bg-overlay  { background: var(--bg-overlay); }

/* === VISIBILIDADE === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
