body.iframeBody .page-container {
    overflow: hidden !important;
    height: auto !important;
}

body.iframeBody .main-content-wrapper {
    height: auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
}
/* ===========================
   GLOBAL VARIABLES / THEMES
=========================== */
/* Google Fonts Import für Libre Franklin als News Gothic Alternative */
@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@400;600;700&display=swap');

@font-face {
    font-family: 'News Gothic';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Libre Franklin'), local('News Gothic'), local('News Gothic MT'), local('NewsGothic MT'), local('NewsGothicMT');
}

@font-face {
    font-family: 'News Gothic';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: local('Libre Franklin SemiBold'), local('Libre Franklin Bold'), local('News Gothic Bold'), local('News Gothic MT Bold'), local('NewsGothicMT-Bold'), local('News Gothic Demi');
}

:root {
    --primary-color: #005ca9;
    --secondary-color: #f8f9fa;
    --text-color: #333333;
    --light-gray: #e9ecef;
    --border-color: #dee2e6;
    --winterthur-red: #FF1900;
    --winterthur-light-red: #ffebee;
    --user-text-color: #444444;
    --bot-text-color: #222222;
    --background-color: #ffffff;
    
    /* Responsive Layout Variablen */
    --chat-bg-color: #f8f9fa;
    --dark-text: #666666;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s;
    
    /* Neue Clean Chat Design Variablen - ChatGPT Style */
    --bot-message-bg: #ffffff;
    --user-message-bg: #f7f7f8;
    --sources-bg: #f1f3f4;
    --subtle-border: #e3e3e3;
    --clean-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --send-btn-size: clamp(28px, 7vw, 32px);
    --input-right-padding: calc(var(--send-btn-size) + clamp(28px, 4vw, 40px));
}

/* ===========================
       BODY / BASE
=========================== */
html {
    width: 100vw;
    min-height: 100vh;
    position: relative;
    max-width: 100vw;
    overflow-x: hidden; /* Nur horizontales Scrollen verhindern */
    overflow-y: auto; /* Vertikales Scrollen erlauben */
}

html::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

:root,
:root * {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

:root::-webkit-scrollbar,
:root *::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

body {
    font-family: 'News Gothic', 'Libre Franklin', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Verhindert horizontales Scrollen */
    overflow-y: auto; /* Erlaubt vertikales Scrollen der ganzen Seite */
    position: relative;
    min-height: 100vh;
    width: 100vw;
    max-width: 100vw;
    -webkit-tap-highlight-color: transparent; /* Entfernt blaues Highlight auf Touch */
    -webkit-touch-callout: none; /* Verhindert Callout-Menü auf iOS */
}

body::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

/* iframe-resizer Kompatibilität */
body.iframeBody {
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    height: auto !important;
    min-height: 100%;
    position: static;
    display: block;
}

/* Initialer Zustand - kompakt beim Start und nach Reset */
body.iframeBody.chat-initial {
    min-height: 400px !important; /* Kompakte Höhe für initialen Zustand */
}

body.iframeBody.chat-initial .page-container {
    min-height: 400px !important;
}

/* Wenn in iframe: Page Container anpassen */
body.iframeBody .page-container {
    height: auto !important;
    min-height: 100%;
    overflow: hidden !important;
    position: static !important; /* darf wachsen, kein fixed im iframe */
    padding-bottom: clamp(12px, 1.6vh, 20px); /* Platz für Card-Rundung/Schatten */
}

body.iframeBody .main-content-wrapper {
    min-height: auto !important;
}

body.iframeBody #chatbox {
    overflow: hidden !important;
    height: auto !important;
    max-height: none !important;
    flex: 1 1 auto !important; /* wieder strecken, füllt den Raum korrekt */
}

/* Footer-Regeln entfernt - kompaktere iframe-Integration */

/* Mobile: Normales Scrollen erlaubt */
@media (max-width: 767px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
        min-height: 100vh;
        position: relative;
        width: 100vw;
    }
}

/* Desktop: Normales Scrollen erlaubt */
@media (min-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
        min-height: 100vh;
    }
}

@media (max-width: 767px) {
    body.iframeBody {
        position: static;
        height: auto;
    }
}

