/* =====================================================
   VARIABLES Y RESET
===================================================== */
:root {
  --bg: #ffffff;
  --text: #111;
  --panel: #f6f6f6;
  --border: #ddd;
  --accent: #6d7d91;
}

body.dark {
  --bg: #121212;
  --text: #eee;
  --panel: #1c1c1c;
  --border: #333;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'raleway', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Poppins', sans-serif;
  margin-bottom: 0.2em;
}

p {
  margin-bottom: 1.1em;
}

ul {
  list-style: none;
  padding-left: 1.2em;
}

li {
  position: relative;
  font-size: 0.95em;
  margin-bottom: 0.2em;
}

li::before {
  content: "–";
  position: absolute;
  left: -1em;
  color: #aaa;
}
/* =====================================================
   APP LAYOUT
===================================================== */
.app {
  display: block;
  min-height: 100vh;
}

/* =====================================================
   TOPBAR
===================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;

  height: 56px;
  padding: 0 20px;

  display:flex;
  align-items: center;

  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

/* =====================================================
   SIDEBAR
===================================================== */
.sidebar {
  width: 320px;
  height: 100vh;
  position:fixed;
  top: 0;
  left: 0;

  background: var(--panel);
  border-right: 1px solid var(--border);

  padding: 24px 16px;
  overflow-y: auto;

  transition: transform 0.3s ease, opacity 0.3s ease;
}

.sidebar-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 44px;
}

.sidebar-logo img {
  max-width: 220px;
}

/* =====================================================
   MENÚ
===================================================== */
.menu a {
  display: block;
  padding: 10px 12px;
  margin-bottom: 6px;

  text-decoration: none;
  color: var(--text);

  border-radius: 6px;
}

.menu a:hover {
  background: rgba(74,144,226,0.12);
}

.menu a.active {
  background: rgba(74,144,226,0.12);
  font-weight: 600;
}

.menu-group {
  margin-bottom: 6px;
}

.menu-parent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px;
  cursor: pointer;
}

.menu-parent-row:hover {
  background: rgba(74, 144, 226, 0.12);
}

.menu-parent {
  flex: 1;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 0.9rem;
  color: var(--text);
  transition: transform 0.2s ease;
}

.menu-group.open .menu-toggle {
  transform: rotate(90deg);
}

.submenu {
  display: none;
  margin-left: 16px;
  margin-top: 4px;
}

.menu-group.open .submenu {
  display: block;
}

.submenu a {
  display: block;
  padding: 8px 10px;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 5px;
}

.submenu a:hover {
  background: rgba(74, 144, 226, 0.12);
}

.submenu a.active {
  background: rgba(74, 144, 226, 0.18);
  font-weight: 600;
}
/* ===============================
   ICONOS
================================ */
.daw-icon svg {
  width: 22px;
  height: 22px;
  color: #6d7d91;
}

body.dark .daw-icon svg {
  color: #7ab6ff;
}

.daw-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;

  background: var(--panel);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 2px;

  padding: 8px 16px;
  margin: 30px 0;

  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;

  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.daw-button:hover {
  background: rgba(74,144,226,0.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.daw-icon svg {
  width: 22px;
  height: 22px;
  color: #6d7d91;
  flex-shrink: 0;
}
.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color:#6d7d91;
  padding: 6px;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  color: var(--text);

  transition: background 0.2s ease,
              transform 0.15s ease,
              box-shadow 0.15s ease;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  color:#6d7d91;
}
/* =====================================================
   MODAL
===================================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(46, 46, 46, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
 
}

.modal-content {
  background: var(--bg);
  color: var(--text);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  padding: 30px;
  overflow-y: auto;
  border-radius: 4px;
  border-left: 6px solid #6d7d91;
}

.close-modal {
  float: right;
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
}

.modal-img {
  margin: 5px 0;
  border-radius: 10px;
  border: 1px solid #979797;
  background: var(--panel);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
/* =====================================================
   MAIN / PAGE
===================================================== */
.main {
  margin-left: 320px;
  width: 100%;
  padding-top: 6px;
  background: #ffffff;
}
body.dark .main {
  background: #1b1b1b;
}

.page {
  max-width: 920px;
  margin: 32px 0 32px -22px;
  padding: 32px 36px 48px 48px;

  background: #fff;
  border-radius: 14px;
}
body.dark .page {
  background: #1b1b1b;
}
/* =====================================================
   TARJETAS DIDÁCTICAS
===================================================== */
.didactic-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin: 36px 0;
}

body.dark .didactic-card {
  background: #1c1c1c;
}

.didactic-title {
  margin-bottom: 16px;
  font-weight: 600;
}

/* =====================================================
   BOTONES / ICONOS
===================================================== */
.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

