/* Styles pour l'affichage des notes */

/* Container principal */
.note-display-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 2rem 0;
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  min-height: 100vh;
}

.note-display-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-button), var(--color-accent), var(--color-button));
  background-size: 200% 100%;
  animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* En-tête de la note */
.note-display-header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: 2rem;
  padding: var(--spacing-lg);
  position: relative;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.note-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  min-width: 0;
}

.note-header-actions {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  flex-shrink: 0;
}

.note-header-actions .btn {
  white-space: nowrap;
}

.note-header-actions .btn-icon {
  width: 40px;
  height: 40px;
}

.note-display-title {
  flex: 1;
  min-width: 0;
}

.note-display-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-on-surface);
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 3.5em;
  line-height: 1.4;
}

.note-metadata {
  display: flex;
  gap: var(--spacing-lg);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.note-metadata-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.note-metadata-item i {
  color: var(--color-button);
}

/* Contrôle de taille de police */
.font-size-control {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 0.25rem;
}

.font-size-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1rem;
  font-weight: 600;
}

.font-size-btn:hover {
  background: var(--color-surface-alt);
  color: var(--color-button);
}

.font-size-btn:active {
  transform: scale(0.95);
}

.font-size-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.font-size-btn:disabled:hover {
  background: transparent;
  color: var(--color-text-secondary);
}

