/* Barra de Título Personalizada para Electron */
#electron-titlebar {
  display: none; /* Oculto no navegador padrão */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: rgba(30, 15, 5, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  z-index: 999999;
  -webkit-app-region: drag;
  user-select: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #e6c88b;
  box-sizing: border-box;
}

body.is-electron #electron-titlebar {
  display: flex;
}

body.is-electron {
  padding-top: 36px !important;
}

/* ── Acomodação de Elementos Fixos para a Barra de Título Electron (36px) ── */
body.is-electron #background {
  top: 36px !important;
  height: calc(100% - 36px) !important;
}

body.is-electron #mesa {
  top: 36px !important;
  height: calc(100% - 36px) !important;
}

body.is-electron settings-toolbar,
body.is-electron settings-toolbar-mobile {
  top: 51px !important; /* 15px original + 36px barra */
}

body.is-electron music-player,
body.is-electron music-player-mobile {
  top: 57px !important; /* 21px original + 36px barra */
}

body.is-electron .toolbar-container {
  top: 51px !important; /* 15px original + 36px barra */
}

body.is-electron .overlay,
body.is-electron .menuzao-overlay {
  top: 36px !important;
  height: calc(100% - 36px) !important;
}

body.is-electron .overlay .closebtn,
body.is-electron .menuzao-overlay .closebtn-menuzao {
  top: 56px !important; /* 20px original + 36px barra */
}

/* ── Ajustes quando em Modo Tela Cheia no Electron (Sem Barra de Título) ── */
body.is-electron.is-fullscreen #electron-titlebar {
  display: none !important;
}

body.is-electron.is-fullscreen {
  padding-top: 0 !important;
}

body.is-electron.is-fullscreen #background,
body.is-electron.is-fullscreen #mesa {
  top: 0 !important;
  height: 100% !important;
}

body.is-electron.is-fullscreen settings-toolbar,
body.is-electron.is-fullscreen settings-toolbar-mobile {
  top: 15px !important;
}

body.is-electron.is-fullscreen music-player,
body.is-electron.is-fullscreen music-player-mobile {
  top: 21px !important;
}

body.is-electron.is-fullscreen .toolbar-container {
  top: 15px !important;
}

body.is-electron.is-fullscreen .overlay,
body.is-electron.is-fullscreen .menuzao-overlay {
  top: 0 !important;
  height: 100% !important;
}

body.is-electron.is-fullscreen .overlay .closebtn,
body.is-electron.is-fullscreen .menuzao-overlay .closebtn-menuzao {
  top: 20px !important;
}

.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #f1dfb8;
  pointer-events: none;
}

.titlebar-brand img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.titlebar-controls {
  display: flex;
  align-items: center;
  height: 100%;
  -webkit-app-region: no-drag;
}

.titlebar-btn {
  background: transparent;
  border: none;
  color: #d4af37;
  width: 44px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  outline: none;
}

.titlebar-btn:hover {
  background-color: rgba(212, 175, 55, 0.18);
  color: #fff;
}

.titlebar-btn:active {
  background-color: rgba(212, 175, 55, 0.35);
}

.titlebar-btn.btn-close:hover {
  background-color: #c0392b;
  color: #ffffff;
}

.titlebar-btn.btn-close:active {
  background-color: #a93226;
}

.titlebar-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
