/* ----------------------------- */
/*   RESET GENERAL               */
/* ----------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: 0.3s ease-in-out;
  min-height: 100vh;
}

/* ----------------------------- */
/*   VARIABLES MODO CLARO/OSCURO */
/* ----------------------------- */
body.dark {
  --bg: #0d0d0d;
  --card: #1a1a1a;
  --border: #333;
  --text: #f5f5f5;
  --accent: #6ab8ff;
}

body.light {
  --bg: #e1d0e2;        /* lila pastel muy suave */
  --card: #b19aaf9c;      /* rosa-lila claro */
  --border: #e6c8ff;    /* borde lila tenue */
  --text: #3a2d3f;      /* morado oscuro → buena lectura */
  --accent: #c26bff;    /* lila vibrante/elegante para botones */
}


/* ----------------------------- */
/*   PARTICULAS DEL FONDO        */
/* ----------------------------- */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -2;  /* más atrás del fondo */
}


/* ----------------------------- */
/*   HEADER                      */
/* ----------------------------- */
.mp-header {
  padding: 25px;
  text-align: center;
  position: relative;
}

.mp-back {
  position: absolute;
  left: 20px;
  top: 20px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
}

.top-controls {
  position: absolute;
  right: 20px;
  top: 15px;
  display: flex;
  gap: 10px;
}

.theme-toggle {
  padding: 6px 10px;
  font-size: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
}

.lang-select {
  padding: 6px 10px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mp-title {
  font-size: 38px;
  margin-top: 70px;
  font-weight: 700;
  letter-spacing: -1px;
}

.mp-sub {
  font-size: 18px;
  opacity: 0.8;
}

/* ----------------------------- */
/*   MAIN                        */
/* ----------------------------- */
.mp-main {
  width: 95%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 0 50px;
}

/* ----------------------------- */
/*   SECCIONES                   */
/* ----------------------------- */
.mp-section {
  margin-bottom: 50px;
}

.mp-section h2 {
  font-size: 26px;
  margin-bottom: 10px;
  color: var(--accent);
}

/* ----------------------------- */
/*   BLOQUES SQL                 */
/* ----------------------------- */
.sql-container {
  display: flex;
  flex-direction: column;
  gap: 35px;
}

.sql-block {
  background: var(--card);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0px 4px 12px rgba(0,0,0,0.1);
}

.sql-block h3 {
  margin-bottom: 15px;
}

/* FLEX SQL + IMG */
.sql-flex {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: stretch;
}

/* ----------------------------- */
/*   CÓDIGO SQL                  */
/* ----------------------------- */
.sql-code-container {
  position: relative;
  width: 50%;
  background: #111;
  color: white;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #444;
  overflow: auto;
  text-align: left;
  line-height: 1.5;
}

.sql-code-container pre {
  margin: 0;
  padding: 0;
}


.sql-code {
  font-family: "Fira Code", monospace;
  font-size: 14px;
  white-space: pre-line;   /* <-- ESTE es el truco */
  text-align: left;
  word-break: break-word;
  line-height: 1.5;
}



/* Colores SQL */
.sql-keyword { color: #4da3ff; font-weight: 600; }
.sql-number { color: #f8c555; }
.sql-string { color: #8aff80; }

/* Botón copiar */
.copy-btn,
.expand-btn {
  position: absolute;
  right: 12px;
  background: #00000080;
  border: none;
  padding: 4px 8px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
}

.copy-btn {
  top: 10px;
}

.expand-btn {
  top: 40px;
}

/* ----------------------------- */
/*   IMÁGENES                    */
/* ----------------------------- */
.img-wrapper {
  position: relative;
  width: 50%;
}

.sql-img {
  width: 100%;
  max-width: 420px;
  max-height: 330px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: block;
  margin: auto;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}



.expand-img-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #00000080;
  border: none;
  padding: 4px 8px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
}

/* ----------------------------- */
/*   OBSERVACIÓN                 */
/* ----------------------------- */
.sql-obs {
  margin-top: 15px;
  opacity: 0.9;
}

/* ----------------------------- */
/*   BOTÓN PROYECTOS             */
/* ----------------------------- */
.mp-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s;
}

.mp-btn:hover {
  opacity: 0.85;
}

/* ----------------------------- */
/*   FOOTER                      */
/* ----------------------------- */
.mp-footer {
  padding: 30px 0;
  text-align: center;
  opacity: 0.6;
}

/* ----------------------------- */
/*   MODAL (POPUP)               */
/* ----------------------------- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000bb;
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: var(--card);
  padding: 20px;
  border-radius: 14px;
  width: 92%;
  max-width: 720px;  /* más pequeño → más elegante */
  max-height: 88vh;
  overflow: auto;
  position: relative;
  border: 1px solid var(--border);
}


.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  cursor: pointer;
  font-size: 20px;
  color: var(--text);
}

.modal-img {
  max-width: 85vw;   /* que nunca ocupe todo */
  max-height: 80vh;  /* evita scroll vertical */
  object-fit: contain;
  border-radius: 12px;
  margin: 20px auto;
  display: block;
}


.modal-sql {
  white-space: pre-wrap;
  font-family: "Fira Code", monospace;
  font-size: 16px;
  color: var(--text);
}

/* ----------------------------- */
/*   RESPONSIVE                  */
/* ----------------------------- */
@media (max-width: 850px) {

  .sql-flex {
    flex-direction: column;
  }

  .sql-code-container,
  .img-wrapper {
    width: 100%;
  }

  .mp-title {
    margin-top: 50px;
  }
}