.font-size-display {
  min-width: 40px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Contenu de la note */
.note-display-content {
  padding: 0 2rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

/* Taille de police personnalisable via paramètres */
.note-display-container,
.note-display-content,
.note-section-content,
.note-section {
  --note-font-size: 100%;
}

.note-section-content {
  font-size: calc(1.1em * var(--note-font-size) / 100);
}

/* Section de note - Style identique au mode plein écran */
.note-section {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 2rem 0 0 0 !important;
  margin-bottom: 3rem !important;
  margin-top: 0 !important;
  box-shadow: none !important;
  transition: none !important;
  color: var(--color-text-on-surface);
  position: relative;
}

/* Bordure discrète en haut utilisant la couleur du texte avec opacité */
.note-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.25;
}

/* Pas de bordure pour la première section */
.note-section:first-child::before {
  display: none;
}

.note-section:first-child {
  border-top: none !important;
  padding-top: 0 !important;
}

.note-section:hover {
  box-shadow: none !important;
  transform: none !important;
}

.note-section:hover .section-generate-btn,
.note-section:hover .section-add-html-btn,
.note-section:hover .section-markdown-btn,
.note-section:hover .section-copy-btn,
.note-section:hover .section-delete-subnote-btn {
  opacity: 1;
}

.note-section:hover .section-markdown-btn.active {
  opacity: 1;
}

/* Conteneur des actions */
.section-actions {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0.5rem;
}

.section-generate-btn,
.section-add-html-btn,
.section-markdown-btn,
.section-delete-subnote-btn {
  opacity: 0;
  transition: all 0.3s ease;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section-generate-btn {
  background: linear-gradient(135deg, var(--color-button), var(--color-accent));
  color: var(--color-button-text);
}

.section-add-html-btn {
  background: linear-gradient(135deg, var(--color-accent), var(--primary-color));
  color: var(--color-button-text);
}

.section-markdown-btn {
  background: linear-gradient(135deg, #00a8ff, #0077b6);
  color: white;
  padding: 0.5rem;
  width: 32px;
  height: 32px;
  justify-content: center;
}

.section-delete-subnote-btn {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.3);
  padding: 0.5rem;
  width: 32px;
  height: 32px;
  justify-content: center;
}

.section-markdown-btn.active {
  background: linear-gradient(135deg, #0077b6, #005f8a);
  opacity: 1;
}

/* Style pour le bouton toggle markdown */
.section-markdown-toggle {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  opacity: 1;
}

.section-markdown-toggle.active {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.section-markdown-toggle:hover {
  background: linear-gradient(135deg, #5f4fcf, #8e7fff);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
}

.section-generate-btn:hover,
.section-add-html-btn:hover,
.section-markdown-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.section-delete-subnote-btn:hover {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(220, 53, 69, 0.3);
}

.section-generate-btn:disabled,
.section-add-html-btn:disabled,
.section-markdown-btn:disabled,
.section-delete-subnote-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.section-markdown-btn.loading {
  opacity: 1;
  cursor: wait;
}

.section-markdown-btn.loading i {
  animation: spin 1s linear infinite;
}

.section-generate-btn i,
.section-add-html-btn i,
.section-markdown-btn i,
.section-delete-subnote-btn i {
  font-size: 0.9rem;
}

/* Bouton de copie avec icône SVG personnalisée */
.section-copy-btn {
  opacity: 1;
  transition: all 0.3s ease;
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  position: relative;
  width: 32px;
  height: 32px;
}

.section-copy-btn svg {
  width: 16px;
  height: 18px;
  transition: transform 0.2s ease;
}

.section-copy-btn .copy-icon-bounce {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.section-copy-btn:active {
  animation: press 0.2s 1 linear;
}

.section-copy-btn:active .copy-icon-bounce {
  animation: bounce 0.2s 1 linear;
  opacity: 1;
}

.section-copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  background: var(--color-surface);
  color: var(--color-button);
}

@keyframes press {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.92);
  }
  to {
    transform: scale(1);
  }
}

@keyframes bounce {
  50% {
    transform: rotate(5deg) translate(10px, -25px);
  }
  to {
    transform: scale(0.9) rotate(10deg) translate(25px, -40px);
    opacity: 0;
  }
}

.section-generating {
  opacity: 1 !important;
  background: var(--color-border);
  cursor: wait;
}

.section-generating i {
  animation: spin 1s linear infinite;
}

.note-section-heading {
  font-size: 1.6em;
  font-weight: 600;
  color: var(--color-button);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: none !important;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: color var(--transition-normal);
}

.note-section-heading.editing {
  cursor: default;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.note-section-heading.collapsible {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-normal), transform 0.2s ease;
}

.note-section-heading.collapsible:hover {
  color: var(--color-accent);
  transform: translateX(2px);
}

.note-section-heading i {
  color: var(--color-button);
  font-size: 1.4em;
  transition: color var(--transition-normal), transform 0.3s ease;
}

.note-section-heading .section-collapse-icon {
  font-size: 0.8em;
  color: var(--color-text-secondary);
  transition: transform 0.3s ease, color 0.2s ease;
  margin-right: 0.25rem;
}

.note-section-title-text {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
}

.note-section-heading.collapsible:hover .section-collapse-icon {
  color: var(--color-button);
}

.section-heading-input {
  flex: 1;
  min-width: 200px;
  border: 2px solid var(--color-primary);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text-on-surface);
  background: var(--color-surface);
}

.section-heading-edit-actions {
  display: flex;
  gap: 0.5rem;
}

.section-heading-edit-actions .btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}

.note-section-body {
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  max-height: 10000px;
  opacity: 1;
}

.note-section.collapsed .note-section-body {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.note-section.collapsed .note-section-heading .section-collapse-icon {
  transform: rotate(-90deg);
}

.note-section-content {
  font-size: 1.1em;
  line-height: 1.8;
  color: var(--color-text-on-surface);
  white-space: pre-wrap;
  word-wrap: break-word;
  text-align: justify;
  display: block;
  width: 100%;
}

.note-section-content.markdown-content {
  white-space: normal;
  text-align: justify;
}

.note-section-content.markdown-content h1,
.note-section-content.markdown-content h2,
.note-section-content.markdown-content h3,
.note-section-content.markdown-content h4,
.note-section-content.markdown-content h5,
.note-section-content.markdown-content h6 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-weight: 600;
  color: var(--color-text-on-surface);
}

.note-section-content.markdown-content h1 {
  font-size: 1.75em;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5em;
}

.note-section-content.markdown-content h2 {
  font-size: 1.5em;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4em;
}

.note-section-content.markdown-content h3 {
  font-size: 1.3em;
}

.note-section-content.markdown-content p {
  margin-bottom: 1em;
}

.note-section-content.markdown-content ul,
.note-section-content.markdown-content ol {
  margin-bottom: 1em;
  padding-left: 2em;
}

.note-section-content.markdown-content li {
  margin-bottom: 0.5em;
}

.note-section-content.markdown-content code {
  background: var(--color-surface-alt);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--color-button);
}

