/* Bouton Mode Étude – Style A (Loupe premium) */
.mhg-study-btn {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 12px 22px;
    margin-top: 12px;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;

    font-size: 17px;
    font-weight: 600;
    color: #f6e7d0;
    text-shadow: 0 1px 2px #000;

    /* Fond cuir Imagine */
    background: #442a13 url("https://www.cours-de-guitare-montpellier.fr/wp-content/uploads/2025/11/texture-cuir-fonce.jpg") center/cover;

    border: 2px solid #BA8225;
    border-radius: 10px;

    box-shadow:
        inset 0 0 6px rgba(255,255,255,0.12),
        0 4px 12px rgba(0,0,0,0.5);

    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Survol */
.mhg-study-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 0 8px rgba(255,255,255,0.25),
        0 6px 16px rgba(0,0,0,0.65);
}

/* Clic */
.mhg-study-btn:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 0 12px rgba(0,0,0,0.9);
}

/* Option : icône un peu plus grande */
.mhg-study-btn svg,
.mhg-study-btn span.emoji {
    font-size: 20px;
}

.mhg-pdf-embed embed,
.mhg-pdf-embed iframe {
    width: 100%;
    min-height: calc(100vh - 48px);
    border: none;
}



/* ============================================================
   🎓 MODE ÉTUDE MINI – OVERLAY PLEIN ÉCRAN
   ============================================================ */

.mhg-mode-etude #mhg-me-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  flex-direction: column;

  width: 100vw;
  height: 100vh;

  background: #000
    url("https://www.cours-de-guitare-montpellier.fr/wp-content/uploads/2025/11/background-bois.jpg")
    center/cover no-repeat;

  overflow: hidden;
}

/* Zone centrale PDF */
.mhg-mode-etude .mhg-me-pdfbox {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.mhg-mode-etude .mhg-me-pdf-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  z-index: 1;
}

/* Canvas PDF */
.mhg-mode-etude #mhg-pdf-render {
  display: block;
  border-radius: 8px;
  max-width: none;
  max-height: none;
}

.mhg-mode-etude .mhg-me-pdfbox:active {
  cursor: grabbing;
}

/* ============================================================
   PANNEAU BLOC-NOTES
   ============================================================ */

.mhg-mode-etude .mhg-me-notes-panel {
  position: absolute;
  right: clamp(24px, 6vw, 120px);
  bottom: 24px;
  width: min(420px, 90vw);
  max-height: 60vh;
  opacity: 0;
  transform: translate3d(12px, 12px, 0);
  will-change: opacity, transform;
  background:
    linear-gradient(135deg, rgba(84, 52, 27, 0.96), rgba(50, 29, 13, 0.94)),
    url("https://www.cours-de-guitare-montpellier.fr/wp-content/uploads/2025/11/texture-cuir-fonce.jpg")
      center/cover;
  background-blend-mode: soft-light;
  border: 1px solid rgba(214, 171, 117, 0.35);
  border-radius: 14px;
  box-shadow:
    inset 0 0 14px rgba(255, 255, 255, 0.06),
    0 16px 36px rgba(0, 0, 0, 0.4);
  padding: 0;
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 10015;
}

.mhg-mode-etude .mhg-me-notes-panel.is-visible {
  display: flex;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  animation: mhg-me-notes-panel-enter 180ms ease-out;
}

@keyframes mhg-me-notes-panel-enter {
  from {
    opacity: 0;
    transform: translate3d(12px, 12px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.mhg-mode-etude .mhg-me-notes-panel-content {
  max-height: calc(60vh - 56px);
  overflow: auto;
  background: transparent;
  box-shadow: none;
  padding: 0 12px 12px;
}

.mhg-mode-etude .mhg-me-notes-panel .notes-eleve-container {
  margin: 0;
  padding: 0;
  max-width: 100%;
  width: 100%;
  box-shadow: none;
  background: none;
}

.mhg-mode-etude .mhg-me-notes-panel .notes-eleve-container::before {
  content: none;
}

.mhg-mode-etude .mhg-me-notes-panel .notes-eleve-inner {
  padding: 16px;
}

.mhg-mode-etude .mhg-me-notes-panel .notes-eleve-update {
  margin-bottom: 0;
}

.mhg-mode-etude .mhg-me-notes-loading {
  color: #f6e7d0;
  font-size: 14px;
  text-align: center;
  padding: 16px 12px;
}

.mhg-mode-etude .mhg-me-notes-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(84, 52, 27, 0.92), rgba(50, 29, 13, 0.9)),
    url("https://www.cours-de-guitare-montpellier.fr/wp-content/uploads/2025/11/texture-cuir-fonce.jpg")
      center/cover;
  background-blend-mode: soft-light;
  border-bottom: 1px solid rgba(214, 171, 117, 0.25);
  border-radius: 14px 14px 0 0;
}

.mhg-mode-etude .mhg-me-notes-panel-title {
  flex: 1;
  text-align: center;
  color: #f6e7d0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  user-select: none;
}

.mhg-mode-etude .mhg-me-notes-drag-handle,
.mhg-mode-etude .mhg-me-notes-close,
#mhg-metronome-floating .mhg-metronome-handle,
#mhg-metronome-floating .mhg-metronome-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: #f6e7d0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
}

