:root {
    --bg: #05070a;
    --glass: rgba(30, 41, 59, 0.7);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text: #f8fafc;
    --link: #94a3b8;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #05070a 100%);
    color: var(--text);
    margin: 0;
    display: flex;
    min-height: 100vh;
}

nav {
    width: 260px;
    background: var(--glass);
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    height: 100vh;
    padding: 30px 20px;
    position: fixed;
    z-index: 1000;
}

nav h1 {
    font-size: 1.6rem;
    font-weight: 900;
    background: linear-gradient(90deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
    text-transform: uppercase;
}

nav a {
    color: #94a3b8;
    text-decoration: none;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center; gap: 12px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
nav a.active { background: var(--accent); color: white; box-shadow: 0 4px 15px var(--accent-glow); }

main {
    margin-left: 260px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-grow {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 35px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

input[type="text"] {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px;
    border-radius: 12px;
    color: white;
    margin-bottom: 20px;
}

button {
    background: linear-gradient(135deg, var(--accent), #4338ca);
    color: white; border: none; padding: 16px; border-radius: 14px;
    font-weight: 700; cursor: pointer; width: 100%; transition: 0.3s;
}

button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 20px var(--accent-glow); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

#canvas-wrapper { margin-top: 20px; border-radius: 16px; overflow: hidden; display: none; border: 1px solid rgba(255, 255, 255, 0.1); }
canvas { width: 100%; display: block; background: #000; }

.switch-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #4b5563; transition: .3s; border-radius: 24px; cursor: pointer; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

.bar-bg { background: rgba(75, 85, 99, 0.3); height: 8px; border-radius: 10px; margin-top: 6px; overflow: hidden; }
.bar-fill { height: 100%; transition: width 0.4s ease-out; }

footer {
    width: 100%;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--link);
    flex-wrap: wrap;
    gap: 15px;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    transition: 0.2s;
    font-weight: 500;
}

footer a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--accent-glow);
}

.footer-right { text-align: right; line-height: 1.5; }

.error-msg {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: none;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

@media (max-width: 768px) {
    body { flex-direction: column; }
    nav { width: 100%; height: auto; position: relative; padding: 15px; border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
    nav h1 { margin-bottom: 15px; }
    nav a { display: inline-flex; margin-right: 5px; font-size: 0.7rem; padding: 8px 12px; }
    main { margin-left: 0; }
    footer { justify-content: center; text-align: center; padding: 20px; }
    .footer-right { text-align: center; }
}