.note-section-content.markdown-content pre {
  background: var(--color-surface-alt);
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1em;
}

.note-section-content.markdown-content pre code {
  background: none;
  padding: 0;
}

.note-section-content.markdown-content strong {
  font-weight: 600;
  color: var(--color-text-on-surface);
}

.note-section-content.markdown-content em {
  font-style: italic;
  color: var(--color-text-secondary);
}

.note-section-pages {
  margin-top: 1rem;
  padding-top: 1rem;
  /* Suppression du trait de séparation entre le texte et les index de pages */
  border-top: none;
  font-size: 0.9em;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.note-section-pages i {
  color: var(--color-button);
}

/* Sous-sections */
.note-subsection {
  margin-left: 0 !important;
  padding-left: 0 !important;
  border-left: none !important;
  margin-top: 2rem !important;
  padding-top: 1.5rem !important;
  color: var(--color-text-on-surface);
  position: relative;
}

/* Bordure discrète en haut utilisant la couleur du texte avec opacité */
.note-subsection::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.2;
}

.note-subsection .note-section-heading {
  font-size: 1.3em;
  border-bottom: none !important;
  color: var(--color-accent);
}

.note-subsection .note-section-heading i {
  color: var(--color-accent);
}

.note-subsection .note-section-body {
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.note-subsection.collapsed .note-section-body {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.note-subsection .note-section-content {
  font-size: 1em;
}

/* État de chargement */
.note-loading {
  text-align: center;
  padding: 4rem 2rem;
}

.note-loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-button);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.note-loading-text {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
}

/* État d'erreur */
.note-error {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-error);
}

.note-error-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.note-error-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.note-error-message {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .note-display-container {
    margin: 1rem;
    border-radius: 16px;
  }
  
  .note-display-header {
    padding: var(--spacing-md);
  }
  
  .note-header-top {
    flex-direction: column;
    align-items: stretch;
  }
  
  .note-header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  
  .note-header-actions .btn span {
    display: none;
  }
  
  .note-display-title h1 {
    font-size: 1.5rem;
  }
  
  .note-metadata {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .note-display-content {
    padding: 0 1rem 1rem;
  }
  
  .note-section {
    padding: 1.5rem;
  }
  
  .note-section-heading {
    font-size: 1.3em;
  }
  
  .note-section-content {
    font-size: 1em;
  }
  
  .note-subsection {
    margin-left: 1rem;
    padding-left: 1rem;
  }
  
  .note-display-header .btn {
    position: static;
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .note-display-title h1 {
    font-size: 1.75rem;
  }
  
  .note-section {
    padding: 1rem;
  }
  
  .note-section-heading {
    font-size: 1.2em;
  }
  
  .note-subsection {
    margin-left: 0.5rem;
    padding-left: 0.75rem;
  }
}

/* Thème sombre */
[data-theme="dark"] .note-section {
  background: transparent !important;
  border: none !important;
}

[data-theme="dark"] .note-section:hover {
  box-shadow: none !important;
  transform: none !important;
}

/* Note Explorer Sidebar */
.note-display-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  position: relative;
}

.note-explorer-sidebar {
  position: fixed;
  top: 80px;
  right: -400px;
  width: 400px;
  height: calc(100vh - 80px);
  background: var(--color-surface);
  border-left: 2px solid var(--color-border);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 2500;
  display: flex;
  flex-direction: column;
}

.note-explorer-sidebar.active {
  right: 0;
}

.note-explorer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}

.note-explorer-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--color-text-on-surface);
  font-weight: 600;
}

.explorer-close-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.explorer-close-btn:hover {
  background: var(--color-border);
  color: var(--color-text-on-surface);
  transform: scale(1.05);
}

.note-explorer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.note-explorer-section {
  margin-bottom: 2rem;
}

.note-explorer-section h4 {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.note-explorer-toggle {
  background: var(--color-button);
  color: var(--color-button-text);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  height: auto;
  flex-shrink: 0;
}

.note-explorer-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  background: var(--color-accent);
}

.note-explorer-toggle.active {
  background: var(--color-accent);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Tree Navigation */
.note-tree-navigation {
  font-size: 0.9rem;
}

.tree-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: var(--color-text-on-surface);
}

