* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --background: #f8fafc; /* Light background */
    --surface: #ffffff;    /* White cards */
    --surface-light: #f1f5f9; /* Light gray for copy button etc. */
    --text-primary: #1e293b; /* Dark text */
    --text-secondary: #475569; /* Medium-dark text */
    --text-muted: #64748b;   /* Muted text */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: #e2e8f0;      /* Light border */
    --shadow: rgba(0, 0, 0, 0.05); /* Softer shadow */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.header-content {
    /* Simplified header for a cleaner look */
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.logo svg {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

.tool-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background-color: var(--surface);
    padding: 0.75rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
}

.tool-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-grow: 1;
    justify-content: center;
}

.tool-nav-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    color: var(--text-muted);
    transition: color 0.2s ease-in-out;
}

.tool-nav-btn:hover {
    background-color: var(--surface-light);
    color: var(--text-primary);
}

.tool-nav-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.tool-nav-btn.active svg {
    color: white;
}

.tools-container {
    /* This is just a wrapper now */
}

.tool-card {
    display: none; /* Hide cards by default */
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    flex-direction: column;
}

.tool-card.active {
    display: flex; /* Show the active card */
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.tool-icon {
    /* This class is no longer used inside the card header */
}

.tool-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tool-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.input-group input,
.input-group textarea,
.input-group select {
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Courier New', monospace;
}

.input-group select {
    cursor: pointer;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.results {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
    animation: fadeIn 0.5s ease-out;
}

.results.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.result-value .value-text {
    word-break: break-all;
    flex-grow: 1;
}

.copy-btn {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

.result-value pre {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.map-link {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    text-decoration: none;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.map-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 4px solid var(--surface-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading::after {
    content: '...';
    animation: loading-text 1.5s steps(4, end) infinite;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.status-code-display {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}
.status-code-display.success-badge { color: var(--success); }
.status-code-display.warning-badge { color: var(--warning); }
.status-code-display.error-badge { color: var(--error); }

.success-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.2rem;
}

.warning-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.2rem;
}

.error-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.2rem;
}

.dns-record {
    padding: 0.5rem;
    background: var(--surface-light);
    border-radius: 4px;
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 100px);
    background: #2c3e50;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    pointer-events: none;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .tool-header h2 {
        font-size: 1.25rem;
    }
}