.icon-btn:hover {
  background: var(--panel);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

/* =====================================================
   MODO ENFOQUE
===================================================== */
body.focus-mode .sidebar {
  transform: translateX(-100%);
  opacity: 0;
}

body.focus-mode .main {
  margin-left: 0;
}
/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 768px) {

  .sidebar {
    transform: translateX(-100%);
    z-index: 999;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .page {
    margin: 16px;
    padding: 24px;
  }
}
/* =====================================================
   IMÁGENES
===================================================== */
img {
  width: 100%;
  height: auto;
}

.img-fx {
  border-radius: 12px;
  border-left: 6px solid #6d7d91;
  background: var(--panel);
  animation: fadeIn 0.6s ease forwards;
    
}

@keyframes fadeIn {
  to { opacity: 1; }
}
.watermark {
  position: relative;
  display: inline-block;
}

.watermark::after {
  content: "© Micro Teoria  musical";
  position: absolute;
  bottom: 2%;
  left: 10%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #000;
  opacity: 0.15;
  pointer-events: none;
  white-space: nowrap;
}
/* =====================================================
   FOOTER
===================================================== */
.course-footer {
  margin-top: 30px;
  padding: 20px 10px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-logo img {
  max-width: 250px;
}

.footer-text {
  font-size: 0.85rem;
  color: #777;
}

body.dark .footer-text {
  color: #aaa;
}
.footer-text a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

/* =====================================================
   NAVEGACION DE LECCIONES
===================================================== */

.lesson-nav {
  margin-top: 50px;
  display: flex;
  justify-content: space-between;
}

.lesson-nav a {
  color:var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 2px;
  background: var(--panel);
  
}

.lesson-nav a:hover {
  background: var(--panel);
  background: rgba(74, 144, 226, 0.12);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  transform: translateY(-1px);
  transition: background 0.2s ease,
              transform 0.15s ease,
              box-shadow 0.15s ease;
  
}
.reference-block {
  background: var(--panel);
  border-left: 4px solid #6d7d91;
  padding: 20px;
  margin: 30px 0;
  border-radius: 6px;
}
/* ===============================
   VEXFLOW
================================ */
.vex-container {
  background: var(--panel);
  padding: 1%;
  border: 1px solid #ffffff;
  border-radius: 12px;
  display: inline-block;
  border-left: 6px solid #6d7d91;

}
body.dark .vex-container {
  background: #ffffff;
}
.vex-container svg {
  display: block;
  margin: auto;
}

.vex-watermark {
  position: relative;
  display: inline-block;
}
.vex-watermark::after {
  content: "© Micro Teoria  musical";
  position: absolute;
  top: 5%;
  left: 90px;
  transform: translateX(-50%);
  font-size: 12px;
  color: #000;
  opacity: 0.15;
  pointer-events: none;
  white-space: nowrap;
}
/* ===============================
   TABLA DE ACORDES
================================ */
.chord-table{
  border-collapse:collapse;
  width:100%;
  max-width:1000px;
  background:#fff;
  margin-top:30px;
}
.dark-safe {
  background: #fff !important;
  color: #111 !important;
  filter: none !important;
}
.chord-table td, .chord-table th{
  border:1px solid #333;
  padding:8px;
  text-align:center;
}
.chord-table thead{ background:#eee; }
.chord-table tr.active{ background:#99afca; }
.chord-top {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap; /* ← MUY IMPORTANTE */
}
.chord-buttons {
  max-width: 360px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* =====================================================
   OCULTAR / MOSTRAR TEXTO
===================================================== */
.is-hidden {
  display: none !important;
}
/* ===============================
   En construcción
================================ */
* {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }
  .construction {
      text-align: center;
      padding: 40px 24px;
      max-width:auto;
      
    }

  .logo {
      width: 60%;
      height: 60%;
      margin: 0 auto 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px dashed rgba(255,255,255,0.2);
      border-radius: 16px;
      color: var(--muted);
      font-size: 14px;
    }
    /* ===============================
   ABOUT
================================ */
.author-profile {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  
}

.author-photo img {
  width: 100%;
  max-width: 240px;
  border-radius: 4px;
  object-fit:contain;
  transition: filter 0.3s ease;
}

.author-info h3 {
  margin: 0;
  font-size: 1.1rem;
}

.author-role {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 4px 0 12px;
}

@media (max-width: 640px) {
  .author-profile {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
   /* ===============================
   REDES SOCIALES
================================ */
.social-ui {
  display: flex;
  gap: 2.0rem;
}

.social-ui a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: var(--btn-radius);
  background: transparent;

  transition: background 0.2s ease;
}

.social-ui a:hover {
  background: var(--btn-hover-bg);
}

.social-ui img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
   /* ===============================
   INDEX
================================ */
.course-intro {
  max-width: 720px;
  margin: 80px auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.start-course {
  display: inline-block;
  margin: 24px auto 0;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}

.start-course:hover {
  opacity: 0.9;
}
