:root {
    --glow-1: rgba(59, 130, 246, 0.6);
    --glow-2: rgba(147, 51, 234, 0.6);
    --glow-3: rgba(236, 72, 153, 0.6);
    --bg-dark: #000000;
}

body {
    margin: 0;
    background-color: var(--bg-dark);
    color: white;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    overflow: hidden;
    height: 100vh;
    overscroll-behavior: none; 
    
    /* PWA Selection Control */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* --- Hintergrund Animation --- */
.aurora-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: var(--bg-dark);
    overflow: hidden;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    mix-blend-mode: screen;
    animation: floatBlob 20s infinite ease-in-out alternate;
    transition: background-color 3s ease-in-out; 
    will-change: transform, background-color;
}

.blob-1 { width: 80vw; height: 80vw; background: var(--glow-1); top: -20%; left: -20%; animation-duration: 25s; }
.blob-2 { width: 90vw; height: 90vw; background: var(--glow-2); bottom: -20%; right: -20%; animation-duration: 30s; animation-delay: -5s; }
.blob-3 { width: 60vw; height: 60vw; background: var(--glow-3); top: 40%; left: 20%; animation-duration: 22s; animation-delay: -10s; }

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(10%, 15%) scale(1.1) rotate(10deg); }
    100% { transform: translate(-5%, 5%) scale(0.9) rotate(-5deg); }
}

/* --- Loading Screen Orb --- */
.loading-orb {
    width: 80px; height: 80px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(255,255,255,0.1));
    box-shadow: 0 0 30px var(--glow-1), 0 0 60px var(--glow-2);
    filter: blur(1px); animation: pulseOrb 2s infinite ease-in-out;
}
@keyframes pulseOrb {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 50px var(--glow-1), 0 0 90px var(--glow-3); }
}

/* --- 3D Entrance Animation --- */
.animate-entrance {
    animation: entrance3D 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes entrance3D {
    0% { opacity: 0; transform: scale(0.9) perspective(1000px) rotateX(10deg) translateY(50px); filter: blur(20px); }
    100% { opacity: 1; transform: scale(1) perspective(1000px) rotateX(0deg) translateY(0); filter: blur(0); }
}

/* --- Glassmorphism --- */
.glass-panel {
    background: rgba(20, 20, 30, 0.3);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
@media (min-width: 768px) {
    .glass-panel { background: rgba(30, 30, 40, 0.5); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); border-radius: 1.5rem; }
}

/* --- Chat Bubbles --- */
.bubble {
    max-width: 85%; padding: 12px 18px; border-radius: 1.3rem;
    font-size: 0.95rem; line-height: 1.5; position: relative; word-wrap: break-word;
    margin-bottom: 8px; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0; transform: translateY(20px) scale(0.9);
    font-weight: 600;
}

.bubble-user {
    background: white; color: black; align-self: flex-end; border-bottom-right-radius: 0.3rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.bubble-ai {
    background: rgba(255, 255, 255, 0.1); color: #f3f4f6; align-self: flex-start;
    border-bottom-left-radius: 0.3rem; border: 1px solid rgba(255, 255, 255, 0.05);
}

@keyframes popIn { to { opacity: 1; transform: translateY(0) scale(1); } }

/* --- Typing Dots --- */
.typing-dot {
    display: inline-block; width: 5px; height: 5px; border-radius: 50%; 
    background-color: rgba(255,255,255,0.7); margin: 0 2px;
    animation: typing 1.4s infinite both;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 100% { transform: translateY(0); opacity: 0.5;} 50% { transform: translateY(-4px); opacity: 1;} }

/* --- Safe Area & Scrollbar --- */
.safe-area-bottom { 
    padding-bottom: env(safe-area-inset-bottom, 20px); 
}

/* PWA App Mode Fixes */
@media all and (display-mode: standalone) {
    body {
        /* Verhindert Pull-to-Refresh Effekt in der App */
        overscroll-behavior-y: none;
    }
}

.custom-scrollbar::-webkit-scrollbar, #chat-box::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-track, #chat-box::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb, #chat-box::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }

/* Text Selection erlaubt */
.bubble, #questionInput, .custom-scrollbar {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
}

/* UI nicht markierbar */
button, .aurora-bg, .glass-panel, img, svg {
    -webkit-user-select: none;
    user-select: none;
}