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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  color: #333;
  background-color: #f4f6f8;
}

header {
  padding: 2rem 1rem;
  text-align: center;
}

header h1 {
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

header p {
  font-size: 1rem;
  color: #666;
}

#theme-toggle {
  position: fixed;
  top: 2px;
  right: 16px;
  margin-top: 1rem;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

main {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex: 1;
  gap: 1rem;
}

.input-section, .output-section {
  display: flex;
  flex: 1;
  flex-direction: column;
}

#input-area {
  padding: 1rem;
  flex: 1;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}

#decode-btn {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  align-self: flex-end;
  font-size: 1rem;
  color: white;
  background-color: #007bff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#decode-btn:hover {
  background-color: #006ae6;
}

#output-list {
  list-style: none;
  overflow-y: auto;
}

#output-list li {
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.output-link {
  flex: 1;
  color: #007bff;
  text-decoration: none;
  word-break: break-all;
}

.copy-btn {
  margin-left: 1rem;
  padding: 0.5rem;
  color: white;
  background: #28a745;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.copy-btn:hover {
  background: #218838;
}

/* Dark theme overrides */

body[data-theme="dark"] {
  background-color: #121212;
  color: #e0e0e0;
}

body[data-theme="dark"] header p {
  color: #bbb;
}

body[data-theme="dark"] #input-area {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
}

body[data-theme="dark"] #output-list li {
  background-color: #1e1e1e;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

body[data-theme="dark"] #decode-btn {
  background-color: #3a7afe;
}

body[data-theme="dark"] #decode-btn:hover {
  background-color: #316ccc;
}

body[data-theme="dark"] .copy-btn {
  background-color: #2ea049;
}

body[data-theme="dark"] .copy-btn:hover {
  background-color: #23823f;
}

body[data-theme="dark"] .output-link {
  color: #66aaff;
}
