:root {
    /* --- Original Farbpalette --- */
    --accent: #5fb6e5;
    --accent-light: #8ed4f5;
    --bg-color: #357a46;
    --header-bg: rgba(30, 111, 165, 0.95); /* Leicht transparent für Glas-Effekt */
    --chat-bg: #154f7a;
    
    /* --- Neue Variablen für Modernität --- */
    --text-color: #f0f4f8;
    --text-muted: #dbe4eb;
    --accent-gradient: linear-gradient(135deg, #5fb6e5, #3a9bdc);
    
    /* Animationen (Smooth & Elastisch) */
    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Schatten */
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(95, 182, 229, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
    /* Sorgt für scharfe Schrift auf allen Geräten */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8; /* Verbesserte Lesbarkeit */
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Verhindert seitliches Scrollen bei Animationen */
}

/* ========================================= */
/* === HEADER & NAVIGATION === */
/* ========================================= */

header {
    background-color: var(--header-bg);
    color: var(--text-color);
    padding: 1rem 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px); /* Moderner Milchglas-Effekt */
    animation: slideDown 0.8s var(--ease-smooth);
}

header h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem); /* Skaliert automatisch zwischen Handy und PC */
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.8s var(--ease-elastic);
}

.logo {
    display: block;
    margin: 0 auto 1rem auto;
    width: 85px;
    height: auto;
    background-color: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.4s var(--ease-elastic);
}

.logo:hover {
    transform: scale(1.1) rotate(3deg);
}

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Wichtig für kleine Handy-Bildschirme */
    gap: 10px;
}

nav a {
    color: var(--text-muted);
    margin: 0 0.8rem;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background: var(--accent);
    left: 50%;
    transform: translateX(-50%);
    bottom: -4px;
    border-radius: 2px;
    transition: width 0.3s var(--ease-smooth);
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: #fff;
}

/* ========================================= */
/* === HAUPTINHALT & TYPOGRAFIE === */
/* ========================================= */

.container {
    width: 90%;
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 1rem;
    flex: 1;
    animation: fadeIn 1s ease forwards;
}

h1, h2, h3 {
    color: #fff;
    margin-bottom: 1.2rem;
    position: relative;
    line-height: 1.3;
}

h1::after, h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin-top: 10px;
    border-radius: 4px;
    animation: slideIn 1s var(--ease-elastic);
}

h2 { font-size: clamp(1.6rem, 4vw, 2rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.5rem); }

p {
    margin-bottom: 1.8rem;
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 70ch; /* Begrenzt Textbreite für angenehmes Lesen am PC */
    animation: fadeInText 0.8s ease forwards;
}