.mhg-mode-etude .mhg-me-notes-drag-handle,
#mhg-metronome-floating .mhg-metronome-handle {
  cursor: grab;
}

.mhg-mode-etude .mhg-me-notes-panel.is-dragging .mhg-me-notes-drag-handle {
  cursor: grabbing;
}

.mhg-mode-etude .mhg-me-notes-close,
#mhg-metronome-floating .mhg-metronome-close {
  cursor: pointer;
}

.mhg-mode-etude #mhg-metronome-floating .mhg-panel::before {
  content: none;
  display: none;
}

#mhg-metronome-floating .mhg-metronome-handle::before {
  content: "⋮⋮";
  line-height: 1;
}

#mhg-metronome-floating .mhg-metronome-handle.is-dragging {
  cursor: grabbing;
}

/* ============================================================
   ANNOTATIONS TEXTE (OVERLAY HTML)
   ============================================================ */

.mhg-mode-etude .mhg-annotation-layer {
  position: absolute;
  inset: 0;
  z-index: 9999;
  pointer-events: auto;
}

body.mhg-annotations-hidden .mhg-mode-etude .mhg-annotation-layer {
  display: none;
}

.mhg-mode-etude .mhg-annotation-layer.is-active {
  cursor: text;
}

.mhg-mode-etude .mhg-annotation-layer.mhg-main-active {
  pointer-events: none;
  cursor: default;
}

.mhg-mode-etude .mhg-annotation-layer.mhg-eraser-active {
  cursor: crosshair;
}

.mhg-mode-etude .mhg-annotation-layer.mhg-eraser-active *,
.mhg-mode-etude .mhg-annotation-layer.mhg-eraser-active .mhg-annotation-content {
  cursor: crosshair !important;
  user-select: none;
}

.mhg-mode-etude .mhg-annotation-layer.mhg-freehand-active {
  cursor: crosshair;
}

.mhg-mode-etude .mhg-annotation-layer.mhg-rect-active {
  cursor: crosshair;
}

.mhg-mode-etude .mhg-annotation-layer.mhg-move-active,
.mhg-mode-etude .mhg-annotation-layer.mhg-move-active * {
  cursor: move !important;
  user-select: none;
}

.mhg-mode-etude .mhg-annotation {
  position: absolute;
  min-width: 40px;
  min-height: 20px;
  background: transparent;
  outline: none;
  white-space: pre-wrap;
}

.mhg-mode-etude .mhg-annotation-stamp {
  min-width: 0;
  min-height: 0;
  pointer-events: auto;
  background: transparent;
  border: none;
  box-shadow: none;
}

.mhg-mode-etude .mhg-annotation-stamp img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mhg-mode-etude .mhg-annotation-rect {
  overflow: visible;
}

.mhg-mode-etude .mhg-annotation-rect .mhg-rect-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #f6d69f;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  z-index: 2;
  display: none;
  pointer-events: auto;
}

.mhg-mode-etude .mhg-annotation-rect.is-selected .mhg-rect-handle {
  display: block;
}

.mhg-mode-etude .mhg-annotation-rect .mhg-rect-handle[data-corner="nw"] {
  left: 0;
  top: 0;
  cursor: nwse-resize;
}

.mhg-mode-etude .mhg-annotation-rect .mhg-rect-handle[data-corner="ne"] {
  left: 100%;
  top: 0;
  cursor: nesw-resize;
}

.mhg-mode-etude .mhg-annotation-rect .mhg-rect-handle[data-corner="sw"] {
  left: 0;
  top: 100%;
  cursor: nesw-resize;
}

.mhg-mode-etude .mhg-annotation-rect .mhg-rect-handle[data-corner="se"] {
  left: 100%;
  top: 100%;
  cursor: nwse-resize;
}

