:root {
    --bg-color: #05070a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --primary-glow: #00f2ff;
    --secondary-glow: #7000ff;
    --cf: #f38020;
    --ng: #009639;
    --text-main: #f8fafc;
    --text-dim: #64748b;
    --border: rgba(255, 255, 255, 0.1);
    --input-bg: #0d1117;
    --shadow: 0 0 20px rgba(0, 242, 255, 0.1);
}

[data-theme="light"] {
    --bg-color: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #0f172a;
    --text-dim: #475569;
    --border: rgba(0, 0, 0, 0.1);
    --input-bg: #ffffff;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    -webkit-font-smoothing: antialiased;
}

.background-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 10%, #0c1222 0%, #05070a 100%);
    z-index: -1;
}

.wrapper {
    width: 90%;
    max-width: 450px;
    margin: 30px auto;
    padding: 0;
}

/* Nav Header Fix - Keeps Home and Toggle level above the box */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 10px;
}

.home-btn, .theme-toggle {
    cursor: pointer;
    color: var(--text-dim);
    transition: 0.3s;
    font-size: 1.1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.home-btn:hover, .theme-toggle:hover {
    color: var(--primary-glow);
    text-shadow: 0 0 10px var(--primary-glow);
}

.container {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid var(--border);
    position: relative;
    box-shadow: var(--shadow);
    backdrop-filter: blur(15px);
    transition: 0.3s ease;
}

h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 0 10px var(--primary-glow);
    display: flex;
    align-items: center;
    gap: 12px;
}

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 8px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: var(--text-dim);
    border-radius: 8px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn.active {
    color: var(--primary-glow);
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--primary-glow);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.form-group { margin-bottom: 18px; }
label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-glow);
}

input, select {
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: var(--input-bg);
    color: white; 
    font-size: 0.85rem;
    outline: none;
    transition: 0.3s;
    box-sizing: border-box;
    appearance: none;
}

select option {
    background-color: #0d1117;
    color: white;
}

input:focus, select:focus { 
    border-color: var(--primary-glow); 
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.15); 
}

.proxy-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: 0.3s;
    border: 1px solid var(--border);
}

.proxied-on { background: rgba(243, 128, 32, 0.15); color: var(--cf); border-color: var(--cf); }
.proxied-off { background: var(--input-bg); color: var(--text-dim); }

.btn-group { display: flex; gap: 8px; margin-top: 15px; }
.action-btn {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.75rem;
    transition: 0.2s;
    text-transform: uppercase;
}

.btn-cf { background: var(--cf); color: white; box-shadow: 0 4px 12px rgba(243, 128, 32, 0.25); }
.btn-ng { background: var(--ng); color: white; box-shadow: 0 4px 12px rgba(0, 150, 57, 0.25); }
.btn-clear { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-copy { background: #3b82f6; color: white; }
.btn-down { background: #8b5cf6; color: white; }

textarea {
    width: 100%;
    height: 220px;
    margin-top: 12px;
    background: #000;
    color: var(--primary-glow);
    border: 1px solid #1e1e1e;
    border-radius: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    padding: 12px;
    box-sizing: border-box;
    line-height: 1.4;
}

.fineprint {
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0.4;
    font-size: 0.6rem;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
    color: var(--text-main);
    text-transform: uppercase;
}

.logout {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.logout a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.75rem;
    font-family: 'Orbitron', sans-serif;
    padding: 8px 20px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    transition: 0.3s;
    width: fit-content;
}

.logout a:hover {
    color: #ff4444;
    border-color: #ff4444;
    background: rgba(239, 68, 68, 0.1);
    text-shadow: 0 0 8px #ff4444;
}

.pulse { animation: pulse-animation 2s infinite; }
@keyframes pulse-animation {
    0% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.5; transform: scale(1); }
}

@media (max-width: 480px) {
    .wrapper { width: 95%; }
    .btn-group { flex-direction: column; }
}