/* static/style.css */

/* —————————————————————————
   RESETS Y ESTILOS BÁSICOS
   ————————————————————————— */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: #000;
  color: #fff;
  font-family: monospace;
  padding: 20px 10px;
  font-size: 20px; /* Escritorio: 20px */
}

h1 {
  font-size: 1.5rem; /* 1.5 × 20px = 30px en escritorio */
  margin-bottom: 20px;
}

/* —————————————————————————
   ENLACES GENERALES
   ————————————————————————— */
a {
  color: #66ccff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* —————————————————————————
   TABLA Y CELDAS
   ————————————————————————— */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #444;
  vertical-align: middle;
  word-wrap: break-word;
  word-break: break-word;
}

/* Anchos personalizados para columnas */
th.preview, td.preview {
  width: 15%;
  text-align: center;
}

th.name, td.name {
  width: 35%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

th.last_modified, td.last_modified {
  width: 25%;
}

th.size, td.size {
  width: 25%;
}

/* Hover para filas */
tr:hover {
  background-color: #222;
}

/* —————————————————————————
   ESTILOS ESPECÍFICOS
   ————————————————————————— */
/* Enlace del nombre del archivo */
.file-name {
  color: #66ccff;
  display: inline-block;
  margin-bottom: 4px;
  position: relative;
  z-index: 1; /* Asegurar que esté sobre el área clickeable */
  
  /* Permitir selección solo en el nombre */
  user-select: auto;
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
}

.file-name:hover {
  text-decoration: underline;
}

/* Metadatos debajo del nombre */
.meta {
  font-size: 0.9em;
  color: #888;
  display: block;
}

/* Miniaturas */
.preview img {
  max-width: 120px;
  max-height: 120px;
  width: auto;
  height: auto;
  display: inline-block;
  border-radius: 4px;
  object-fit: contain;
  margin: 0 auto;
}

/* —————————————————————————
   FILAS CLICKEABLES SIN RESALTADO
   ————————————————————————— */
tr.clickable-row {
  position: relative;
  cursor: pointer;
  
  /* Prevenir selección de texto */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Eliminar resaltado al hacer clic */
tr.clickable-row:active {
  background-color: inherit !important;
}

/* —————————————————————————
   RESPONSIVE (móvil)
   ————————————————————————— */
@media (max-width: 600px) {
  body {
    font-size: 16px; /* Móvil: 16px */
    padding: 12px 6px;
  }

  table {
    font-size: 14px;
    table-layout: auto;
  }

  /* Miniaturas en móvil */
  .preview img {
    max-width: 96px;
    max-height: 96px;
  }

  th, td {
    padding: 6px 8px;
  }

  th.preview, td.preview {
    width: 20%;
    text-align: center;
  }

  th.name, td.name {
    width: 40%;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  th.last_modified, td.last_modified {
    width: 20%;
  }

  th.size, td.size {
    width: 20%;
  }
}
