@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Rajdhani:wght@500;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: radial-gradient(circle at center, #0c1326 0%, #02050a 100%);
    color: #00ff9d;
    margin: 0;
    padding: 20px;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#matrix-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0, 255, 157, 0.02) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0, 255, 157, 0.02) 1px, transparent 1px);
    background-size: 35px 35px;
    z-index: 1;
}

#scanlines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 255, 0, 0.06));
    background-size: 100% 4px, 6px 100%;
    z-index: 2;
    pointer-events: none;
}

#chat-container {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 780px;
    height: 85vh;
    background: rgba(10, 22, 43, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 255, 157, 0.3);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 255, 157, 0.15), inset 0 0 20px rgba(0, 255, 157, 0.05);
}

#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 157, 0.25);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.ki-status {
    display: flex;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(0, 255, 157, 0.7);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* --- OPTIMIERTE, DEUTLICH LESBARERE SYSTEM-UHR --- */
.live-clock {
    font-family: 'Orbitron', sans-serif;
    font-size: 15px; /* Etwas größer für bessere Lesbarkeit */
    font-weight: bold;
    color: #ffffff; /* Weiß für maximalen Kontrast zum dunklen Hintergrund */
    letter-spacing: 1.5px;
    background: rgba(4, 10, 22, 0.9); /* Deutlich dunklerer Hintergrund, damit die Schrift poppt */
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 157, 0.4); /* Kräftigerer Rahmen */
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.15);
}

.neon-time {
    color: #00ff9d; /* Stechendes Cyber-Grün für die Zeit */
    font-weight: 700;
    text-shadow: 0 0 12px rgba(0, 255, 157, 0.8), 0 0 20px rgba(0, 255, 157, 0.4); /* Fetterer Glow-Effekt */
}

/* --- BASICS AVATAR (STANDBY / GRÜN) --- */
.avatar-container {
    position: relative;
    width: 46px;
    height: 46px;
    margin-right: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px dashed #00ff9d;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(0, 255, 157, 0.6);
    animation: spinRing 10s linear infinite;
    transition: all 0.4s ease;
}

.avatar-core {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #00ff9d 0%, #008cff 100%);
    border-radius: 50%;
    box-shadow: 0 0 15px #00ff9d, 0 0 30px #008cff;
    animation: pulseGlow 2.5s ease-in-out infinite;
    transition: all 0.4s ease;
}

/* --- REAKTIONS-MODUS: NOVA SPRICHT (LILA / VIOLETT) --- */
.avatar-container.speaking .avatar-ring {
    border-color: #cc00ff;
    box-shadow: 0 0 15px rgba(204, 0, 255, 0.8);
    animation: spinRing 4s linear infinite;
}

.avatar-container.speaking .avatar-core {
    background: radial-gradient(circle, #ff00ea 0%, #7b00ff 100%);
    box-shadow: 0 0 20px #ff00ea, 0 0 35px #7b00ff;
}

@keyframes spinRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* --- CHAT VERLAUF --- */
#chat-box {
    flex: 1;
    overflow-y: auto;
    border: 1px solid rgba(0, 255, 157, 0.2);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(2, 7, 15, 0.6);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
}

#chat-box::-webkit-scrollbar { width: 6px; }
#chat-box::-webkit-scrollbar-track { background: transparent; }
#chat-box::-webkit-scrollbar-thumb { background: rgba(0, 255, 157, 0.3); border-radius: 3px; }

.message {
    font-size: 17px;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 14px;
    line-height: 1.5;
    max-width: 82%;
    animation: fadeIn 0.3s ease-out forwards;
}

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

.user-msg {
    background: rgba(0, 140, 255, 0.12);
    border: 1px solid rgba(0, 140, 255, 0.4);
    color: #8cd5ff;
    margin-left: auto;
    border-bottom-right-radius: 0;
    box-shadow: 0 0 15px rgba(0, 140, 255, 0.1);
}

.nova-msg {
    background: rgba(0, 255, 157, 0.06);
    border: 1px solid rgba(0, 255, 157, 0.35);
    color: #b3ffd9;
    margin-right: auto;
    border-bottom-left-radius: 0;
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.1);
}

.error-msg {
    background: rgba(255, 0, 85, 0.15);
    border: 1px solid #ff0055;
    color: #ff7ca3;
}

/* --- INPUT BEREICH --- */
.input-area {
    display: flex;
    gap: 12px;
}

input[type="text"] {
    flex: 1;
    padding: 16px;
    border: 1px solid rgba(0, 255, 157, 0.25);
    border-radius: 10px;
    background: rgba(4, 8, 18, 0.9);
    color: #fff;
    font-size: 17px;
    font-family: 'Rajdhani', sans-serif;
    outline: none;
    transition: all 0.3s;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.7);
}

input[type="text"]:focus {
    border-color: #00ff9d;
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.25), inset 0 0 5px rgba(0,0,0,0.5);
}

button {
    font-family: 'Orbitron', sans-serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
}

#send-btn {
    padding: 0 28px;
    background: #00ff9d;
    color: #02050a;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.4);
}

#send-btn:hover {
    background: #21ffb2;
    box-shadow: 0 0 25px rgba(0, 255, 157, 0.7);
    transform: translateY(-1px);
}

#mic-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 255, 157, 0.25);
    color: #00ff9d;
    font-size: 20px;
    padding: 0 18px;
}

#mic-btn:hover {
    background: rgba(0, 255, 157, 0.1);
    border-color: #00ff9d;
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.3);
}

#reset-btn {
    background: transparent;
    border: 1px solid rgba(255, 0, 85, 0.4);
    color: #ff0055;
    padding: 8px 16px;
    font-size: 11px;
    letter-spacing: 1px;
}

#reset-btn:hover {
    background: rgba(255, 0, 85, 0.15);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.5);
    border-color: #ff0055;
}