/* ══════════════════════════════════════════════════════════════
   GIRI WORD — Zone d'écriture unifiée (tous thèmes)
   Supprime le double cadre : le padding passe sur .ql-editor
   → cliquer n'importe où sur la page = écrire directement
   ══════════════════════════════════════════════════════════════ */

/* Fix: fill full viewport height — gw-container needs anchored parent height */
#view-giri-word {
  height: 100vh;
  overflow: hidden;
}

@media (max-width: 768px) {
  #view-giri-word {
    height: calc(100vh - 56px);
    overflow: auto;
  }
}

/* La page ne porte plus le padding — c'est l'éditeur qui le fait */
#view-giri-word .gw-editor-page {
  padding: 0 !important;
  overflow: hidden;
  cursor: text;
}

/* Aucun cadre sur le container Quill */
#view-giri-word .gw-editor-page .ql-container,
#view-giri-word .gw-editor-page .ql-container.ql-snow {
  border: none !important;
  background: transparent !important;
}

/* L'éditeur remplit TOUTE la page, avec son propre padding */
#view-giri-word .gw-editor-page .ql-editor {
  padding: 48px 56px !important;
  height: auto !important;
  min-height: calc(100vh - 200px) !important;
  overflow-y: visible !important;
  box-sizing: border-box !important;
}

/* Responsive tablette */
@media (max-width: 900px) {
  #view-giri-word .gw-editor-page .ql-editor {
    padding: 32px 32px !important;
  }
}

/* Responsive mobile */
@media (max-width: 600px) {
  #view-giri-word .gw-editor-page .ql-editor {
    padding: 20px 16px !important;
    min-height: calc(100vh - 120px) !important;
  }
}

/**
 * GIRI WORD — Bois Légendaire Theme
 * Page centrale = blanc pur
 * Tout autour = textures bois
 */

/* ── Page blanche : override du thème qui mettait wood-light ── */
[data-theme="wood-legendary"] #view-giri-word .gw-editor-page,
[data-theme="wood-legendary"] #view-giri-word .gw-editor-page.gw-page-white,
[data-theme="wood-legendary"] #view-giri-word .gw-editor-page.gw-page-cream,
[data-theme="wood-legendary"] #view-giri-word .gw-editor-page.gw-page-sepia {
  background-color: #ffffff !important;
  background-image: none !important;
  color: #1a1a2e !important;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.08),
    0 4px 32px rgba(0,0,0,0.30),
    0 1px 4px rgba(0,0,0,0.15) !important;
  border: none !important;
}

/* ── Contenu éditeur = hérite la couleur de la page, texte sombre ── */
[data-theme="wood-legendary"] #view-giri-word [contenteditable],
[data-theme="wood-legendary"] #view-giri-word .ql-editor {
  background-color: inherit !important;
  background-image: none !important;
  color: #1a1a2e !important;
}
/* ── Variantes de couleur de page — ql-editor correspond à la page ── */
[data-theme="wood-legendary"] #view-giri-word .gw-editor-page.gw-page-cream .ql-editor {
  background-color: #FFF8F0 !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-editor-page.gw-page-sepia .ql-editor {
  background-color: #F4ECD8 !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-editor-page.gw-page-dark .ql-editor {
  background-color: var(--bg-tertiary, #1e1e30) !important;
  color: var(--text, #dde2f0) !important;
}
[data-theme="wood-legendary"] #view-giri-word .ql-editor h1,
[data-theme="wood-legendary"] #view-giri-word .ql-editor h2,
[data-theme="wood-legendary"] #view-giri-word .ql-editor h3 {
  color: #0d0d1a !important;
}
[data-theme="wood-legendary"] #view-giri-word .ql-editor p,
[data-theme="wood-legendary"] #view-giri-word .ql-editor li {
  color: #1a1a2e !important;
}

/* ── Zone autour de la page = bois sombre (fond naturel) ── */
[data-theme="wood-legendary"] #view-giri-word .gw-editor-wrap {
  background-color: rgba(20,10,0,0.70) !important;
  background-image: url('textures/wood-dark.jpg?v=1774293320') !important;
  background-size: cover !important;
  background-position: center !important;
  background-blend-mode: normal !important;
}