@media (min-width: 768px) {
    body.iframeBody {
        height: auto !important;
    }
}

/* Touch-Optimierung für alle interaktiven Elemente */
button, a, input, textarea, select {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* Verhindert Doppel-Tap-Zoom */
}

/* Page Container */
.page-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow: visible; /* Inhalt darf wachsen */
    max-width: 100vw;
    /* Keine padding hier - wird in children angewendet */
}

/* Mobile: Normales Scrollen erlaubt */
@media (max-width: 767px) {
    .page-container {
        overflow: visible;
        min-height: 100vh;
        position: relative;
        width: 100vw;
        max-width: 100vw;
    }
}

/* Desktop: Normales Scrollen erlaubt */
@media (min-width: 768px) {
    .page-container {
        min-height: 100vh;
        position: relative;
        overflow: visible;
    }
}

@media (max-width: 767px) {
    body.iframeBody .page-container {
        position: static;
        height: auto;
        min-height: 100%;
    }
}

@media (min-width: 768px) {
    body.iframeBody .page-container {
        height: auto;
        min-height: 100%;
    }
}

/* Main Wrapper */
.main-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: visible; /* Inhalt darf sichtbar sein */
    min-height: 100vh;
    max-width: 100vw;
}

/* Mobile: Main Content normal */
@media (max-width: 767px) {
    .main-content-wrapper {
        min-height: 100vh;
        flex: 1;
    }
}

/* ===========================
       RELOAD CONTAINER
=========================== */
.reload-container {
    position: fixed;
    top: clamp(6px, 1.5vh, 15px);
    right: clamp(8px, 2vw, 20px);
    z-index: 100;
    padding-top: env(safe-area-inset-top); /* Safe Area für iOS */
}

.reload-button {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(227, 0, 15, 0.2);
    border-radius: 50%;
    width: clamp(28px, 3.5vw, 40px);
    height: clamp(28px, 3.5vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.reload-button:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--winterthur-red);
    transform: scale(1.05);
}

.reload-button svg {
    fill: var(--winterthur-red);
    transition: transform 0.2s ease;
}

.reload-button:hover svg {
    transform: rotate(90deg);
}

/* ===========================
       CHATBOX
=========================== */
#chatbox {
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
    overflow: visible; /* Inhalt darf sichtbar sein */
    padding: clamp(20px, 3vh, 40px) clamp(15px, 3vw, 25px) clamp(15px, 2vh, 25px); /* Gleichmäßige Seitenabstände */
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Container über volle Breite */
    width: 100%;
    background-color: var(--background-color);
    max-width: 100vw;
    /* Platz für die fixierte Input-Leiste unten, damit Inhalte nicht verdeckt werden */
    padding-bottom: calc(clamp(15px, 2vh, 25px) + var(--send-btn-size) + 60px + env(safe-area-inset-bottom));
}

/* Chatbox: Welcome Message startet oben (Skyline sichtbar) */
#chatbox:has(.chat-messages-container .welcome-message:only-child) {
    justify-content: flex-start;
}

/* Zentrierter Container für alle Nachrichten */
.chat-messages-container {
    width: 100%;
    max-width: 800px; /* Gleiche Breite wie Input-Container */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(40px, 6vh, 60px) 0 clamp(15px, 2vh, 24px); /* Vertikale Abstände, horizontal übernimmt #chatbox */
    box-sizing: border-box;
    overflow: visible; /* Inhalt darf sichtbar sein */
}

/* Welcome Message: oben beginnen, kleiner Top-Abstand, nur eine Scroll-Achse */
.chat-messages-container:has(.welcome-message:only-child) {
    min-height: 100%;
    justify-content: flex-start;
    align-items: center;
    padding-top: clamp(12px, 2vh, 20px);
    padding-bottom: clamp(12px, 2vh, 24px);
}


.message-container.welcome-message {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    padding: 0; /* Kein extra Padding für bessere Zentrierung */
}

