/* Globale Variablen */
:root {
    --swiss-red: #D52B1E;
    --swiss-red-glow: rgba(213, 43, 30, 0.6);
    --bg-dark: #0f1015;
    --text-light: #e0e0e0;
    --glass-bg: rgba(25, 26, 35, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Abstrakte leuchtende CH-Flagge im Hintergrund */
.bg-flag-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background-color: rgba(213, 43, 30, 0.15); 
    border-radius: 30%;
    filter: blur(100px);
    z-index: -1;
    animation: pulseGlow 8s infinite alternate ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-flag-glow::before, .bg-flag-glow::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.2);
}
.bg-flag-glow::before { width: 80px; height: 220px; }
.bg-flag-glow::after { width: 220px; height: 80px; }

@keyframes pulseGlow {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* Glasmorphismus Basis-Klasse */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

/* Header */
header {
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    border-bottom: 1px solid var(--glass-border);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1 span {
    color: var(--swiss-red);
    font-size: 1.8rem;
    text-shadow: 0 0 15px var(--swiss-red-glow);
}

.status-badge {
    font-size: 0.85rem;
    background: rgba(255,255,255,0.1);
    padding: 5px 12px;
    border-radius: 20px;
    color: #aaa;
}

/* App Layout */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
    z-index: 10;
}

/* Sidebar */
.sidebar {
    width: 320px;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar .subtitle {
    font-size: 0.85rem;
    color: #888;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-card h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #ccc;
    font-weight: 500;
}

.placeholder-chart {
    width: 100%;
    height: 120px;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02) 10px, transparent 10px, transparent 20px);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}

.text-green { color: #4ade80; }

/* Chat Container */
.chat-container {
    flex: 1;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

/* Scrollbar Styling für Darkmode */
.chat-messages::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.message {
    max-width: 75%;
    padding: 16px 20px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--swiss-red), #9e1c12);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(213, 43, 30, 0.3);
}

.message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

.message strong { color: #fff; }

/* Styles für das Nachdenken IN der Blase */
.thinking-box {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px dashed rgba(255, 255, 255, 0.2) !important;
    min-width: 250px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 600;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--swiss-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-label {
    font-size: 0.85rem;
    color: #e0e0e0;
    letter-spacing: 0.5px;
}

/* Neuer Thinking-Step Style (ohne pulsieren, mit Fade-Out) */
.thinking-step {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    line-height: 1.5;
    margin-top: 8px;
    transition: opacity 0.3s ease; /* Weiches Ausblenden am Ende */
}

/* Chat Input */
.chat-input {
    margin: 20px;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
}

.chat-input input {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
}

.chat-input input::placeholder { color: #666; }

.chat-input button {
    background-color: var(--swiss-red);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 0 15px var(--swiss-red-glow);
}

.chat-input button:hover {
    background-color: #f73626;
    transform: translateY(-1px);
}

.chat-input button:disabled {
    background-color: #444;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}