:root {
  --primary: #0070f3;
  --primary-hover: #0051bb;
  --bg: #0a0a0a;
  --fg: #ededed;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent: #3291ff;
  --success: #0070f3;
  --error: #ff0000;
  --text-muted: #888;
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-border: rgba(255, 255, 255, 0.2);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

html[data-theme="light"] {
  --bg: #f6f7fb;
  --fg: #0c0d10;
  --card-bg: rgba(0, 0, 0, 0.02);
  --card-border: rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(0, 0, 0, 0.04);
  --glass-border: rgba(0, 0, 0, 0.12);
  --text-muted: #5a5f6b;
  --input-bg: rgba(0, 0, 0, 0.04);
  --input-border: rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.theme-toggle {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--fg);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, #fff, #888);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.lang-selector select {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  backdrop-filter: blur(5px);
  outline: none;
  transition: all 0.2s ease;
}

.lang-selector select:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.lang-selector select option {
  background: #1a1a1a;
  color: white;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
}

.nav-links a:hover {
  color: #fff;
}

main {
  padding: 4rem 0;
}

.hero {
  text-align: center;
  margin-bottom: 4rem;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  letter-spacing: -2px;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.25rem;
}

.search-container {
  max-width: 600px;
  margin: 2rem auto;
}

.search-container form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-container form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.2);
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 200px;
  flex: 1;
}

.input-field label {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.subnet-form .input-field label {
  font-size: 0.95rem;
  font-weight: 700;
}

.subnet-form .input-field input {
  font-size: 1.05rem;
  padding: 0.6rem 1rem;
  border-width: 2px;
}

.search-container input,
.search-container select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--fg);
  padding: 0.5rem 0.9rem;
  outline: none;
}

.search-container input::placeholder {
  color: var(--text-muted);
}

.search-container select {
  min-height: 38px;
}

.search-container button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 38px;
}

.search-container button:hover {
  background: var(--primary-hover);
}

.search-container button:active {
  transform: scale(0.98);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.tool-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-card h3 {
  margin-bottom: 0.5rem;
}

.tool-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tool-help {
  margin-top: 0.5rem;
}

.tool-help p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.captcha-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
}

.captcha-block.full-width {
  grid-column: 1 / -1;
}

.captcha-image {
  width: 110px;
  height: 38px;
  object-fit: contain;
  border-radius: 6px;
  background: transparent;
}

.captcha-block input {
  flex: 1;
  min-width: 140px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--fg);
  padding: 0.45rem 0.75rem;
  outline: none;
}

.subnet-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 0.5rem;
}

.subnet-form input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--fg);
  padding: 0.6rem 1rem;
  outline: none;
}

.secondary-btn {
  background: transparent;
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.secondary-btn:hover {
  border-color: #fff;
  color: #fff;
}

.results-table .label-cell {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #888;
  width: 45%;
}

.results-table .value-cell {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
}

@media (max-width: 900px) {
  .subnet-form {
    grid-template-columns: 1fr;
  }

  .results-table .value-cell {
    text-align: left;
  }
}

footer {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
  border-top: 1px solid var(--card-border);
}

.glass-premium {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-radius: 24px;
  padding: 2.5rem;
}

.tech-info-section {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(0, 112, 243, 0.03);
  border-left: 4px solid var(--primary);
  border-radius: 4px 12px 12px 4px;
  font-size: 0.95rem;
}

.tech-info-section h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.result-card h1 {
  font-size: 2.5rem;
  letter-spacing: -1.5px;
  margin-bottom: 0.75rem;
  background: linear-gradient(to bottom right, #fff, #999);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-table-premium {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.result-table-premium tr:not(:last-child) td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-table-premium td {
  padding: 1.25rem;
}

.result-table-premium .label-cell {
  color: var(--text-muted);
  font-weight: 500;
  width: 35%;
}

.result-table-premium .value-cell {
  font-family: 'ui-monospace', 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', monospace;
  word-break: break-all;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-valid {
  background: rgba(0, 255, 0, 0.1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.status-warning {
  background: rgba(255, 165, 0, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.status-error {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.2);
}