:root {
    --primary: #0ea5e9;
    --accent: #f97316;
    --surface: #020617;
    --panel-bg: rgba(15, 23, 42, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Manrope', sans-serif;
    background: var(--surface);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.ui-shell {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 30px;
    pointer-events: none;
    /* Let clicks pass to 3D by default */
}

.ui-shell>* {
    pointer-events: auto;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dot {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary);
}

.pulse {
    animation: pulse 2s infinite;
}

h1 {
    font-family: 'Space Grotesk';
    font-size: 1.5rem;
    letter-spacing: -1px;
}

.badge {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Control Center */
.control-center {
    width: 360px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 20px;
}

h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.control-group {
    margin-bottom: 15px;
}

label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

textarea {
    width: 100%;
    height: 100px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    padding: 12px;
    resize: none;
    outline: none;
    font-family: inherit;
}

.pill {
    padding: 12px 20px;
    border-radius: 99px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.pill.primary {
    background: var(--primary);
    color: white;
}

.pill.full-width {
    width: 100%;
    margin-top: 10px;
}

/* Custom Switch */
.switch {
    width: 100%;
    height: 36px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.opt-left,
.opt-right {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    z-index: 2;
    font-weight: 600;
}

.handle {
    position: absolute;
    width: 50%;
    height: 30px;
    background: var(--primary);
    border-radius: 10px;
    left: 3px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#model-toggle:checked+.switch .handle {
    transform: translateX(calc(100% - 6px));
}

/* Chat */
.chat-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg {
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.msg.user {
    align-self: flex-end;
    background: var(--primary);
    border: none;
}

.msg.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
}

.msg.system {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    border: none;
}

.chat-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.chat-input input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    outline: none;
}

#send-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-btn:disabled {
    opacity: 0.3;
}

.usage-hint {
    margin-top: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

/* GDPR */
.gdpr-banner {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    border: 1px solid var(--primary);
    padding: 15px 25px;
    border-radius: 12px;
    z-index: 1000;
    display: flex;
    gap: 20px;
    align-items: center;
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}