:root {
    /* DARK MODE (Default) */
    --bg-color: #0f1115;
    --card-bg: #161b22;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --terminal-bg: #0d1117;
    --terminal-text: #38bdf8; /* Ljusblå default */
    --border: #30363d;
    --shadow: rgba(0,0,0,0.5);
    
    /* Toggle Switch Colors */
    --switch-bg: #30363d;
    --switch-check: #3b82f6;
}

[data-theme="light"] {
    /* LIGHT MODE */
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --terminal-bg: #f8fafc;
    --terminal-text: #000000; /* Svart default */
    --border: #e2e8f0;
    --shadow: rgba(0,0,0,0.1);

    --switch-bg: #cbd5e1;
    --switch-check: #2563eb;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    overflow-x: hidden; /* Förhindra scroll om TLDs åker utanför */
    transition: background-color 0.3s, color 0.3s;
}

/* --- BACKGROUND ANIMATION --- */
.tld-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none; /* Klicka igenom */
}

.floating-tld {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    user-select: none;
    opacity: 0;
    animation: floatUp linear forwards;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; } /* Syns tydligt */
    90% { opacity: 0.6; }
    100% { transform: translateY(-10vh) rotate(20deg); opacity: 0; }
}

.container {
    width: 100%;
    max-width: 800px;
    position: relative;
    z-index: 1;
}

/* --- HEADER & SETTINGS --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--card-bg); /* En liten bakgrund för läsbarhet */
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px var(--shadow);
}

.header-content h1 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    margin: 0;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header-content p { margin: 5px 0 0; font-size: 0.8rem; color: var(--text-muted); }

.settings-panel {
    display: flex;
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toggle Switch CSS */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    margin-top: 5px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--switch-bg);
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
}
input:checked + .slider { background-color: var(--switch-check); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }


/* --- TABS --- */
.tabs-nav {
    display: flex;
    gap: 5px;
    padding: 0 10px;
    margin-bottom: -1px;
    z-index: 10;
    position: relative;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    color: var(--text-muted);
    padding: 12px 15px;
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    text-align: center;
    font-weight: 600;
}
.tab-btn:hover { background: rgba(125,125,125,0.1); color: var(--text-main); }
.tab-btn.active {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--card-bg);
    color: var(--accent);
    z-index: 20;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- CARD --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0 8px 8px 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px var(--shadow);
    min-height: 500px;
    position: relative;
    z-index: 5;
    transition: background-color 0.3s, border-color 0.3s;
}

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
h2 { margin: 0; font-size: 1.1rem; font-weight: 600; }

.input-group { display: flex; gap: 10px; margin-bottom: 15px; }
input, select {
    background: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 15px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    flex-grow: 1;
    font-size: 1rem;
    transition: background 0.3s, color 0.3s;
}
select { flex-grow: 0; width: 160px; }

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    font-size: 1rem;
}
button:hover { background: var(--accent-hover); }

/* --- COLOR PICKER --- */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}
.color-dots { display: flex; gap: 8px; }
.dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}
.dot:hover { transform: scale(1.2); }
.dot.active { border-color: var(--text-main); transform: scale(1.1); }

/* --- CONSOLE OUTPUT --- */
.console-output {
    background: var(--terminal-bg);
    color: var(--terminal-text); /* Denna ändras av färg-väljaren */
    font-family: 'JetBrains Mono', monospace;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--border);
    white-space: pre-wrap;
    font-size: 0.9rem;
    max-height: 500px;
    overflow-y: auto;
    transition: background-color 0.3s, color 0.3s;
}

.status-badge { font-size: 0.75rem; padding: 4px 10px; background: var(--border); border-radius: 4px; color: var(--text-muted); }
.dig-section-title { color: var(--text-main); font-weight: bold; margin-top: 15px; border-bottom: 1px solid var(--border); display: inline-block; }
.error-msg { color: #f87171; }
footer { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin-top: 20px; }