.message-container.welcome-message .message-content {
    max-width: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.message-container.welcome-message .message-bubble {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.message-container {
    display: flex;
    padding: 12px 0;
    margin: 0;
    width: 100%;
}

/* Animation entfernt für statisches ChatGPT-Design */

.bot-container .message-bubble {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 0 0; /* Kein extra Padding für Bot-Nachrichten */
}

.bot-container .message-bubble:hover {
    transform: none;
    box-shadow: none;
    border: none;
}

/* NEU: Schöneres Text-Styling für Bot-Antworten */
.bot-container .message-text {
    color: #1f1f1f;
    font-family: 'News Gothic', 'Libre Franklin', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: clamp(0.9rem, 1.3vw, 0.96rem);
    line-height: 1.6;
    letter-spacing: 0.01em;
    margin: 0;
}

.bot-container .message-text p {
    margin: 0 0 1.35em 0;
}

.bot-container .message-text h2,
.bot-container .message-text h3 {
    margin: 1.4em 0 0.65em;
    font-weight: 600;
    color: var(--bot-text-color);
    line-height: 1.35;
}

.bot-container .message-text h2 {
    font-size: clamp(1.1rem, 1.6vw, 1.21rem);
}

.bot-container .message-text h3 {
    font-size: clamp(1.045rem, 1.49vw, 1.155rem);
}

.bot-container .message-text h2:first-child,
.bot-container .message-text h3:first-child {
    margin-top: 0;
}

.bot-container .message-text ul,
.bot-container .message-text ol {
    margin: 1em 0 1.3em;
    padding-left: 1.5em;
    display: grid;
    row-gap: 0.5em;
    list-style-position: outside;
}

.bot-container .message-text h2 + ul,
.bot-container .message-text h2 + ol,
.bot-container .message-text h3 + ul,
.bot-container .message-text h3 + ol {
    margin-top: 0.45em;
}

.bot-container .message-text li {
    margin: 0;
}

.bot-container .message-text blockquote {
    margin: 1.25em 0;
    padding: 0.6em 1em;
    border-left: 3px solid #f7b8b0;
    border-left-color: rgba(255, 25, 0, 0.35);
    background: #fef6f5;
    background: rgba(255, 25, 0, 0.08);
    color: var(--bot-text-color);
    border-radius: 6px;
}

.message-text strong,
.message-text b {
    font-weight: 600 !important;
    color: var(--bot-text-color);
}

.message-text em,
.message-text i {
    color: #3c3f44;
}

.message-text code {
    font-family: 'Fira Code', monospace;
    background: #f2f4f8;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.92em;
}

.sources-list {
    margin: 1.2rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.sources-wrapper {
    margin-top: 1rem;
}

.sources-heading {
    margin: 0 0 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #5c5f66;
}

.sources-list li {
    background: #ffffff;
    border: 1px solid var(--subtle-border);
    border-radius: 9px;
    padding: 8px 12px;
    box-shadow: var(--clean-shadow);
    display: grid;
    row-gap: 3px;
}

.sources-list .source-header {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-weight: 600;
    color: var(--bot-text-color);
}

.sources-list .source-index {
    font-weight: 600;
    color: #9397a3;
    font-size: 0.78rem;
}

.sources-list a {
    color: var(--bot-text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.sources-list a:hover {
    text-decoration: underline;
}

.sources-list .source-title-no-link {
    color: var(--bot-text-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.sources-list .source-snippet {
    margin: 0;
    font-size: 0.78rem;
    color: #5c5f66;
    line-height: 1.35;
}

.user-container {
    display: flex;
    justify-content: flex-end; /* Benutzernachrichten rechts */
    width: 100%;
}

.user-container .message-bubble {
    background-color: #f7f7f8;
    border-radius: 20px;
    box-shadow: none;
    border: none;
    display: inline-block;
    padding: 10px 16px;
}

.user-container .message-bubble:hover {
    transform: none;
    box-shadow: none;
    border: none;
}

/* NEU: Schöneres Text-Styling für User-Nachrichten */
.user-container .message-text {
    color: #1a1a1a;
    font-weight: 400;
    line-height: 1.5; 
    font-size: 1rem;
    margin: 0;
}

.message-content {
    max-width: 70%; /* Schmaler wie bei ChatGPT */
    margin: 0;
}

.bot-container {
    display: flex;
    justify-content: flex-start; /* Bot-Nachrichten links */
    width: 100%;
}

.bot-container .message-content {
    text-align: left; /* Text linksbündig innerhalb der Box */
    max-width: 100%; /* Volle Breite bis zur rechten Kante */
}

.message-bubble {
    position: relative;
    overflow: visible;
    word-wrap: break-word;
}

/* Entfernt: Alte hover-Effekte für cleaneres Design */

/* ===========================
       INPUT AREA
=========================== */
.input-area {
    background-color: var(--background-color);
    padding: clamp(12px, 2vh, 20px) clamp(15px, 3vw, 25px) clamp(15px, 2vh, 25px); /* Dynamisches Padding ohne Footer */
    border-top: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    position: fixed; /* Fixiert am unteren Rand des Viewports */
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100; /* über dem Inhalt */
    flex-shrink: 0;
    overflow: visible;
    max-width: 100vw;
    /* iOS Safe Area für untere Leiste - dynamisch */
    padding-bottom: calc(clamp(15px, 2vh, 25px) + env(safe-area-inset-bottom));
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: clamp(8px, 1vw, 12px);
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--background-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden; /* Button/Text immer innerhalb der Kapsel */
    min-height: calc(var(--send-btn-size) + 12px);
}

.input-container:not(.single-line) {
    align-items: flex-end;
}

.input-placeholder {
    position: absolute;
    left: 20px; /* Container-Padding (10px) + Textarea-Padding (10px) */
    right: var(--input-right-padding);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #9aa0a6;
    line-height: var(--send-btn-size);
    white-space: nowrap;
    z-index: 2; /* über dem Textarea rendern */
    max-width: calc(100% - var(--input-right-padding) - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-container.has-text .input-placeholder {
    display: none;
}

/* Bei Fokus: Overlay-Placeholder sofort ausblenden */
.input-container:focus-within .input-placeholder {
    display: none;
}

.input-container.single-line #user-input::placeholder {
    color: transparent; /* Overlay übernimmt die Visualisierung */
}
.input-container:focus-within {
    transform: none;
    border-color: #a0a0a0;
    box-shadow: 0 3px 16px rgba(160, 160, 160, 0.15);
}

#user-input {
    width: 100%;
    padding: 0 var(--input-right-padding) 0 10px;
    border: none;
    border-radius: inherit;
    font-size: 1rem;
    resize: none;
    box-sizing: border-box;
    box-shadow: none;
    min-width: 0;
    font-family: 'News Gothic', 'Libre Franklin', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    min-height: var(--send-btn-size);
    height: auto;
    max-height: 150px;
    overflow-y: hidden;
    background-color: transparent !important;
    background-clip: padding-box;
    color: var(--text-color);
    transition: all 0.3s ease;
    line-height: var(--send-btn-size);
    /* Mobile-Optimierung */
    -webkit-appearance: none;
    appearance: none;
}

/* Optional: Placeholder nicht umbrechen lassen (rein visuell) */
.input-container:not(.single-line) #user-input {
    padding: 6px var(--input-right-padding) 6px 10px;
    min-height: calc(var(--send-btn-size) + 16px);
    line-height: 1.5;
}

#user-input::placeholder {
    white-space: nowrap;
    line-height: var(--send-btn-size);
}

/* iOS-spezifische Input-Fixes */
@supports (-webkit-touch-callout: none) {
    #user-input {
        font-size: 16px; /* Verhindert Zoom auf iOS beim Fokus */
    }
}

#user-input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}

#send-btn {
    position: static;
    background-color: #000;
    border: none;
    cursor: pointer;
    color: white;
    padding: 0;
    border-radius: 50%;
    width: var(--send-btn-size);
    height: var(--send-btn-size);
    display: grid;
    place-items: center;
    -webkit-tap-highlight-color: transparent;
    justify-self: end; /* an rechten Rand der Kapsel */
    align-self: center;
}

.input-container:not(.single-line) #send-btn {
    align-self: flex-end;
}

/* Send-Button jetzt dynamisch mit clamp() - keine festen Breakpoints mehr nötig */

#send-btn:hover {
    background-color: #333;
    transform: none;
}

#send-btn:active {
    transform: none;
}

