@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&amp;family=JetBrains+Mono:wght@400;500;600&amp;display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1aa3a3;
  --primary-dark: #147a7a;
  --bg-gradient-from: #111827;
  --bg-gradient-via: #1e293b;
  --bg-gradient-to: #0f172a;
  --text-light: #f3f4f6;
  --text-gray: #d1d5db;
  --text-muted: #9ca3af;
  --border-primary: rgba(26, 163, 163, 0.3);
  --bg-panel: rgba(17, 24, 39, 0.7);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-from), var(--bg-gradient-via), var(--bg-gradient-to));
  min-height: 100vh;
  color: var(--text-light);
  position: relative;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navigation */
nav {
  border-bottom: 1px solid var(--border-primary);
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(8px);
}

nav .nav-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

nav a {
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  color: var(--text-gray);
}

nav a:hover {
  background: rgba(26, 163, 163, 0.1);
  color: var(--primary);
}

nav a.active {
  background: rgba(26, 163, 163, 0.2);
  color: var(--primary);
}

/* Header */
header {
  text-align: center;
  padding: 3rem 1rem;
}

h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.5rem;
  line-height: 1.8;
  color: var(--text-light);
  margin-bottom: 1rem;
}

header p {
  max-width: 42rem;
  margin: 0 auto;
  font-size: 1rem;
  color: var(--text-gray);
}

/* Main Content */
main {
  padding: 0 1rem 8rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
}

.panel {
  display: flex;
  flex-direction: column;
}

label {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-gray);
}

textarea,
.output-box {
  height: 16rem;
  width: 100%;
  resize: none;
  border-radius: 0.75rem;
  border: 2px solid var(--border-primary);
  background: var(--bg-panel);
  padding: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

textarea::placeholder {
  color: var(--text-muted);
}

textarea:focus {
  outline: none;
  border-color: rgba(26, 163, 163, 0.6);
  box-shadow: 0 0 0 3px rgba(26, 163, 163, 0.2);
}

.output-box {
  overflow: auto;
}

.output-placeholder {
  color: var(--text-muted);
}

/* Table Styles */
.table-container {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 2px solid var(--border-primary);
  background: var(--bg-panel);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: auto;
}

thead tr {
  border-bottom: 1px solid rgba(26, 163, 163, 0.2);
  background: rgba(31, 41, 55, 0.5);
}

th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
}

th:nth-child(1) { min-width: 100px; }
th:nth-child(2) { min-width: 130px; }
th:nth-child(3) { min-width: 180px; }
th:nth-child(4) { min-width: 180px; }
th:nth-child(5) { min-width: 160px; }

tbody tr {
  border-bottom: 1px solid rgba(26, 163, 163, 0.1);
  transition: all 0.2s;
}

tbody tr:hover {
  background: rgba(26, 163, 163, 0.05);
}

td {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: white;
  vertical-align: middle;
}

.color-preview {
  height: 2rem;
  width: 5rem;
  border-radius: 0.25rem;
  border: 1px solid #4b5563;
}

code {
  background: #1f2937;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--text-light);
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover {
  background: rgba(26, 163, 163, 0.1);
  color: var(--primary);
}

.copy-btn.copied {
  color: #10b981;
}

.code-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.code-cell code {
  flex-shrink: 0;
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
  backdrop-filter: blur(4px);
  padding: 1.5rem 1rem;
  text-align: center;
}

footer p {
  font-size: 0.875rem;
  color: var(--text-gray);
}

footer .highlight {
  color: var(--primary);
}

footer a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--primary-dark);
}

/* Responsive */
@media (min-width: 768px) {
  nav a {
    font-size: 1rem;
  }

  nav .nav-content {
    gap: 2rem;
  }

  h1 {
    font-size: 1.875rem;
  }

  header p {
    font-size: 1.125rem;
  }

  label {
    font-size: 1rem;
  }

  textarea,
  .output-box {
    height: 20rem;
    font-size: 1.125rem;
  }

  th,
  td {
    font-size: 1rem;
  }

  .color-preview {
    height: 2.5rem;
    width: 5rem;
  }

  footer p {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 2.25rem;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  textarea,
  .output-box {
    height: 24rem;
  }
}