/* ── Sidebar = bois body ── */
[data-theme="wood-legendary"] #view-giri-word .gw-sidebar {
  background-color: rgba(160,105,35,0.95) !important;
  background-image: url('textures/wood-medium.jpg?v=1774293320') !important;
  background-size: cover !important;
  background-position: center !important;
  background-blend-mode: normal !important;
  border-right: 1px solid rgba(212,164,76,0.22) !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-sidebar-title {
  color: #F2E8D8 !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-sidebar-action-btn {
  color: #DCC8A8 !important;
  background: rgba(212,164,76,0.10) !important;
  border: 1px solid rgba(212,164,76,0.18) !important;
  border-radius: 6px !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-sidebar-action-btn:hover {
  background: rgba(212,164,76,0.22) !important;
  color: #F2E8D8 !important;
}

/* ── Stats bar = bois medium (comme la barre des onglets Drive) ── */
[data-theme="wood-legendary"] #view-giri-word .gw-stats-bar {
  background-color: rgba(18,6,0,0.97) !important;
  background-image: url('textures/wood-dark.jpg?v=1774293320') !important;
  background-size: cover !important;
  background-position: center !important;
  background-blend-mode: normal !important;
  border-bottom: 1px solid rgba(212,164,76,0.25) !important;
  color: #F5EAD5 !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-stat-item {
  color: #F5EAD5 !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-stat-sep {
  background: rgba(245,234,213,0.18) !important;
}

