:root {
    --primary-color: #64B587;
    --secondary-color: #4a9d71;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 10px 0;
    font-weight: 500;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    word-break: break-all;
}

form {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

input[type="text"],
textarea#domain {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    width: 100%;
    /* Ensure full width */
    box-sizing: border-box;
    /* Include padding in width */
    font-family: inherit;
    /* Inherit font */
}

textarea#domain {
    min-height: 48px;
    /* Match input height roughly */
    resize: none;
    /* Disable manual resize, we'll do it automatically */
    overflow-y: hidden;
    /* Hide scrollbar */
    line-height: 1.5;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

input[type="submit"],
.btn-dig {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    position: relative;
    z-index: 10;
    margin-top: 10px;
}

input[type="submit"]:hover,
.btn-dig:hover {
    background-color: var(--secondary-color);
}

input[type="submit"]:active,
.btn-dig:active {
    transform: scale(0.98);
}

.btn-dig:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.footer-links {
    margin-top: 40px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.footer-links p {
    margin-bottom: 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

/* Navigation Tabs */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.nav-link {
    padding: 10px 20px;
    border-radius: 20px;
    background: #e9ecef;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #dee2e6;
    text-decoration: none;
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* DNS Form */
.dns-form {
    display: contents;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.flex-grow {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.nameserver-group {
    margin-bottom: 0;
    height: fit-content !important;
    flex-grow: 0 !important;
    display: block !important;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.checkbox-grid label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* DNS Results */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.dns-output {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    min-height: 40px;
}

.dns-output.loading {
    color: #999;
    font-style: italic;
}

.record-line {
    margin-bottom: 4px;
    white-space: pre-wrap;
    /* Preserve whitespace but wrap */
    font-family: 'Monaco', 'Consolas', monospace;
    padding: 4px 0;
    word-break: break-all;
    max-width: 100%;
}

.error {
    color: #dc3545;
}

hr {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 30px 0;
}

/* DNS Layout */
.dns-layout {
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    gap: 30px;
    align-items: flex-start;
}

.dns-form-card {
    width: 100%;
    /* Full width */
    position: static;
    /* Remove sticky */
}

/* Removed duplicate container definition to avoid conflicts */

header {
    text-align: left;
    margin-bottom: 40px;
}

/* ... existing styles ... */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-toggle {
    font-size: 0.9rem;
}

.lang-toggle a {
    text-decoration: none;
    color: #666;
}

.lang-toggle a.active {
    font-weight: bold;
    color: #007bff;
}

h1 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.label-row label {
    margin-bottom: 0;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--secondary-color);
}

.results-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Gap between toggle and results */
    min-width: 0;
    /* Prevent flex item from overflowing */
    width: 100%;
    /* Ensure full width */
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 768px) {
    .dns-layout {
        flex-direction: column;
    }

    .dns-form-card {
        flex: auto;
        width: 100%;
        position: static;
        box-sizing: border-box;
    }
}

/* Toggle Switch */
.view-toggle-container {
    display: flex;
    justify-content: flex-start;
    /* Align left */
    margin-bottom: 10px;
}

.view-toggle {
    background: #e9ecef;
    border-radius: 20px;
    padding: 4px;
    display: flex;
    gap: 4px;
}

.view-toggle input[type="radio"] {
    display: none;
}

.view-toggle label {
    padding: 6px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-light);
    transition: all 0.2s;
    user-select: none;
}

.view-toggle input[type="radio"]:checked+label {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

/* Result Card Header */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.result-card h3 {
    margin: 0;
}

/* DNS Table */
.dns-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
}

.dns-table th,
.dns-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

/* Name Column (1st) */
.dns-table td:nth-child(1) {
    word-break: break-all;
    min-width: 150px;
}

/* TTL Column (2nd) */
.dns-table td:nth-child(2) {
    white-space: nowrap;
    width: 1%;
}

/* Type Column (3rd) */
.dns-table td:nth-child(3) {
    white-space: nowrap;
    width: 1%;
}

/* Data Column (4th) */
.dns-table td:nth-child(4) {
    word-break: break-all;
}

.dns-table th {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.dns-table tr:last-child td {
    border-bottom: none;
}

.dns-output {
    overflow-x: auto;
    /* Allow horizontal scroll */
}

.domain-group {
    margin-bottom: 25px;
}

.domain-group:last-child {
    margin-bottom: 0;
}

.domain-header {
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    color: var(--secondary-color);
    font-size: 1rem;
    font-weight: 600;
}