#send-btn:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

.send-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
    transform: translateY(-1px);
}

#send-btn:hover .send-icon {
    transform: none;
}

/* ===========================
    BOT-TYPING & OTHERS
=========================== */
/* Bot-Typing Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Überschreibe message-bubble Styles für typing indicator */
.message-bubble.typing-indicator {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
}

.typing-dots {
    display: flex;
    align-items: center;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #999999;
    border-radius: 50%;
    margin-right: 5px;
    animation: typingAnimation 1.5s infinite ease-in-out;
    opacity: 0.8;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.6s;
    margin-right: 0;
}

@keyframes typingAnimation {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.3;
    }
}

/* ===========================
   RESPONSIVE DESIGN - MOBILE FIRST
=========================== */

/* Extra Small Devices (Smartphones < 480px) */
@media (max-width: 479px) {
    /* Mobile Anpassungen - Reload Button jetzt dynamisch mit clamp() */
    
    /* Nur Hamburger zeigen */
    #mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Titel komplett ausblenden auf sehr kleinen Screens */
    h1 {
        display: none !important;
    }
    
    /* Chat Anpassungen - jetzt dynamisch mit clamp() */
    
    .chat-messages-container {
        max-width: 100%; /* Volle Breite auf Mobile */
    }
    
    /* Mobile rechtsbündiges Layout */
    
    /* Message container Abstände durch padding definiert */
    
    /* Bubble padding durch spezifische Klassen definiert */
    
    .message-label {
        font-size: 0.75rem;
    }
    
    /* Input Anpassungen - jetzt dynamisch mit clamp() */
    
    /* User-Input jetzt dynamisch mit clamp() - keine festen Werte mehr */
    
    /* Send-Button jetzt dynamisch mit clamp() - keine festen Größen mehr */
    
    /* Footer entfernt */
    
    /* Touch-Optimierungen für Mobile */
    .message-actions {
        opacity: 1 !important; /* Immer sichtbar auf Mobile */
        pointer-events: auto !important;
    }
    
    .action-button {
        width: 40px;
        height: 40px;
    }
    
    /* Hover-Effekte deaktivieren auf Touch-Geräten */
    @media (hover: none) {
        .message-bubble:hover {
            transform: none !important;
            box-shadow: var(--card-shadow) !important;
        }
        
        .action-button:hover {
            background-color: var(--secondary-color) !important;
        }
        
        #send-btn:hover {
            background-color: #000 !important;
            transform: none !important;
        }
    }
}

