/* =========================================================
   Vobys Release Notes — shared/styles.css
   Tema via CSS custom properties — sobrescreva :root no HTML
   de cada cliente para personalizar cores.
   ========================================================= */

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

/* ── TEMA PADRÃO (Vobys Blue) — sobrescrito por cada cliente ── */
:root {
  --primary-900: #0a3272;
  --primary-800: #0d47a1;
  --primary-700: #1565c0;
  --primary-600: #1976d2;
  --primary-100: #e3f2fd;
  --primary-50:  #f0f7ff;

  --grey-900: #212121;
  --grey-700: #616161;
  --grey-400: #bdbdbd;
  --grey-100: #f5f5f5;
  --white:    #ffffff;

  --green:    #2e7d32;
  --red:      #c62828;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.10);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Fira Code', monospace;

  /* Sidebar */
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 0px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--grey-900);
  background: var(--grey-100);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── CABEÇALHO ─────────────────────────────────────────── */
.site-header {
  background: var(--primary-800);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  /*border-radius: 50%;*/
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
}

.brand-subtitle {
  font-size: 12px;
  opacity: .8;
  font-weight: 400;
}

/* ── HERO ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 100%);
  color: var(--white);
  padding: 56px 24px;
  text-align: center;
}

.hero-inner { max-width: 700px; margin: 0 auto; }

.hero h1 {
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -.5px;
}

.hero p {
  font-size: clamp(15px, 2.5vw, 18px);
  opacity: .9;
}

/* ── CONTEÚDO PRINCIPAL ────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 40px 0 64px;
}

/* ── LAYOUT COM SIDEBAR ─────────────────────────────────── */
.layout-with-sidebar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 0;
  align-items: flex-start;
  position: relative;
}

/* Área de conteúdo principal */
.content-area {
  flex: 1;
  min-width: 0;
  transition: margin-left .28s ease;
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow: hidden;
  transition: width .28s ease, min-width .28s ease, opacity .2s ease;
  margin-right: 28px;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  margin-right: 0;
}

.sidebar-inner {
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Botão toggle da sidebar */
.sidebar-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 300;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-800);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: background .15s, transform .15s;
  font-size: 18px;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: var(--primary-700);
  transform: scale(1.08);
}

.sidebar-toggle .icon-open  { display: block; }
.sidebar-toggle .icon-close { display: none; }

.sidebar-toggle.active .icon-open  { display: none; }
.sidebar-toggle.active .icon-close { display: block; }

/* ── FILTRO DE CLIENTE ──────────────────────────────────── */
.client-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--grey-400);
  padding-left: 6px;
}

.client-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.client-chip {
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--grey-400);
  background: var(--white);
  color: var(--grey-700);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  line-height: 1.4;
  white-space: nowrap;
}

.client-chip:hover {
  border-color: var(--primary-600);
  color: var(--primary-700);
}

.client-chip.active {
  background: var(--primary-800);
  border-color: var(--primary-800);
  color: var(--white);
}

/* ── FILTRO DE VERSÕES ──────────────────────────────────── */
.version-search {
  position: relative;
}

.version-search input {
  width: 100%;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--grey-400);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  background: var(--white);
  color: var(--grey-900);
  outline: none;
  transition: border-color .15s;
}

.version-search input:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 2px var(--primary-100);
}

.version-search input::placeholder {
  color: var(--grey-400);
}

.version-search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--grey-400);
  font-size: 14px;
  padding: 0;
  line-height: 1;
  display: none;
}

.version-search-clear.visible { display: block; }
.version-search-clear:hover { color: var(--grey-700); }

/* ── ÍNDICE DE VERSÕES ─────────────────────────────────── */
.version-index {
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  scrollbar-width: none;
}

.version-index::-webkit-scrollbar { display: none; }

.version-index h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--grey-400);
  margin-bottom: 8px;
  padding-left: 6px;
}

.version-index ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.version-index a {
  font-size: 13px;
  color: var(--grey-700);
  text-decoration: none;
  display: block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background .12s, color .12s;
}

.version-index a:hover {
  background: var(--primary-50);
  color: var(--primary-700);
  text-decoration: none;
}

.version-index li[hidden] { display: none; }

/* ── ESTADOS (loading / error) ─────────────────────────── */
.state-card {
  text-align: center;
  padding: 64px 24px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}