.contact-info {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info:hover {
    color: var(--accent-light);
}

/* ========================================= */
/* === BUTTONS & FORMULARE === */
/* ========================================= */

button {
    background-color: rgba(39, 51, 46, 0.9);
    color: var(--accent);
    border: 2px solid var(--accent);
    padding: 0.9rem 2.2rem;
    border-radius: 50px; /* Pill-Shape wirkt moderner */
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-elastic);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

button:hover {
    background-color: var(--accent);
    color: #1a2420;
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

input, textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid rgba(95, 182, 229, 0.3);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 16px; /* Verhindert Auto-Zoom auf iPhones */
    background-color: rgba(26, 36, 32, 0.6);
    color: #fff;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    border-color: var(--accent);
    background-color: rgba(26, 36, 32, 0.95);
    box-shadow: var(--shadow-glow);
    outline: none;
    transform: translateY(-2px);
}

/* ========================================= */
/* === GALERIE & MEDIEN === */
/* ========================================= */

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.gallery img {
    width: 100%;
    max-width: 320px;
    height: 220px; /* Einheitliche Höhe */
    object-fit: cover; /* Bilder werden nicht verzerrt */
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.4s var(--ease-elastic), box-shadow 0.4s ease;
    animation: fadeInUp 1s ease forwards;
}

.gallery img:hover {
    transform: scale(1.05) rotate(-1deg);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    z-index: 2;
}

iframe {
    border-radius: 16px;
    border: none;
    margin-top: 1rem;
    width: 100%;
    min-height: 400px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.4s ease;
}

iframe:hover {
    transform: scale(1.01);
}

/* ========================================= */
/* === CHAT SYSTEM (High-Tech Design) === */
/* ========================================= */

.chat-container {
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    height: 75vh;
    min-height: 500px;
    max-height: 800px;
    position: relative;
    background: rgba(21, 79, 122, 0.4);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Status Leiste oben im Chat */
.chat-container::before {
    content: 'KI Assistent • Online';
    display: block;
    padding: 12px 20px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    scroll-behavior: smooth;
}

.message {
    padding: 12px 18px;
    max-width: 80%;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: messagePop 0.5s var(--ease-elastic);
    word-wrap: break-word;
}

/* User Message (Rechts, Blau) */
.message.user {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: #0f1c16;
    /* Speech Bubble Form: Oben rund, unten rechts spitz */
    border-radius: 18px 18px 2px 18px;
    margin-left: 20%;
}

/* Bot Message (Links, Dunkel) */
.message.bot {
    align-self: flex-start;
    background-color: #3a4944;
    color: #e0e8f0;
    /* Speech Bubble Form: Oben rund, unten links spitz */
    border-radius: 18px 18px 18px 2px;
    margin-right: 20%;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Eingabebereich unten */
.chat-form {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: rgba(21, 35, 45, 0.95);
    border-top: 1px solid rgba(255,255,255,0.1);
    align-items: center;
}

.chat-form input {
    margin-bottom: 0;
    border-radius: 50px;
    background-color: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px 20px;
    color: #fff;
    flex: 1;
}

.chat-form input:focus {
    background-color: rgba(255,255,255,0.1);
    border-color: var(--accent);
    transform: none;
}

.chat-form button {
    border-radius: 12px; /* Quadratisch mit weichen Ecken (vorher 50% für Kreis) */
    width: 50px;       /* Breite */
    height: 50px;      /* Höhe gleich der Breite -> Quadrat */
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;    /* Verhindert Zusammenquetschen */
    background: var(--accent);
    color: #1a2420;
    border: none;
    font-size: 1.2rem; /* Größe des Icons/Textes */
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s var(--ease-elastic);
}

.chat-form button:hover {
    transform: translateY(-3px); /* Button hebt sich leicht an */
    background-color: var(--accent-light);
    box-shadow: 0 6px 15px rgba(95, 182, 229, 0.4);
}

/* Scrollbar im Chat */
.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-track { background: transparent; }
.chat-box::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.2); border-radius: 10px; }
.chat-box::-webkit-scrollbar-thumb:hover { background-color: var(--accent); }

/* ========================================= */
/* === FOOTER === */
/* ========================================= */

footer {
    background-color: #1e6fa5;
    color: #e0e8f0;
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
    margin-top: auto;
}

footer a {
    color: var(--accent-light);
    margin: 0 0.5rem;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover { color: #fff; }

/* ========================================= */
/* === KEYFRAME ANIMATIONEN === */
/* ========================================= */

@keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes fadeInUp { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes fadeInText { 0% { opacity: 0; transform: translateX(-15px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes slideDown { 0% { opacity: 0; transform: translateY(-100%); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { 0% { width: 0; } 100% { width: 60px; } }
@keyframes messagePop { 0% { opacity: 0; transform: scale(0.8) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

/* ========================================= */
/* === MOBILE OPTIMIERUNG (Media Queries) === */
/* ========================================= */

@media (max-width: 900px) {
    .container { width: 95%; }
}

@media (max-width: 600px) {
    header h1 { font-size: 1.8rem; }
    
    .logo { width: 70px; }
    
    nav a { margin: 0 0.4rem; font-size: 0.95rem; }
    
    .container { margin: 1.5rem auto; padding: 0 1rem; }
    
    /* Chat Anpassungen für kleine Screens */
    .chat-container {
        height: 70vh; /* Platz lassen für mobile Tastatur */
        border-radius: 16px;
    }
    
    .message {
        max-width: 88%;
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    .chat-form { padding: 10px; }
    
    .chat-form input {
        padding: 10px 15px;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    .chat-form button {
        width: 45px;
        height: 45px;
    }
    
    h1::after, h2::after { width: 45px; }
}