/* Small Devices (Smartphones 480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    /* Tablet Anpassungen - Reload Button jetzt dynamisch mit clamp() */
    
    /* Nur Hamburger zeigen */
    #mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Titel ausblenden */
    h1 {
        display: none;
    }
    
    /* Chat Anpassungen - jetzt dynamisch mit clamp() */
    
    .chat-messages-container {
        max-width: 100%; /* Volle Breite auf Tablet */
    }
    
    /* Tablet rechtsbündiges Layout */
    

    

    
    /* Footer entfernt */
}

/* Medium Devices (Tablets 768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .message-content {
        max-width: 100%;
    }
    h1 {
        font-size: 1.8rem;
    }


    /* User-Input jetzt dynamisch mit clamp() - keine festen Werte mehr */
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* Original Media Query für Tablets und kleiner */
@media (max-width: 768px) {
    .message-content {
        max-width: 100%;
    }
    h1 {
        display: none;
    }


    /* User-Input jetzt dynamisch mit clamp() - keine festen Werte mehr */
}

/* Fix für Code-Blöcke in Bot-Nachrichten */
.message-text pre {
    font-family: 'Fira Code', monospace !important;
    background: #f2f4f8 !important;
    padding: 0.85em !important;
    margin: 0 0 1em !important;
    border-radius: 8px !important;
    white-space: pre-wrap !important;
    overflow: hidden !important;
}

.message-text pre code {
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
}

/* Links im Chat */
.message-text a {
    color: #c41400; /* Dezentes Winterthur-Rot - sofort als Link erkennbar */
    text-decoration: none;
    font-weight: 600;
    position: relative;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}
.message-text a:hover {
    color: var(--winterthur-red);
    transform: translateY(-1px);
}

/* Reduziere übermäßige Fettschrift in Markdown */
/* Diese Regel wurde nach oben verschoben und angepasst */