.mhg-mode-etude .mhg-annotation-freehand {
  min-width: 0;
  min-height: 0;
}

.mhg-mode-etude .mhg-annotation-freehand svg {
  display: block;
}

.mhg-mode-etude .mhg-annotation-freehand path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mhg-mode-etude .mhg-annotation-content {
  min-width: 40px;
  min-height: 20px;
  white-space: pre-wrap;
  outline: none;
  cursor: text;
}

.mhg-mode-etude .mhg-annotation-content:focus {
  outline: 1px dashed rgba(255, 255, 255, 0.85);
}

.mhg-mode-etude .mhg-annotation-content.is-editing {
  background: rgba(255, 255, 200, 0.9);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 8px 10px;
}

.mhg-mode-etude .mhg-editable-text {
  background: rgba(255, 255, 200, 0.9);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1.4;
  min-width: 120px;
  min-height: 32px;
  color: #000;
  outline: none;
  z-index: 10000;
  white-space: pre-wrap;
}

/* ============================================================
   BOUTON TOOLBAR : MASQUER / AFFICHER ANNOTATIONS
   ============================================================ */

.mhg-annotation-toolbar__annotations-toggle {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #d8cbb8;
  background-color: #ffffff;
  color: #2b1b12;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  margin-top: 8px;
}

/* ============================================================
   CONTRÔLES (Zoom / Fermer)
   ============================================================ */

.mhg-mode-etude .mhg-me-controls {
  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  width: max-content;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  z-index: 10020;
}

.mhg-mode-etude .mhg-me-btn {
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s ease, background 0.2s ease;
}

.mhg-mode-etude .mhg-me-btn img {
  width: 20px;
  height: 20px;
  display: block;
}

.mhg-mode-etude .mhg-me-btn:hover {
  transform: scale(1.07);
  background: rgba(0, 0, 0, 0.85);
}

/* ============================================================
   NOTES (panneau toggle)
   ============================================================ */

.mhg-mode-etude .mhg-me-notes-panel {
  display: none;
}

.mhg-mode-etude .mhg-me-notes-panel.is-visible {
  display: flex;
}

/* ============================================================
   NAVIGATION ENTRE LES PAGES
   ============================================================ */

.mhg-mode-etude .mhg-me-nav {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  align-items: center;
  gap: 12px;

  z-index: 10020;
}

.mhg-mode-etude .mhg-me-page {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 2px 6px #000;
}

/* ============================================================
   BLOC TEMPO (mini)
   ============================================================ */

.mhg-mode-etude .mhg-me-tempo-block {
  position: absolute;
  bottom: 25px;
  right: 25px;
  z-index: 10025;

  padding: 0;
  margin: 0;

  background: #4a2e14
    url("https://www.cours-de-guitare-montpellier.fr/wp-content/uploads/2025/11/texture-cuir-fonce.jpg")
    center/cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.mhg-mode-etude .mhg-me-tempo-inner {
  position: relative;
  padding: 26px 12px 10px 20px;
  border-radius: 12px;
  background: rgba(20, 10, 5, 0.45);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
}

/* Poignée de drag */
.mhg-mode-etude .mhg-me-tempo-handle {
  width: 14px;
  height: 14px;
  position: absolute;
  top: 8px;
  left: 8px;
  cursor: move;

  background: rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Champs tempo / note */
.mhg-mode-etude #mhg-me-tempo,
.mhg-mode-etude #mhg-me-note {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #6a4b2d;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 14px;
  color: #3a2a18;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.4);
}

.mhg-mode-etude #mhg-me-note {
  margin-top: 6px;
  resize: vertical;
  min-height: 60px;
}

/* Boutons save / reset */
.mhg-mode-etude .mhg-me-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.mhg-mode-etude .mhg-me-icon-btn {
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mhg-mode-etude .mhg-me-icon-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
}

.mhg-mode-etude .mhg-me-icon-btn:active {
  transform: scale(0.97);
}

/* Statut */
.mhg-mode-etude .mhg-me-status {
  margin-top: 4px;
  font-size: 12px;
  color: #f3d89c;
  text-align: right;
  opacity: 0.85;
}

/* ============================================================
   MÉTRONOME FLOTTANT
   ============================================================ */

.mhg-mode-etude-active #mhg-metronome-floating {
  z-index: 2147483647 !important;
}


/* Empêche toute barre de scroll dans le mode étude */
.mhg-mode-etude,
.mhg-mode-etude #mhg-me-overlay {
    overflow: hidden !important;
}