.loading-card p { color: var(--grey-700); margin-top: 16px; }

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--primary-100);
  border-top-color: var(--primary-800);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-card { border-top: 4px solid var(--red); }
.state-icon { font-size: 40px; }
.error-card h2 { margin: 12px 0 8px; color: var(--red); }
.error-card p  { color: var(--grey-700); margin-bottom: 20px; }

.btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  border: 2px solid var(--primary-800);
  border-radius: var(--radius-sm);
  color: var(--primary-800);
  font-weight: 600;
  transition: all .15s;
}

.btn-secondary:hover {
  background: var(--primary-800);
  color: var(--white);
  text-decoration: none;
}

/* ── CONTEÚDO MARKDOWN RENDERIZADO ─────────────────────── */
#release-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 8px;
}

/* Cada versão vira um card */
.version-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s;
}

.version-card:hover { box-shadow: var(--shadow-md); }

.version-header {
  background: var(--primary-50);
  border-left: 5px solid var(--primary-800);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.version-tag {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-800);
  letter-spacing: -.3px;
}

.version-date {
  font-size: 13px;
  color: var(--grey-700);
  background: var(--white);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--grey-400);
}

.version-body { padding: 20px 24px; }

/* Seções dentro de cada versão */
.version-body h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--grey-100);
  color: var(--grey-700);
}

.version-body h3:first-child { margin-top: 0; }

.version-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.version-body li {
  padding: 8px 12px 8px 36px;
  border-radius: var(--radius-sm);
  background: var(--grey-100);
  font-size: 15px;
  position: relative;
}

.version-body li::before {
  content: "▸";
  position: absolute;
  left: 10px;
  color: var(--grey-400);
  font-size: 13px;
}

.version-body a {
  color: var(--primary-600);
  font-size: 13px;
}

/* Códigos de cliente [XX] */
.client-code {
  display: inline-block;
  background: var(--primary-100);
  color: var(--primary-800);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  font-family: var(--font-mono);
}

/* ── HIGHLIGHTS BANNER ─────────────────────────────────── */
.version-highlights {
  padding: 10px 20px;
  background: linear-gradient(90deg, var(--primary-50) 0%, var(--white) 100%);
  border-left: 4px solid var(--primary-600);
  font-size: 14px;
  color: var(--grey-700);
}

.version-highlights p { margin: 0; line-height: 1.55; }

/* ── FEATURE SUBSECTIONS ───────────────────────────────── */
.feature-item { margin-bottom: 12px; }

.feature-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--grey-900);
  margin: 12px 0 6px;
  padding-left: 2px;
}

.feature-description {
  font-size: 14px;
  color: var(--grey-700);
  margin: 0 0 8px;
  line-height: 1.6;
  padding-left: 2px;
}

/* Aviso de versões antigas */
.legacy-notice {
  background: var(--grey-100);
  border: 1px solid var(--grey-400);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  color: var(--grey-700);
  font-size: 14px;
  text-align: center;
}

/* ── RODAPÉ ────────────────────────────────────────────── */
.site-footer {
  background: var(--primary-900);
  color: rgba(255,255,255,.7);
  padding: 24px;
  text-align: center;
  font-size: 13px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.site-footer a { color: rgba(255,255,255,.9); }
.site-footer a:hover { color: var(--white); }

/* ── OVERLAY MOBILE ─────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 149;
  backdrop-filter: blur(1px);
}

/* ── RESPONSIVO ────────────────────────────────────────── */
@media (max-width: 768px) {

  /* No mobile, sidebar flutua como painel lateral */
  .sidebar {
    position: fixed;
    top: 64px;                  /* abaixo do header */
    left: 0;
    bottom: 0;
    z-index: 150;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--grey-100);
    max-height: none;
    padding: 16px;
    overflow-y: auto;
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    /* Começa fora da tela (fechada por padrão no mobile) */
    transform: translateX(-100%);
    transition: transform .28s ease;
    margin-right: 0;
  }

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

  /* Quando sidebar está aberta no mobile, mostra overlay */
  .sidebar.mobile-open ~ .sidebar-overlay,
  .sidebar-overlay.active {
    display: block;
  }

  .layout-with-sidebar {
    padding: 0 16px;
  }

  .content-area {
    margin-left: 0 !important;
  }

  .sidebar-toggle {
    bottom: 20px;
    left: 16px;
  }
}

@media (max-width: 600px) {
  .version-header { flex-direction: column; align-items: flex-start; }
  .version-body { padding: 16px; }
}
