:root {
  --bg-color: #00111a;
  --text-color: #00ffff;
  --text-muted: #0088aa;
  --link-color: #00ffff;
  --link-hover: #ffffff;
  --border-color: #004455;
  --tooltip-bg: rgba(0, 17, 26, 0.95);
  --tooltip-border: #00ffff;
  --font-mono: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Blueprint Grid Background */
.blueprint-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(rgba(0, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(0, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
  z-index: -2;
  pointer-events: none;
}

/* Noise Overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(0, 10, 15, 0.8);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
}

header h1 {
  font-size: 24px;
  margin: 0 0 10px 0;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.header-text {
  margin-bottom: 20px;
}

.comment {
  color: var(--text-muted);
  margin: 2px 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 10px 0;
}

.table-header {
  display: flex;
  font-weight: bold;
  color: var(--text-muted);
  padding: 5px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.th-name { flex: 0 0 300px; }
.th-date { flex: 0 0 180px; }
.th-size { flex: 0 0 100px; }
.th-desc { flex: 1; }

.directory-list {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(0, 68, 85, 0.3);
}

.row:hover {
  background-color: rgba(0, 255, 255, 0.05);
}

.icon {
  flex: 0 0 24px;
  display: flex;
  align-items: center;
}

.icon img {
  width: 16px;
  height: 16px;
}

.row > a {
  flex: 0 0 276px;
  text-decoration: none;
  color: var(--link-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row > a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  background: rgba(0, 255, 255, 0.2);
}

.date {
  flex: 0 0 180px;
  color: var(--text-muted);
}

.size {
  flex: 0 0 100px;
  color: var(--text-muted);
}

.desc {
  flex: 1;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* File Content Sections */
.file-content {
  display: block;
  padding: 15px 15px 15px 40px;
  border-left: 1px solid var(--border-color);
  margin-left: 11px;
  background: rgba(0, 20, 30, 0.5);
  margin-bottom: 10px;
}

.file-content p {
  margin: 0 0 10px 0;
}

.file-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

.file-tree li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 4px;
}

.file-tree li::before {
  content: "├──";
  position: absolute;
  left: 0;
  color: var(--border-color);
}

.file-tree li:last-child::before {
  content: "└──";
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  background: rgba(0, 255, 255, 0.2);
}

/* Services Container */
.grid.services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  margin-top: 15px;
}

/* The JS will inject service cards here. Let's style them brutally. */
.service-card {
  border: 1px solid var(--border-color);
  padding: 10px;
  background: rgba(0, 10, 15, 0.8);
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}

.service-card:hover {
  border-color: var(--link-color);
  box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.1);
  text-decoration: none;
}

.service-card h3 {
  margin: 0 0 5px 0;
  font-size: 14px;
  color: var(--link-color);
  text-transform: uppercase;
}

.service-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* Tooltip */
.metadata-tooltip {
  display: none;
  position: absolute;
  background: var(--tooltip-bg);
  border: 1px solid var(--tooltip-border);
  padding: 10px;
  z-index: 1000;
  box-shadow: 4px 4px 0 rgba(0, 255, 255, 0.2);
  pointer-events: none;
  min-width: 200px;
  font-size: 12px;
}

.tooltip-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 5px;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--link-hover);
  letter-spacing: 1px;
}

.tooltip-body div {
  margin-bottom: 3px;
}

.tooltip-body .lbl {
  color: var(--text-muted);
  display: inline-block;
  width: 70px;
}

/* Details / Summary */
details {
  margin-top: 10px;
  border: 1px solid var(--border-color);
  padding: 5px;
}

summary {
  cursor: pointer;
  color: var(--link-color);
}

summary:hover {
  background: rgba(0, 255, 255, 0.1);
}

.crypto-content {
  margin-top: 10px;
  padding-left: 15px;
  border-left: 1px dashed var(--border-color);
}

.crypto-item {
  margin-bottom: 10px;
}

.crypto-name {
  display: inline-block;
  width: 50px;
  color: var(--text-muted);
}

.crypto-address {
  color: var(--link-hover);
  word-break: break-all;
}

address {
  font-style: normal;
  color: var(--text-muted);
  margin-top: 20px;
}

/* Link Grid */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 5px;
}

.link-grid li::before {
  content: "├─";
}

.link-grid li:nth-child(even)::before {
  content: "└─";
}

/* Guest Info */
.guest-credentials {
  background: rgba(0, 255, 255, 0.05);
  padding: 10px;
  border: 1px solid var(--border-color);
  margin: 10px 0;
}

.guest-credentials .label {
  color: var(--text-muted);
  display: inline-block;
  width: 50px;
}

.warp-trigger {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dashed;
}