.tree-nav-item:hover {
  background: var(--color-border);
}

.tree-nav-item .tree-toggle {
  width: 16px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.tree-nav-title {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tree-nav-children {
  overflow: hidden;
  margin-left: 0.5rem;
}

/* Mode plein écran */
body.note-fullscreen {
  overflow: hidden;
}

body.note-fullscreen .sidebar,
body.note-fullscreen .top-bar,
body.note-fullscreen .generator-prompt-bar {
  display: none !important;
}

body.note-fullscreen .main-container {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
}

body.note-fullscreen .content-wrapper {
  width: 100%;
  height: 100vh;
  overflow-y: auto;
}

body.note-fullscreen .note-display-container {
  margin: 0;
  padding: 0;
  border-radius: 0;
  min-height: 100vh;
  box-shadow: none;
  background: var(--color-surface) !important;
  background-image: none !important;
}

body.note-fullscreen .note-display-container::before {
  display: none;
}

body.note-fullscreen .note-display-header {
  display: none !important;
}

/* Forcer la visibilité du bouton plein écran même si le header est masqué */
body.note-fullscreen .note-display-header .note-header-actions {
  display: none !important;
}

body.note-fullscreen .note-display-header .note-display-title {
  display: none !important;
}

body.note-fullscreen .note-display-header .note-metadata {
  display: none !important;
}

body.note-fullscreen .note-display-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem;
  background: transparent;
}

/* Sections en mode plein écran - fond uniforme, bordure discrète en haut */
body.note-fullscreen .note-display-content .note-section,
body.note-fullscreen .note-section,
body.note-fullscreen .note-display-content #note-content-list .note-section {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 2rem 0 0 0 !important;
  margin-bottom: 3rem !important;
  margin-top: 0 !important;
  box-shadow: none !important;
  transition: none !important;
  color: var(--color-text-on-surface);
  position: relative;
}

/* Bordure utilisant la couleur du texte avec opacité */
body.note-fullscreen .note-display-content .note-section::before,
body.note-fullscreen .note-section::before,
body.note-fullscreen .note-display-content #note-content-list .note-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.25;
}

body.note-fullscreen .note-display-content .note-section:first-child::before,
body.note-fullscreen .note-section:first-child::before,
body.note-fullscreen .note-display-content #note-content-list .note-section:first-child::before {
  display: none;
}

body.note-fullscreen .note-display-content .note-section:first-child,
body.note-fullscreen .note-section:first-child,
body.note-fullscreen .note-display-content #note-content-list .note-section:first-child {
  border-top: none !important;
  padding-top: 0 !important;
}

body.note-fullscreen .note-display-content .note-section:hover {
  box-shadow: none !important;
  transform: none !important;
}

body.note-fullscreen .note-display-content .note-section-heading {
  font-size: 2em;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: none !important;
  color: var(--color-button);
}

body.note-fullscreen .note-display-content .note-section-heading i {
  display: none;
}

body.note-fullscreen .note-display-content .note-section-content {
  font-size: 1.2em;
  line-height: 1.8;
  color: var(--color-text-on-surface);
  background: transparent;
}

body.note-fullscreen .note-section-pages {
  display: none;
}

body.note-fullscreen .section-actions {
  display: flex !important;
}

/* Rendre les boutons visibles uniquement au hover de la section en mode plein écran */
body.note-fullscreen .section-generate-btn,
body.note-fullscreen .section-add-html-btn,
body.note-fullscreen .section-markdown-btn,
body.note-fullscreen .section-copy-btn,
body.note-fullscreen .section-delete-subnote-btn {
  opacity: 0 !important;
  visibility: visible !important;
  transition: opacity 0.3s ease !important;
}

body.note-fullscreen .note-section:hover .section-generate-btn,
body.note-fullscreen .note-section:hover .section-add-html-btn,
body.note-fullscreen .note-section:hover .section-markdown-btn,
body.note-fullscreen .note-section:hover .section-copy-btn,
body.note-fullscreen .note-section:hover .section-delete-subnote-btn {
  opacity: 1 !important;
}

/* Garder les effets hover en mode plein écran */
body.note-fullscreen .section-generate-btn:hover,
body.note-fullscreen .section-add-html-btn:hover,
body.note-fullscreen .section-markdown-btn:hover,
body.note-fullscreen .section-copy-btn:hover,
body.note-fullscreen .section-delete-subnote-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
}

