/* ====================================================== */
/* ESTILOS RESPONSIVE OPTIMIZADOS PARA TODOS LOS DISPOSITIVOS */
/* ====================================================== */

/* ═══════════════════════════════════════════════════ */
/* MOBILE XS (320px - 479px) */
/* ═══════════════════════════════════════════════════ */
@media (max-width: 479px) {
  * { -webkit-text-size-adjust: 100%; }
  
  body {
    font-size: 14px;
    line-height: 1.4;
  }

  header {
    padding: 8px 10px !important;
    gap: 6px !important;
    flex-wrap: wrap;
  }

  header img.logo, .ikurrina {
    height: 28px !important;
    width: auto;
  }

  header h1 {
    font-size: 0.95rem !important;
    letter-spacing: 0.5px !important;
    line-height: 1.1;
  }

  header p.subtitulo {
    font-size: 0.65rem !important;
    letter-spacing: 0.5px !important;
  }

  main {
    padding: 12px 10px 24px !important;
  }

  .menu-botones {
    gap: 8px !important;
    width: 100%;
    max-width: 100%;
  }

  .btn-menu, button {
    padding: 16px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 10px !important;
    min-height: 50px;
    touch-action: manipulation;
  }

  .contenido {
    padding: 16px 12px !important;
    border-radius: 10px !important;
  }

  .contenido h2 {
    font-size: 1.1rem !important;
    margin-bottom: 12px;
  }

  .contenido p {
    font-size: 0.9rem !important;
    line-height: 1.5;
  }

  input, select, textarea {
    font-size: 16px !important;
    padding: 10px 12px !important;
    min-height: 44px;
  }

  #btn-etxea, #btn-instalar {
    padding: 6px 10px !important;
    font-size: 0.7rem !important;
    min-height: 36px;
  }

  .filtros {
    padding: 10px !important;
    gap: 8px !important;
    flex-direction: column;
  }

  .filtros label {
    width: 100% !important;
    font-size: 0.7rem !important;
  }

  .filtros select, .filtros input {
    width: 100% !important;
    min-width: unset !important;
  }

  .btn-reset {
    width: 100% !important;
    min-height: 40px;
  }

  .card-tarea {
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }

  .modal-box {
    max-height: 90vh !important;
    border-radius: 14px 14px 0 0 !important;
    margin: 0 !important;
  }

  #modal-playlist iframe {
    height: 500px !important;
  }

  footer {
    font-size: 0.65rem !important;
    padding: 8px !important;
  }
}

/* ═══════════════════════════════════════════════════ */
/* MOBILE SM (480px - 599px) */
/* ═══════════════════════════════════════════════════ */
@media (min-width: 480px) and (max-width: 599px) {
  header {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  header img.logo, .ikurrina {
    height: 32px !important;
  }

  header h1 {
    font-size: 1.05rem !important;
    letter-spacing: 1px !important;
  }

  main {
    padding: 18px 14px 32px !important;
  }

  .menu-botones {
    gap: 12px !important;
  }

  .btn-menu {
    padding: 20px 14px !important;
    font-size: 0.95rem !important;
    min-height: 60px;
  }

  .contenido {
    padding: 20px 16px !important;
  }

  .contenido h2 {
    font-size: 1.25rem !important;
  }

  .contenido p {
    font-size: 0.95rem !important;
  }

  .filtros {
    padding: 12px !important;
    gap: 10px !important;
    flex-direction: column;
  }

  .filtros select, .filtros input {
    width: 100% !important;
    min-height: 44px;
  }

  .btn-reset {
    width: 100% !important;
    min-height: 44px;
  }

  .modal-box {
    max-height: 92vh !important;
  }

  #modal-playlist iframe {
    height: 650px !important;
  }
}

/* ═══════════════════════════════════════════════════ */
/* MOBILE LG (600px - 767px) */
/* ═══════════════════════════════════════════════════ */
@media (min-width: 600px) and (max-width: 767px) {
  header {
    padding: 12px 16px !important;
    gap: 10px !important;
  }

  header img.logo, .ikurrina {
    height: 40px !important;
  }

  header h1 {
    font-size: 1.2rem !important;
    display: block !important;
  }

  main {
    padding: 24px 16px 40px !important;
  }

  .menu-botones {
    gap: 14px !important;
    max-width: 100%;
  }

  .btn-menu {
    padding: 24px 16px !important;
    font-size: 1.05rem !important;
    min-height: 70px;
  }

  .contenido {
    padding: 28px 20px !important;
    max-width: 100%;
  }

  .contenido h2 {
    font-size: 1.4rem !important;
  }

  .contenido p {
    font-size: 1.05rem !important;
  }

  .filtros {
    padding: 14px 16px !important;
    gap: 12px !important;
    flex-wrap: wrap;
  }

  .filtros select, .filtros input {
    min-width: 160px !important;
    min-height: 44px;
  }

  .btn-reset {
    width: auto !important;
    padding: 11px 20px !important;
  }

  .modal-box {
    max-height: 94vh !important;
    border-radius: 16px !important;
  }

  #modal-playlist iframe {
    height: 750px !important;
  }
}

