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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: #161b22;
  border-right: 1px solid #30363d;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
}

.sidebar-header {
  padding: 28px 20px 24px;
  border-bottom: 1px solid #30363d;
}

.sidebar-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #58a6ff, #bc8cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: #8b949e;
  margin-top: 4px;
  font-size: 0.8rem;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: none;
  border: none;
  border-radius: 8px;
  color: #8b949e;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: #1c2129;
  color: #e1e4e8;
}

.nav-item.active {
  background: #58a6ff15;
  color: #58a6ff;
}

.nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #30363d;
  color: #484f58;
  font-size: 0.75rem;
}

/* Main content */
.content {
  flex: 1;
  margin-left: 240px;
  padding: 28px 32px;
  min-height: 100vh;
}

.search-bar {
  display: flex;
  gap: 12px;
  max-width: 700px;
}

#domainInput {
  flex: 1;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #e1e4e8;
  outline: none;
  transition: border-color 0.2s;
}

#domainInput:focus {
  border-color: #58a6ff;
}

.btn-toggle {
  padding: 12px 24px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #8b949e;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-toggle:hover {
  border-color: #58a6ff;
  color: #e1e4e8;
}

.btn-toggle.active {
  background: linear-gradient(135deg, #58a6ff, #bc8cff);
  border-color: transparent;
  color: #fff;
}

/* Loading */
.loading {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8b949e;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #30363d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Results */
.results {
  margin-top: 24px;
  max-width: 700px;
}

.result-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.result-card h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: #58a6ff;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #21262d;
  gap: 12px;
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  color: #8b949e;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.result-value {
  color: #e1e4e8;
  font-size: 0.9rem;
  text-align: right;
  word-break: break-all;
}

.result-section {
  color: #58a6ff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 0 4px;
  border-bottom: 1px solid #21262d;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-success {
  background: #23863620;
  color: #3fb950;
  border: 1px solid #23863640;
}

.badge-info {
  background: #58a6ff20;
  color: #58a6ff;
  border: 1px solid #58a6ff40;
}

.badge-warning {
  background: #d29a0020;
  color: #d29a00;
  border: 1px solid #d29a0040;
}

.badge-danger {
  background: #da363420;
  color: #f85149;
  border: 1px solid #da363440;
}

.error-msg {
  background: #da363415;
  border: 1px solid #da363440;
  border-radius: 12px;
  padding: 16px 20px;
  color: #f85149;
  margin-top: 24px;
  max-width: 700px;
}

/* DNS Templates */
.template-domain-row {
  display: flex;
  margin-bottom: 16px;
}

.template-header {
  display: flex;
  gap: 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid #30363d;
  margin-bottom: 8px;
  color: #8b949e;
  font-size: 0.8rem;
  font-weight: 600;
}

.tpl-col-type { width: 90px; }
.tpl-col-name { flex: 1; }
.tpl-col-value { flex: 2; }
.tpl-col-ttl { width: 70px; }
.tpl-col-del { width: 32px; }

.template-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.tpl-input {
  background: #0f1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.85rem;
  color: #e1e4e8;
  outline: none;
  transition: border-color 0.2s;
}

.tpl-input:focus {
  border-color: #58a6ff;
}

.tpl-type { width: 90px; }
.tpl-name { flex: 1; }
.tpl-value { flex: 2; }
.tpl-ttl { width: 70px; }

.tpl-delete {
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #f85149;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tpl-delete:hover {
  background: #da363420;
  border-color: #da3634;
}

.template-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  .sidebar-header h1,
  .subtitle,
  .sidebar-footer p {
    display: none;
  }
  .sidebar-header {
    padding: 16px 10px;
    text-align: center;
  }
  .sidebar-header::before {
    content: 'FC';
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #58a6ff, #bc8cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
    font-size: 0;
  }
  .nav-icon {
    font-size: 1.2rem;
  }
  .content {
    margin-left: 60px;
    padding: 20px 16px;
  }
  .search-bar {
    flex-direction: column;
  }
}