body.note-fullscreen .note-display-content .note-subsection,
body.note-fullscreen .note-subsection,
body.note-fullscreen .note-display-content #note-content-list .note-subsection {
  margin-left: 0 !important;
  padding-left: 0 !important;
  border-left: none !important;
  margin-top: 2rem !important;
  padding-top: 1.5rem !important;
  color: var(--color-text-on-surface);
  position: relative;
}

/* Bordure utilisant la couleur du texte avec opacité */
body.note-fullscreen .note-display-content .note-subsection::before,
body.note-fullscreen .note-subsection::before,
body.note-fullscreen .note-display-content #note-content-list .note-subsection::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.2;
}

body.note-fullscreen .note-display-content .note-subsection .note-section-heading {
  font-size: 1.6em;
  border-bottom: none !important;
  color: var(--color-accent);
}

/* Masquer l'explorateur en mode plein écran (mais garder les intégrations HTML) */
body.note-fullscreen .note-explorer-sidebar {
  display: none !important;
}

body.note-fullscreen .note-explorer-toggle {
  display: none !important;
}

/* Styles pour les intégrations HTML en mode plein écran */
body.note-fullscreen .note-html-integration {
  display: block !important;
  margin: 2rem 0 !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  background: var(--color-surface) !important;
}

body.note-fullscreen .note-html-integration .note-html-header {
  background: var(--color-surface-alt) !important;
  padding: 1rem 1.5rem !important;
  border-bottom: 1px solid var(--color-border) !important;
}

body.note-fullscreen .note-html-integration .note-html-content {
  padding: 1.5rem !important;
}

body.note-fullscreen .note-html-integration iframe {
  width: 100% !important;
  min-height: 500px !important;
  border: none !important;
  background: white !important;
  border-radius: 4px !important;
}

/* Bouton plein écran flottant en mode plein écran */
body.note-fullscreen #note-fullscreen-btn-floating,
body.note-fullscreen .note-fullscreen-floating-btn {
  position: fixed !important;
  top: 1.5rem !important;
  right: 1.5rem !important;
  z-index: 10000 !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: var(--color-surface-alt) !important;
  border: 1px solid var(--color-border) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  border-radius: 8px !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--color-text-on-surface) !important;
}

body.note-fullscreen #note-fullscreen-btn-floating:hover,
body.note-fullscreen .note-fullscreen-floating-btn:hover {
  background: var(--color-button) !important;
  color: var(--color-button-text) !important;
  transform: scale(1.05) !important;
  border-color: var(--color-button) !important;
}

body.note-fullscreen #note-fullscreen-btn-floating i,
body.note-fullscreen .note-fullscreen-floating-btn i {
  font-size: 1.2rem !important;
  margin: 0 !important;
}

/* Style du markdown en mode plein écran */
body.note-fullscreen .note-section-content.markdown-content h1,
body.note-fullscreen .note-section-content.markdown-content h2,
body.note-fullscreen .note-section-content.markdown-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: none !important;
}

body.note-fullscreen .note-section-content.markdown-content h1 {
  font-size: 2.5em;
}

body.note-fullscreen .note-section-content.markdown-content h2 {
  font-size: 2em;
}

body.note-fullscreen .note-section-content.markdown-content h3 {
  font-size: 1.6em;
}

body.note-fullscreen .note-section-content.markdown-content p {
  margin-bottom: 1.5rem;
}

body.note-fullscreen .note-section-content.markdown-content code {
  background: var(--color-surface-alt);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

body.note-fullscreen .note-section-content.markdown-content pre {
  background: var(--color-surface-alt);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
}

#note-fullscreen-btn.active i {
  transform: scale(1.1);
}

#note-fullscreen-btn:hover i {
  transform: scale(1.2);
}

#note-fullscreen-btn i {
  transition: transform 0.2s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .note-explorer-sidebar {
    width: 80%;
    max-width: 400px;
  }
  
  .note-display-wrapper {
    grid-template-columns: 1fr;
  }
  
  .note-explorer-toggle {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  body.note-fullscreen .note-display-content {
    padding: 1rem;
  }
}