/* ── Toolbar = bois moyen + texte marron foncé ── */
[data-theme="wood-legendary"] #view-giri-word .gw-toolbar {
  background-color: rgba(185,130,55,1.0) !important;
  background-image: url(textures/wood-medium.jpg?v=1774293320) !important;
  background-size: cover !important;
  background-position: center top !important;
  background-blend-mode: normal !important;
  border-bottom: 1px solid rgba(212,164,76,0.30) !important;
  box-shadow: 0 3px 12px rgba(0,0,0,0.22) !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-toolbar * {
  color: #2A1200 !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-toolbar button,
[data-theme="wood-legendary"] #view-giri-word .gw-btn {
  color: #2A1200 !important;
  background-color: rgba(255,245,215,0.35) !important;
  border: 1px solid rgba(139,74,0,0.25) !important;
  border-radius: 6px !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-toolbar button:hover,
[data-theme="wood-legendary"] #view-giri-word .gw-btn:hover {
  background-color: rgba(255,235,160,0.45) !important;
  border-color: rgba(139,74,0,0.45) !important;
  color: #1A0800 !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-toolbar-sep {
  background: rgba(42,18,0,0.18) !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-title-input {
  color: #2A1200 !important;
  background: rgba(255,245,215,0.40) !important;
  border: 1px solid rgba(139,74,0,0.22) !important;
  border-radius: 6px !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-title-input::placeholder {
  color: rgba(42,18,0,0.45) !important;
}

/* ── Sidebar interne = bois très clair ── */
[data-theme="wood-legendary"] #view-giri-word .gw-doc-item,
[data-theme="wood-legendary"] #view-giri-word .gw-folder-header,
[data-theme="wood-legendary"] #view-giri-word .gw-templates-section {
  background-color: rgba(255,248,225,0.88) !important;
  background-image: url('textures/wood-light-premium.jpg?v=1774293320') !important;
  background-size: cover !important;
  background-position: center !important;
  background-blend-mode: normal !important;
  border-radius: 8px !important;
  margin: 2px 6px !important;
  border: 1px solid rgba(212,164,76,0.22) !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-doc-item.active {
  background-color: rgba(255,240,190,0.96) !important;
  border-color: rgba(212,164,76,0.50) !important;
  box-shadow: 0 0 0 1px rgba(212,164,76,0.25) !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-doc-item:hover,
[data-theme="wood-legendary"] #view-giri-word .gw-folder-header:hover {
  background-color: rgba(255,240,190,0.92) !important;
  border-color: rgba(212,164,76,0.38) !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-doc-item *,
[data-theme="wood-legendary"] #view-giri-word .gw-folder-name,
[data-theme="wood-legendary"] #view-giri-word .gw-folder-count {
  color: #2A1200 !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-folder-children {
  background: transparent !important;
  border-image: none !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-sidebar-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(212,164,76,0.20) !important;
}

/* ── Texte marron très foncé dans les parties bois très clair ── */
[data-theme="wood-legendary"] #view-giri-word .gw-doc-item,
[data-theme="wood-legendary"] #view-giri-word .gw-doc-item *,
[data-theme="wood-legendary"] #view-giri-word .gw-folder-header,
[data-theme="wood-legendary"] #view-giri-word .gw-folder-name,
[data-theme="wood-legendary"] #view-giri-word .gw-folder-count,
[data-theme="wood-legendary"] #view-giri-word .gw-folder-icon,
[data-theme="wood-legendary"] #view-giri-word .gw-templates-section * {
  color: #1A0800 !important;
}

/* ── Barre TAILLE & PAGE = bois clair ── */
[data-theme="wood-legendary"] #view-giri-word .gw-page-settings {
  background-color: rgba(160,105,35,0.88) !important;
  background-image: url('textures/wood-medium.jpg?v=1774293320') !important;
  background-size: cover !important;
  background-position: center !important;
  background-blend-mode: normal !important;
  border-bottom: 1px solid rgba(212,164,76,0.25) !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-ps-label {
  color: #FFFFFF !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-ps-select {
  background-color: rgba(255,240,190,0.70) !important;
  border: 1px solid rgba(139,74,0,0.28) !important;
  color: #1A0800 !important;
  border-radius: 6px !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-ps-select option {
  background: #F5E8CC !important;
  color: #1A0800 !important;
}

/* ── Ombres premium derrière les emojis de la sidebar ── */
[data-theme="wood-legendary"] #view-giri-word .gw-folder-icon,
[data-theme="wood-legendary"] #view-giri-word .gw-sidebar-action-btn,
[data-theme="wood-legendary"] #view-giri-word .gw-folder-action {
  text-shadow:
    0 2px 6px rgba(139,74,0,0.55),
    0 0 12px rgba(212,164,76,0.35),
    0 1px 2px rgba(0,0,0,0.40) !important;
}

/* ── Ombres vers le bas sur les 3 barres horizontales ── */
[data-theme="wood-legendary"] #view-giri-word .gw-toolbar {
  box-shadow: 0 4px 16px rgba(0,0,0,0.35), 0 2px 6px rgba(80,40,0,0.30) !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-stats-bar {
  box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 2px 5px rgba(0,0,0,0.30) !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-page-settings {
  box-shadow: 0 4px 12px rgba(0,0,0,0.22), 0 2px 4px rgba(80,40,0,0.18) !important;
}

/* ── Stats bar projette son ombre sur la barre bois clair en dessous ── */
[data-theme="wood-legendary"] #view-giri-word .gw-stats-bar {
  position: relative !important;
  z-index: 3 !important;
  box-shadow:
    0 6px 18px rgba(0,0,0,0.55),
    0 3px 8px  rgba(0,0,0,0.40) !important;
}
[data-theme="wood-legendary"] #view-giri-word .gw-page-settings {
  position: relative !important;
  z-index: 2 !important;
}

/* ── Barre bois clair projette son ombre vers le bas ── */
[data-theme="wood-legendary"] #view-giri-word .gw-page-settings {
  box-shadow:
    0 8px 24px rgba(0,0,0,0.55),
    0 4px 10px rgba(0,0,0,0.38),
    0 2px 4px  rgba(60,25,0,0.30) !important;
}

/* ── Autocorrect bar : fixed → ne déplace plus le layout ───────────────── */
#view-giri-word .gw-ac-bar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  height: auto !important;
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  transition: max-height 0.25s ease, padding 0.25s ease !important;
  border-bottom: 1px solid color-mix(in srgb, var(--accent, #6366f1) 15%, transparent);
}

#view-giri-word .gw-ac-bar.visible {
  max-height: 44px;
  padding: 5px 16px;
}