.message-text em, .message-text i {
    font-style: italic;
    font-weight: inherit; /* Erbt das normale Gewicht */
}
.message-text a::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--winterthur-red);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.message-text a:hover::before {
    transform: scaleX(1);
}

/* Link-Infobox */
/* Normale UL-Aufzählungen - einheitlicher Style */
ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 12px 0;
}
ul li {
    margin-bottom: 10px;
    line-height: 1.4;
    font-weight: normal;
    transition: transform 0.2s ease;
}
ul li:hover {
    transform: none;
}

/* Buttons wurden entfernt - Funktionen jetzt im Hamburger-Menü */

/* ===========================
       HAMBURGER MENU
=========================== */
#mobile-menu-toggle {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--winterthur-red);
    width: 48px;   /* 20% größer */
    height: 48px;  /* 20% größer */
    padding: 0;
    margin: 0; /* Keine zusätzlichen Margins */
    font-size: 29px; /* 20% größer */
    line-height: 1;
    border-radius: 50%;
    transition: all 0.3s ease;
    align-items: center; /* Icon im Kreis zentriert */
    justify-content: center;
    position: relative;
    top: -1px; /* fein anheben, damit Unterkante mit Logo/Skyline bündig ist */
}

#mobile-menu-toggle:hover {
    background-color: rgba(227, 0, 15, 0.1);
}

/* Mobile Slide-Out Menu */
#mobile-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Komplett außerhalb des Viewports */
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background-color: var(--background-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 1001;
    padding: 30px;
    padding-top: calc(30px + env(safe-area-inset-top));
    overflow: hidden;
    display: block; /* Standardmäßig verfügbar */
    visibility: visible; /* Standardmäßig sichtbar */
}

#mobile-menu.active {
    right: 0;
}

#mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: opacity 0.3s ease;
}

#mobile-menu-overlay.active {
    display: block;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--winterthur-red);
}

#mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 28px;
    color: var(--text-color);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

#mobile-menu-close:hover {
    color: var(--winterthur-red);
    background-color: transparent;
}

.mobile-menu-button {
    display: block;
    width: 100%;
    padding: 18px 0;
    margin-bottom: 5px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    text-align: left;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-color);
}

.mobile-menu-button:hover {
    color: var(--winterthur-red);
}

.mobile-menu-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: fill 0.2s ease;
}

/* Mobile-Menü auch auf Desktop anzeigen */
@media (min-width: 768px) {
    #mobile-menu-toggle {
        display: flex !important; /* Hamburger-Menü auch auf Desktop anzeigen */
    }
}







/* Pulse-Effekt für Sende-Button */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 92, 169, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 92, 169, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 92, 169, 0); }
}
#send-btn:not(:disabled):active {
    animation: pulse 0.5s;
}

/* ===========================
       MESSAGE ACTIONS
=========================== */
.message-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.message-container.bot-container:hover .message-actions,
.message-container.bot-container:focus-within .message-actions {
    opacity: 1;
    pointer-events: auto;
}

.action-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px; /* Größeres Padding für Touch */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    background-color: var(--secondary-color);
    width: 44px; /* Apple-empfohlene Mindestgröße */
    height: 44px;
    -webkit-tap-highlight-color: transparent; /* Entfernt blaues Highlight auf iOS */
}

.action-button svg {
    width: 20px;
    height: 20px;
    fill: var(--text-color);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.action-button:hover {
    background-color: var(--light-gray);
}

.action-button:hover svg {
    opacity: 1;
}

/* Jump animation for like/dislike buttons */
@keyframes button-jump {
    0% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
    60% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

.like-button:active, .dislike-button:active {
    animation: button-jump 0.4s ease;
}

/* Active state for feedback buttons */
.like-button.action-button-active, .dislike-button.action-button-active {
    background-color: var(--light-gray);
}

.like-button.action-button-active svg, .dislike-button.action-button-active svg {
    opacity: 1;
}

/* ===========================
       TOAST NOTIFICATIONS
=========================== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(50, 50, 50, 0.85);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast.copy-toast {
    background-color: rgba(46, 125, 50, 0.85);
}

.toast.feedback-toast {
    background-color: rgba(50, 50, 50, 0.85);
}