/* ═══════════════════════════════════════════════════ */
/* TABLET (768px - 1023px) */
/* ═══════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
  header {
    padding: 14px 20px !important;
    gap: 12px !important;
  }

  header img.logo, .ikurrina {
    height: 44px !important;
  }

  header h1 {
    font-size: 1.3rem !important;
  }

  main {
    padding: 32px 20px 48px !important;
  }

  .menu-botones {
    max-width: 700px;
    gap: 16px !important;
  }

  .btn-menu {
    padding: 28px 18px !important;
    font-size: 1.1rem !important;
    min-height: 75px;
  }

  .contenido {
    padding: 36px 24px !important;
    max-width: 700px;
  }

  .contenido h2 {
    font-size: 1.6rem !important;
  }

  .contenido p {
    font-size: 1.1rem !important;
  }

  .filtros {
    padding: 16px 20px !important;
    gap: 14px !important;
    flex-wrap: wrap;
  }

  .filtros select, .filtros input {
    min-width: 180px !important;
    min-height: 44px;
  }

  .tabla-wrap {
    max-height: calc(100vh - 300px);
  }

  .modal-box {
    max-width: 600px !important;
    max-height: calc(100vh - 40px) !important;
  }

  #modal-playlist iframe {
    height: 850px !important;
  }
}

/* ═══════════════════════════════════════════════════ */
/* DESKTOP (1024px - 1365px) */
/* ═══════════════════════════════════════════════════ */
@media (min-width: 1024px) and (max-width: 1365px) {
  header {
    padding: 16px 24px !important;
  }

  header img.logo, .ikurrina {
    height: 48px !important;
  }

  header h1 {
    font-size: 1.4rem !important;
  }

  main {
    padding: 40px 28px 50px !important;
  }

  .menu-botones {
    max-width: 700px;
    gap: 18px !important;
  }

  .btn-menu {
    padding: 30px 20px !important;
    font-size: 1.2rem !important;
    min-height: 80px;
  }

  .contenido {
    padding: 40px 30px !important;
    max-width: 750px;
  }

  .contenido h2 {
    font-size: 1.8rem !important;
  }

  .contenido p {
    font-size: 1.15rem !important;
  }

  .filtros {
    padding: 18px 24px !important;
    gap: 16px !important;
  }

  .filtros select, .filtros input {
    min-width: 180px !important;
  }

  .tabla-wrap {
    max-height: calc(100vh - 260px);
  }

  .modal-box {
    max-width: 750px !important;
    max-height: calc(100vh - 50px) !important;
  }

  #modal-playlist iframe {
    height: 950px !important;
  }
}

/* ═══════════════════════════════════════════════════ */
/* LARGE DESKTOP (1366px+) */
/* ═══════════════════════════════════════════════════ */
@media (min-width: 1366px) {
  header {
    padding: 18px 28px !important;
  }

  header img.logo, .ikurrina {
    height: 52px !important;
  }

  header h1 {
    font-size: 1.6rem !important;
  }

  main {
    padding: 48px 32px 56px !important;
  }

  .menu-botones {
    max-width: 800px;
    gap: 20px !important;
  }

  .btn-menu {
    padding: 32px 22px !important;
    font-size: 1.3rem !important;
    min-height: 90px;
  }

  .contenido {
    padding: 48px 36px !important;
    max-width: 800px;
  }

  .contenido h2 {
    font-size: 2rem !important;
  }

  .contenido p {
    font-size: 1.2rem !important;
  }

  .filtros {
    padding: 20px 32px !important;
    gap: 18px !important;
  }

  .tabla-wrap {
    max-height: calc(100vh - 240px);
  }

  .modal-box {
    max-width: 900px !important;
    max-height: calc(100vh - 60px) !important;
  }

  #modal-playlist iframe {
    height: 1000px !important;
  }
}

/* ═══════════════════════════════════════════════════ */
/* OPTIMIZACIONES GLOBALES */
/* ═══════════════════════════════════════════════════ */

/* Botones touchables en mobile */
button, a, input[type="button"], input[type="submit"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
}

/* Inputs con mejor usabilidad mobile */
input, select, textarea {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 6px;
}

/* Prevenir zoom en input focus */
input, select, textarea {
  font-size: 16px;
}

/* Scroll suave */
html {
  scroll-behavior: smooth;
}

/* Mejorar accesibilidad */
:focus {
  outline: 2px solid #1a5c38;
  outline-offset: 2px;
}

/* Prevenir problema de viewport height en mobile */
@supports (height: 100dvh) {
  html, body {
    height: 100dvh;
  }
}

/* Sombras más sutiles en mobile */
@media (max-width: 767px) {
  * {
    box-shadow: none !important;
  }

  button, .btn-menu, .card-tarea {
    box-shadow: 0 2px 8px rgba(0,0,0,.15) !important;
  }
}

/* Mejorar imágenes responsivas */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Tablas responsivas */
table {
  width: 100%;
  border-collapse: collapse;
}

/* Prevenir overflow horizontal */
body {
  overflow-x: hidden;
}

/* Mejora de contraste en mobile */
@media (max-width: 599px) {
  body {
    background-color: #0a1109;
  }

  button, .btn-menu {
    box-shadow: 0 3px 12px rgba(0,0,0,.3);
  }
}
