:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f8fa;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --accent-primary: #2563eb;
  --accent-secondary: #6366f1;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --code-border: #1f2937;
  --notice-info-bg: #eef4ff;
  --notice-info-border: #c7d2fe;
  --notice-info-text: #1e3a8a;
}

[data-theme="dark"] {
  --bg-primary: #1f1f23;
  --bg-secondary: #2a2a2f;
  --text-primary: #ececec;
  --text-secondary: #a1a1aa;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --border-color: #374151;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --code-bg: #0b1324;
  --code-text: #d1d5db;
  --code-border: #293244;
  --notice-info-bg: #162036;
  --notice-info-border: #2a3a5f;
  --notice-info-text: #c7d2fe;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%); color: var(--text-primary); min-height: 100vh; }
.container { max-width: 1000px; margin: 0 auto; padding: 2rem; }

.theme-toggle { position: fixed; top: 1rem; right: 1rem; background: var(--bg-primary); border: 2px solid var(--border-color); border-radius: 50%; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow); }
.theme-toggle svg { width: 24px; height: 24px; color: var(--text-primary); }
[data-theme="light"] .moon-icon, [data-theme="dark"] .sun-icon { display: none; }

.tool-section { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 1rem; padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.section-subtitle { color: var(--text-secondary); margin-bottom: 1rem; }

.notice-banner { padding: 0.75rem 1rem; border: 1px solid var(--notice-info-border); border-radius: 0.5rem; background: var(--notice-info-bg); color: var(--notice-info-text); }
.notice-warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
[data-theme="dark"] .notice-warn { background: #451a03; border-color: #78350f; color: #fcd34d; }

.results-area { display: flex; flex-direction: column; gap: 1rem; }
.result-box { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 0.75rem; padding: 1rem; }
.result-box h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.result-box textarea, .result-box pre { width: 100%; min-height: 140px; padding: 0.75rem; background: var(--code-bg); color: var(--code-text); border: 1px solid var(--code-border); border-radius: 0.5rem; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace; white-space: pre-wrap; overflow-wrap: break-word; }

/* Form Elements */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.form-group input, .form-group select { width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 0.5rem; background: var(--bg-secondary); color: var(--text-primary); font-size: 1rem; }
.form-hint { display: block; font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.25rem; }

.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }

.primary-button { background: var(--accent-primary); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 600; cursor: pointer; transition: opacity 0.2s; }
.primary-button:hover { opacity: 0.9; }
.primary-button:disabled { opacity: 0.5; cursor: not-allowed; }

.secondary-button { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 600; cursor: pointer; }
.secondary-button:hover { background: var(--bg-secondary); }

.hidden { display: none !important; }

.log-box { margin-top: 1rem; max-height: 200px; overflow-y: auto; background: var(--bg-secondary); border: 1px solid var(--border-color); padding: 0.5rem; border-radius: 0.5rem; font-size: 0.85rem; font-family: monospace; }
.log-line { margin-bottom: 2px; }
.log-error { color: #ef4444; }
.log-success { color: #10b981; }
.log-warn { color: #f59e0b; }

/* DNS Record Styles */
.dns-record { background: var(--bg-secondary); padding: 1rem; border-radius: 0.5rem; border: 1px solid var(--border-color); }
.record-row { display: flex; flex-direction: column; margin-bottom: 0.75rem; gap: 0.25rem; }
.record-row:last-child { margin-bottom: 0; }
.record-row .label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.record-row code { font-family: 'Monaco', 'Menlo', monospace; background: var(--code-bg); color: var(--code-text); padding: 0.5rem; border-radius: 0.25rem; word-break: break-all; border: 1px solid var(--code-border); }

/* Copy Button Styles */
.code-group { display: flex; align-items: center; gap: 0.5rem; }
.code-group code { flex: 1; }
.copy-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.copy-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}
.copy-btn.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.download-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.download-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.result-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.button-group {
    display: flex;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .record-row { flex-direction: row; align-items: baseline; }
    .record-row .label { width: 60px; flex-shrink: 0; }
}
