/* === CYBERPUNK DIRECTORY LISTING === */

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;600&display=swap");

body {
  margin: 0;
  padding: 20px;
  font-family: "JetBrains Mono", monospace;
  background: radial-gradient(circle at top, #0a0013, #000);
  color: #e0e0f0;
}

/* Titolo */
h1 {
  color: #ff00e6;
  text-shadow: 0 0 10px #ff00e6, 0 0 25px #ff009d;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 0, 230, 0.4);
  padding-bottom: 10px;
  margin-bottom: 20px;
  font-size: 0;
}

/* Area listing */
pre {
  background: rgba(0, 0, 0, 0.5);
  padding: 15px;
  border: 1px solid rgba(0, 255, 255, 0.25);
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.15);
  overflow-x: auto;
  font-size: 15px;
}

/* Link */
a {
  color: #00eaff;
  text-decoration: none;
  transition: 0.2s ease;
  text-shadow: 0 0 8px #00eaff;
}

a:hover {
  color: #ff00d4;
  text-shadow: 0 0 12px #ff00d4, 0 0 24px #ff00d4;
}

/* Nascondere autoindex.css */
a[href="autoindex.css"],
a[href$="/autoindex.css"] {
  display: none !important;
}

/* “Glitch” header animation */
h1::after {
  content: "Northern Lights Logs";
  margin-left: 8px;
  font-size: 24px;
  color: #00eaff;
  animation: glitch 1.5s infinite;
  opacity: 0.5;
}

#goto-button {
  font-size: 40px;
  margin: 10% auto 0 auto;
  display: block;
  padding: 30px 50px;
  border-radius: 20px;
  width: 10ch;
  text-align: center;
  background: linear-gradient(45deg, #ff00e6, #00eaff);
  color: #000;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(255, 0, 230, 0.5), 0 0 30px rgba(0, 234, 255, 0.5);
}

#goto-button:hover {
  box-shadow: 0 0 30px rgba(255, 0, 230, 0.8), 0 0 40px rgba(0, 234, 255, 0.8);
}

@keyframes glitch {
  0% {
    opacity: 0.5;
    transform: translate(1px, -1px);
  }
  25% {
    opacity: 0.2;
    transform: translate(-1px, 1px);
  }
  50% {
    opacity: 0.4;
    transform: translate(2px, -1px);
  }
  75% {
    opacity: 0.3;
    transform: translate(-2px, 2px);
  }
  100% {
    opacity: 0.5;
    transform: translate(1px, 1px);
  }
}

/* --- Stile base moderno --- */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #050816;
  color: #f5f5f5;
}

h1 {
  margin-bottom: 0.5rem;
}

#file-browser {
  margin-top: 1rem;
  padding: 1rem 1.5rem;
  background: radial-gradient(circle at top, #1a1a3b 0, #050816 55%);
  border-radius: 1rem;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.15);
}

/* Wrapper per la tabella con altezza minima */
.fb-table-wrapper {
  min-height: 360px;
  position: relative;
}

.fb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.fb-search {
  position: relative;
  flex: 1 1 200px;
  max-width: 280px;
}

.fb-search input {
  width: 100%;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.55);
  color: #f5f5f5;
  outline: none;
}

.fb-search input:focus {
  border-color: #00ffff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

.fb-meta {
  font-size: 0.8rem;
  opacity: 0.8;
}

table.fb-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  table-layout: fixed;
}

table.fb-table thead {
  background: linear-gradient(
    90deg,
    rgba(0, 255, 255, 0.2),
    rgba(255, 0, 255, 0.2)
  );
}

table.fb-table th,
table.fb-table td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Larghezze fisse per le colonne */
table.fb-table th:nth-child(1),
table.fb-table td:nth-child(1) {
  width: 50%; /* Nome file */
}

table.fb-table th:nth-child(2),
table.fb-table td:nth-child(2) {
  width: 20%; /* Data */
}

table.fb-table th:nth-child(3),
table.fb-table td:nth-child(3) {
  width: 20%; /* Periodo */
}

table.fb-table th:nth-child(4),
table.fb-table td:nth-child(4) {
  width: 10%; /* Dimensione */
}

table.fb-table th {
  cursor: pointer;
  user-select: none;
}

table.fb-table th.sort-asc::after {
  content: " \25B2";
  font-size: 0.7rem;
}

table.fb-table th.sort-desc::after {
  content: " \25BC";
  font-size: 0.7rem;
}

table.fb-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

table.fb-table tbody tr:hover {
  background: rgba(0, 255, 255, 0.08);
}

.fb-name a {
  color: #7be9ff;
  text-decoration: none;
}

.fb-name a:hover {
  text-decoration: underline;
}

.fb-empty {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Stili per la paginazione */
#fb-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 8px;
}

#fb-pagination button.page-nav {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.55);
  color: #00eaff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 0 0 8px #00eaff;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#fb-pagination button.page-nav:hover:not(:disabled) {
  background: rgba(0, 255, 255, 0.15);
  border-color: #00eaff;
  box-shadow: 0 0 10px rgba(0, 234, 255, 0.4);
  transform: translateY(-1px);
}

#fb-pagination button.page-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  text-shadow: none;
}

#fb-pagination button.page-btn {
  min-width: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.55);
  color: #00eaff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 0 0 8px #00eaff;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#fb-pagination button.page-btn:hover:not(:disabled) {
  background: rgba(0, 255, 255, 0.15);
  border-color: #00eaff;
  box-shadow: 0 0 10px rgba(0, 234, 255, 0.4);
  transform: translateY(-1px);
}

#fb-pagination button.page-btn.active,
#fb-pagination button.page-btn:disabled {
  background: rgba(255, 0, 230, 0.25);
  border-color: #ff00e6;
  color: #ff00e6;
  text-shadow: 0 0 8px #ff00e6;
  cursor: default;
  transform: none;
}

#fb-pagination .page-dots {
  color: #e0e0f0;
  font-size: 0.9rem;
  padding: 0 5px;
  opacity: 0.6;
}

@media (max-width: 600px) {
  table.fb-table th:nth-child(4),
  table.fb-table td:nth-child(4) {
    display: none; /* nasconde dimensione su schermi stretti */
  }
}
