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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --accent: #00d4aa;
  --accent-dim: #00d4aa33;
  --text-primary: #e8e8ed;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --border: #2a2a3a;
  --error: #ff6b6b;
}

html, body {
  height: 100%;
}

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  background-image: 
    radial-gradient(ellipse at 50% 0%, var(--accent-dim) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  margin-bottom: 48px;
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}

#search-input {
  width: 100%;
  padding: 24px 72px 24px 28px;
  font-size: 1.25rem;
  font-family: inherit;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 16px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

#search-input::placeholder {
  color: var(--text-muted);
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim), 0 8px 32px rgba(0, 0, 0, 0.4);
}

#search-btn {
  position: absolute;
  right: 12px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: var(--bg-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

#search-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px var(--accent-dim);
}

#search-btn:active {
  transform: scale(0.98);
}

.history {
  margin-bottom: 24px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.history-clear:hover {
  color: var(--error);
  background: rgba(255, 107, 107, 0.1);
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.15s ease;
}

.history-item:hover {
  border-color: var(--accent);
}

.history-query {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 8px 12px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.history-query:hover {
  color: var(--accent);
}

.history-remove {
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.history-remove:hover {
  color: var(--error);
  background: rgba(255, 107, 107, 0.1);
}

.filters {
  margin-bottom: 24px;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filters-actions {
  display: flex;
  gap: 8px;
}

.filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.filter-item:hover {
  border-color: var(--text-muted);
}

.filter-item.checked {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.filter-item input {
  display: none;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-item.checked .filter-label {
  color: var(--accent);
}

.filter-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
}

.status {
  text-align: center;
  padding: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-height: 44px;
}

.status.error {
  color: var(--error);
}

.status.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid var(--accent-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.results {
  flex: 1;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.results-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.results-count span {
  color: var(--accent);
  font-weight: 500;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th,
.results-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.results-table th {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-tertiary);
  position: sticky;
  top: 0;
}

.results-table th:first-child {
  border-radius: 8px 0 0 0;
}

.results-table th:last-child {
  border-radius: 0 8px 0 0;
}

.results-table td {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.results-table tr:hover td {
  background: var(--bg-secondary);
}

.results-table .rrtype {
  font-weight: 500;
  color: var(--accent);
}

.results-table .rdata {
  word-break: break-all;
  max-width: 280px;
}

.results-table .rrname {
  word-break: break-all;
  max-width: 200px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.results-table .count {
  color: var(--text-muted);
  text-align: center;
}

.results-table .timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

@media (max-width: 640px) {
  h1 {
    font-size: 2.5rem;
  }

  #search-input {
    padding: 20px 64px 20px 20px;
    font-size: 1rem;
  }

  .results-table th,
  .results-table td {
    padding: 10px 8px;
    font-size: 0.75rem;
  }

  .results-table .rdata,
  .results-table .rrname {
    max-width: 120px;
  }
}
