/* ==========================================================================
   Z1 ESPORTES - NOTION LIGHT THEME DESIGN SYSTEM
   Tipografia: Roboto | Peso Máximo na Dashboard: 500 | Zero Sombras Agressivas
   ========================================================================== */

:root {
  /* Paleta Oficial Notion Light */
  --notion-bg: #FFFFFF;
  --notion-workspace: #EAE9E6;
  --notion-sidebar: #F7F6F3;
  --notion-card: #FFFFFF;
  --notion-card-hover: #F1F0ED;
  --notion-input: #FFFFFF;
  --notion-input-focus: #FFFFFF;
  
  --notion-border: #E9E9E7;
  --notion-border-strong: #DFDFDE;
  --notion-border-focus: #2383E2;
  
  --notion-text: #37352F;
  --notion-text-secondary: #787774;
  --notion-text-muted: #9B9A97;
  
  --notion-blue: #2383E2;
  --notion-blue-hover: #1D70C2;
  --notion-red: #EB5757;
  --notion-green: #0F8558;
  
  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 9999px;
  
  --transition: all 0.15s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--notion-bg);
  color: var(--notion-text);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   NOTION HEADER (LIGHT)
   ========================================================================== */

.app-header {
  height: 52px;
  background: var(--notion-bg);
  border-bottom: 1px solid var(--notion-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand-logo-container {
  display: flex;
  align-items: center;
  gap: 6px;
  max-height: 36px;
}

.brand-logo-container img {
  max-height: 32px;
  max-width: 160px;
  object-fit: contain;
}

.brand-z1 {
  font-family: var(--font-family);
  font-size: 18px;
  font-weight: 500;
  color: #111111;
  line-height: 1;
}

.brand-esportes {
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: #2383E2;
}

.brand-title {
  font-size: 12px;
  font-weight: 400;
  color: var(--notion-text-muted);
  border-left: 1px solid var(--notion-border);
  padding-left: 12px;
}

/* Notion Segmented Switcher (Feed / Story) */
.format-toggle-group {
  display: flex;
  background: var(--notion-sidebar);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--notion-border);
  gap: 2px;
}

.format-btn {
  background: transparent;
  border: none;
  color: var(--notion-text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.format-btn:hover {
  color: var(--notion-text);
  background: rgba(0, 0, 0, 0.04);
}

.format-btn.active {
  background: #FFFFFF;
  color: var(--notion-text);
  border: 1px solid var(--notion-border-strong);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Notion Clean Buttons (Sem Sombras Agressivas, Max Font Weight 500) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--notion-blue);
  color: #FFFFFF;
  border-color: var(--notion-blue);
}

.btn-primary:hover {
  background: var(--notion-blue-hover);
}

.btn-secondary {
  background: #FFFFFF;
  color: var(--notion-text);
  border-color: var(--notion-border-strong);
}

.btn-secondary:hover {
  background: var(--notion-card-hover);
  border-color: #CFCFCD;
}

.btn-outline {
  background: transparent;
  color: var(--notion-text-secondary);
  border-color: var(--notion-border-strong);
}

.btn-outline:hover {
  color: var(--notion-text);
  background: rgba(0, 0, 0, 0.04);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

/* ==========================================================================
   MAIN LAYOUT (SIDEBAR + PREVIEW)
   ========================================================================== */

.app-main {
  display: flex;
  flex: 1;
  height: calc(100vh - 52px);
  overflow: hidden;
}

/* Sidebar Esquerda Estilo Notion Light */
.sidebar {
  width: 420px;
  background: var(--notion-sidebar);
  border-right: 1px solid var(--notion-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.sidebar-tabs {
  display: flex;
  background: var(--notion-sidebar);
  border-bottom: 1px solid var(--notion-border);
  padding: 0 10px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--notion-text-secondary);
  padding: 10px 6px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--notion-text);
}

.tab-btn.active {
  color: var(--notion-text);
  border-bottom-color: var(--notion-blue);
  font-weight: 500;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-content::-webkit-scrollbar {
  width: 5px;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--notion-border-strong);
  border-radius: 4px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-pane.active {
  display: flex;
}

/* Controles e Labels */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--notion-text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-label small {
  font-size: 11px;
  color: var(--notion-text-muted);
  font-weight: 400;
}

/* Upload Dropzone Notion Style */
.upload-dropzone {
  border: 1px dashed var(--notion-border-strong);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  background: #FFFFFF;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--notion-blue);
  background: #FAFAFA;
}

.upload-icon {
  font-size: 22px;
  color: var(--notion-text-secondary);
}

.upload-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--notion-text);
}

.upload-subtext {
  font-size: 11px;
  color: var(--notion-text-muted);
}

/* Inputs, Textareas & Selects */
.input-text, .textarea, .select {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--notion-border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--notion-text);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 400;
  transition: var(--transition);
}

.input-text:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--notion-border-focus);
  background: #FFFFFF;
}

.textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.45;
}

.input-range-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-range {
  flex: 1;
  accent-color: var(--notion-blue);
  cursor: pointer;
  height: 4px;
}

.range-val {
  min-width: 36px;
  font-size: 11px;
  font-weight: 500;
  color: var(--notion-text-secondary);
  text-align: right;
}

/* Color Picker Compacto Notion Style */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid var(--notion-border-strong);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.color-input-native {
  -webkit-appearance: none;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  background: transparent;
}

.color-input-native::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-native::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-xs);
}

.color-text-input {
  background: transparent;
  border: none;
  color: var(--notion-text);
  font-family: monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  width: 80px;
}

.color-text-input:focus {
  outline: none;
}

/* Quick Club Chips Notion Style */
.club-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 130px;
  overflow-y: auto;
  padding: 6px;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  border: 1px solid var(--notion-border);
}

.club-chip {
  background: var(--notion-sidebar);
  border: 1px solid var(--notion-border-strong);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 500;
  color: var(--notion-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.club-chip:hover {
  background: #EFEFED;
  color: var(--notion-text);
}

.club-chip.active {
  background: #FFFFFF;
  border-color: var(--notion-blue);
  color: #111111;
  font-weight: 500;
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Notion Toggle Switch */
.toggle-switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  color: var(--notion-text);
  padding: 6px 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #DFDFDE;
  border: 1px solid transparent;
  transition: .2s;
  border-radius: 20px;
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: #FFFFFF;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider-toggle {
  background-color: var(--notion-blue);
}

input:checked + .slider-toggle:before {
  transform: translateX(16px);
}

.tip-box {
  background: #EBF3FB;
  border: 1px solid #D2E4F6;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  color: #1D5C96;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* ==========================================================================
   CANVAS WORKSPACE & PREVIEW
   ========================================================================== */

.preview-workspace {
  flex: 1;
  background: var(--notion-workspace);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  user-select: none;
}

.preview-stage-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000000;
}

#renderCanvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
}

/* Floating Tools Bar Sobre o Preview */
.floating-preview-toolbar {
  position: absolute;
  bottom: 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--notion-border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 20;
}

.preview-badge-info {
  font-size: 11px;
  font-weight: 500;
  color: var(--notion-text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.preview-badge-info strong {
  color: var(--notion-text);
  font-weight: 500;
}

.divider-vertical {
  width: 1px;
  height: 14px;
  background: var(--notion-border);
}

/* ==========================================================================
   MODAL DE GESTÃO DE CLUBES E CONFIGURAÇÕES (LIGHT)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: #FFFFFF;
  border: 1px solid var(--notion-border-strong);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--notion-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--notion-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--notion-border);
  background: var(--notion-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.clubs-grid-manage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
}

.club-item-card {
  background: #FFFFFF;
  border: 1px solid var(--notion-border-strong);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.club-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.club-item-color-box {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.club-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--notion-text);
}

/* ==========================================================================
   TOAST NOTIFICATIONS (LIGHT)
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 60px;
  right: 18px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #FFFFFF;
  border: 1px solid var(--notion-border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--notion-text);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */

@media (max-width: 1024px) {
  .app-main {
    flex-direction: column;
    height: auto;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--notion-border);
  }
  .preview-workspace {
    min-height: 500px;
  }
}
