/* Frag die NOZ Style - Bereinigt und Optimiert */

/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #00457c;
    --secondary-color: #0095db;
    --bg-color: #ffffff;
    --text-color: #333;
    --border-color: #dee2e6;
    --card-hover-color: rgba(0, 69, 124, 0.05);
    --vh: 1vh;

    /* Typography Scale */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;

    /* Line heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
}

/* ===== BASE STYLES ===== */
html {
    height: 100%;
}

/* Source Sans 3 – lokale Einbindung */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-200.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-300.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-500.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-600.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-700.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 800;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-800.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 900;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-900.woff2') format('woff2');
  font-display: swap;
}

/* Italic Varianten */
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 200;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-200italic.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 300;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-300italic.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 400;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-italic.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 500;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-500italic.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 600;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-600italic.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 700;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-700italic.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 800;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-800italic.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 900;
  src: url('../fonts/source-sans-3/source-sans-3-v19-latin-900italic.woff2') format('woff2');
  font-display: swap;
}

body {
  font-family: 'Source Sans 3', sans-serif;
    font-family: 'Source Sans Pro', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ededed;
    color: var(--text-color);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ===== IFRAME OPTIMIZATIONS ===== */
body.iframe-embedded {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

.iframe-embedded .mobile-header {
    height: 60px;
    padding: 0 12px;
}

.iframe-embedded .mobile-logo {
    height: 32px;
}

.iframe-embedded .mobile-title {
    font-size: 1.2rem;
}

.iframe-embedded .chat-input-area {
    padding: 0 0.75rem;
}

.iframe-embedded .chat-messages {
    padding-bottom: 10rem;
}

.iframe-embedded .fullscreen-main {
    min-height: 100vh;
    height: auto;
}

.iframe-embedded .example-question-button {
    min-height: 40px;
    padding: 6px 16px;
}

.iframe-embedded .message {
    padding: 16px 12px;
}

.iframe-embedded .message-bubble {
    padding: 10px 12px;
}

/* ===== LAYOUT COMPONENTS ===== */


/* Main Layout */
.fullscreen-main {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #ededed;
}

.unified-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    justify-content: flex-start;
    background-color: #FFFFFF;
    max-width: 1140px;
    margin: 0 auto;
    height: auto;
}

.chat-messages,
.message.assistant,
.typing-indicator {
    background-color: #FFFFFF;
    max-width: 1140px;
    margin: 0 auto;
}


/* ===== CHAT COMPONENTS ===== */

/* Chat Messages Area */
.chat-messages-area {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    background-color: transparent;
    position: relative;
    min-height: 0;
    width: 100%;
}

.chat-always-visible {
    display: flex !important;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    padding: 0;
    padding-bottom: 12rem;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    border-bottom: none !important;
    box-shadow: none;
    border-radius: 0;
}

/* Welcome Message und Beispielfragen auf 650px begrenzen und zentrieren */
.chat-messages .message:first-child,
.message.example-questions-message {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.chat-messages .message:first-child {
    padding-top: 4px;
}

.chat-messages .message.assistant:first-child {
    padding-top: 50px !important;
}

/* Chat Input Area */
.chat-input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0 1rem;
    background: linear-gradient(to top, white 50%, transparent 50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.chat-input-area.keyboard-open {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

.input-container {
    position: relative;
    display: flex;
    align-items: flex-start;
    width: 100%;
    margin: 0 auto;
    padding: 2px;
    background: #FFFFFF;
    border: 1px solid #00386C;
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition: all 0.2s ease;
    min-height: 6.25rem;
}

.input-container::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: calc(1.5rem - 2px);
    z-index: 1;
}

.input-container > * {
    position: relative;
    z-index: 2;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    padding: 1rem 1.5rem;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
    color: #2A2A2A;
    letter-spacing: 0;
    min-height: 48px;
    max-height: 208px;
    overflow-y: hidden;
}

.chat-input::placeholder {
    color: transparent; /* hide default placeholder */
}

/* Custom styled placeholder using pseudo-elements */
.chat-input::before {
    content: "Antworten aus allen ";
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
    color: #2A2A2A;
    pointer-events: none;
}

.chat-input::after {
    content: "noz-Artikeln: Stellen Sie Ihre Frage.";
    position: absolute;
    top: 1rem;
    left: calc(1.5rem + 155px);
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 16px;
    line-height: 20px;
    font-weight: 700;
    color: #00386C;
    pointer-events: none;
}

/* Hide pseudo-placeholder when user types or focuses */
.chat-input:focus::before,
.chat-input:focus::after,
.chat-input:not(:placeholder-shown)::before,
.chat-input:not(:placeholder-shown)::after {
    content: "";
}

/* Custom placeholder label styling */
.custom-placeholder {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 16px;
    line-height: 20px;
    color: #2A2A2A;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.custom-placeholder .highlight-noz {
    font-weight: 700;
    color: #00386C;
}

.chat-input:focus + .custom-placeholder,
.chat-input:not(:placeholder-shown) + .custom-placeholder {
    opacity: 0;
}

.send-button {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    background-color: #0088CC;
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.send-button:hover {
    background-color: #007bb5;
}

.send-button svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.chat-disclaimer {
    font-size: 12px;
    color: #666;
    text-align: center;
    padding: 10px 8px 22px;
    background-color: white;
    line-height: 1.3;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    display: block;
}

/* ===== INPUT HINT TEXT ===== */
.input-hint {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
    color: #2A2A2A;
    letter-spacing: 0;
}

.input-hint .highlight-noz {
    font-weight: 700;
    color: #00386C;
}

/* ===== MESSAGE COMPONENTS ===== */
.message {
    width: 100%;
    padding: 24px 16px;
    margin: 0 0 16px 0;
    border-bottom: none;
    position: relative;
    border-radius: 8px;
}

.message:last-child {
    border-bottom: none;
    margin-bottom: 16px;
}

.message.user {
    background-color: transparent;
    display: flex;
    justify-content: flex-end;
}

.message.assistant {
    background-color: white;
    border-bottom: none;
    margin-bottom: 0;
    padding-top: 50px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.message.user .message-content {
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 12px;
    max-width: 70%;
    margin-left: auto;
}

.message-content {
    max-width: 650px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    margin: 0;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 400;
    margin-top: 2px;
}

.message.user .message-avatar {
    background-color: var(--secondary-color);
    color: white;
}

.message.assistant .message-avatar {
    background-color: var(--primary-color);
    color: white;
}

.message-bubble {
    flex: 1;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: var(--font-size-base);
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 4px;
    text-align: left;
}

.message.user .message-bubble {
    background-color: #E5F3FA;
}

.message.user.example-questions-message {
    background-color: white !important;
    padding: 0;
}

.message.user.example-questions-message .message-bubble {
    background-color: white !important;
    padding: 0;
}

.message.assistant .message-bubble {
    background-color: transparent;
    padding: 12px 0;
}

/* ===== WELCOME TEXT STYLES ===== */
.welcome-text {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 18px;
    line-height: 24px;
    font-weight: 400;
    color: #2A2A2A;
    letter-spacing: 0;
    text-align: left;
    max-width: 650px;
    margin: 50px auto;
}

.welcome-text strong {
    font-weight: 700;
}

.welcome-text .highlight-archive {
    font-weight: 700;
    color: #00386C;
}

.highlight-blue {
    font-weight: 700;
    color: #00386C;
}


.message.user,
.message.system {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== EXAMPLE QUESTIONS ===== */
.example-questions-grid-dynamic {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  text-align: right;
  white-space: normal;
  max-width: 650px;
  margin: 0 auto;
}

.example-questions-grid-dynamic .example-question-button {
    width: auto;
    flex: 0 1 auto;
}

.example-questions-grid-dynamic .example-question-button {
  display: inline-block;
  width: auto;
  padding: 10px 10px;
  margin: 6px 8px 0 0;
  background-color: white;
  border: 1px solid #0088CC;
  border-radius: 8px;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 18px;
  color: #0088CC;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  min-height: 44px;
  font-family: 'Source Sans Pro', sans-serif;
  line-height: 1.3;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.example-questions-grid-dynamic .example-question-button:hover {
    background-color: transparent;
    border-color: #335F89;
    color: #335F89;
}

.example-questions-grid-dynamic .example-question-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 136, 204, 0.2);
}

.example-questions-grid-dynamic .example-question-button:disabled,
.example-questions-grid-dynamic .example-question-button.inactive {
    background-color: transparent;
    border-color: #CCD7E1;
    color: #CCD7E1;
    cursor: not-allowed;
}

/* ===== SOURCES COMPONENTS ===== */
.sources-section {
    margin-top: 0;
    background-color: #f9fafb;
    border-radius: 0;
    box-shadow: none;
    padding: 12px 0 16px 0;
    border-top: 1px solid #e5e7eb;
    position: relative;
}

.sources-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 16px;
}

.sources-icon {
    color: var(--primary-color);
    font-size: 16px;
}

.sources-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
}

.sources-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.source-card {
    width: 100%;
    background-color: white;
    border: none;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: none;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 149, 219, 0.1);
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}

.source-card:hover {
    background-color: #f8f8f8;
    box-shadow: none;
    transform: none;
}

.source-card:active {
    transform: none;
    box-shadow: none;
}

.source-card-content {
    flex: 1;
    text-align: left;
}

.source-card,
.source-card-title,
.source-card-teaser,
.source-card-meta {
    text-align: left;
}

.source-card-image-wrapper {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.source-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.source-card-title {
    font-size: var(--font-size-base);
    font-weight: normal;
    color: var(--primary-color);
    margin-bottom: 4px;
    line-height: 1.25;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.source-card-teaser {
    color: #666;
    font-size: var(--font-size-base);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.source-card-meta {
    margin-bottom: 4px;
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.source-card-favicon {
    height: 16px;
    width: auto;
    margin-right: 4px;
}

.source-card-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 28px;
    padding: 2px 0;
}

.source-card-link:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

/* Message Sources */
.message-sources-section {
    margin-top: 0.5rem;
    margin-left: 0;
    margin-right: 16px;
    background-color: transparent;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(224, 224, 224, 0.7);
    overflow: hidden;
    transition: all 0.3s ease;
    padding-top: 8px;
}

.sources-toggle {
    width: auto;
    font-size: 14px;
    padding: 0 12px;
}

.sources-content {
    padding: 0;
    transition: all 0.3s ease;
    background-color: white;
}

.message-sources-section .sources-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.message-sources-section .source-card {
    width: 100%;
    background-color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    box-shadow: none;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 149, 219, 0.1);
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-sources-section .source-card:hover {
    background-color: #f8f8f8;
    box-shadow: none;
    transform: none;
}

.message-sources-section .source-card:active {
    transform: none;
    box-shadow: none;
}

/* ===== FEEDBACK COMPONENTS ===== */
.message-feedback {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.feedback-buttons {
    display: flex;
    gap: 0.25rem;
}

.feedback-btn {
    background: none;
    border: none;
    border-radius: 4px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-size: 16px;
}

.feedback-btn.thumbs-up,
.feedback-btn.thumbs-down {
    width: 32px;
}

.feedback-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

.feedback-btn.active {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

.feedback-btn.thumbs-up.active {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.feedback-btn.thumbs-down.active {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* ===== LOADING INDICATOR ===== */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: left;
    padding: 12px 16px;
    background-color: #FFFFFF;
    border-radius: 12px;
    max-width: 650px;
    margin: 0 auto 16px 0;
    box-shadow: none;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c757d;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typingAnimation {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-text {
    margin-left: 0.5rem;
    font-size: var(--font-size-sm);
    color: #6c757d;
    font-style: italic;
}

/* ===== SEARCH COMPONENTS ===== */
.search-section {
    margin-bottom: 0;
}

.search-section .card {
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    background-color: transparent;
}

.feature-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: var(--font-size-xl);
    line-height: var(--line-height-tight);
}

.feature-description {
    color: #666;
    font-size: var(--font-size-md);
    line-height: var(--line-height-normal);
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    padding: 15px 20px;
    padding-right: 50px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-size: var(--font-size-base);
    width: 100%;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 149, 219, 0.15);
    outline: none;
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-button:hover {
    background-color: rgba(0, 149, 219, 0.1);
}

.search-icon {
    color: var(--secondary-color);
    font-size: var(--font-size-lg);
}

/* ===== RESULTS COMPONENTS ===== */
.results-container {
    margin-top: 30px;
}

.answer-title {
    color: var(--primary-color);
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 15px;
    line-height: var(--line-height-tight);
}

.answer-content {
    line-height: var(--line-height-relaxed);
    color: #333;
    font-size: var(--font-size-base);
}

.answer-content p {
    margin-bottom: 1rem;
}

.answer-content sup {
    font-size: var(--font-size-xs);
    color: var(--secondary-color);
    font-weight: 500;
}

.answer-content sup a.citation-link {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.answer-content sup a.citation-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.cited-text {
    cursor: pointer;
}

/* ===== CONVERSATION HISTORY ===== */
.conversation-turn {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.conversation-turn.latest-turn {
    border-bottom: 2px solid var(--primary-color);
}

.conversation-query {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 4px solid var(--secondary-color);
    border-radius: 4px;
}

.conversation-answer {
    margin-bottom: 10px;
}

.answer-content-turn {
    margin-top: 8px;
    padding-left: 15px;
}

.conversation-turn:last-child {
    margin-bottom: 0;
}

/* ===== SOURCE METADATA ===== */
.source-meta {
    margin: 5px 0 10px;
    font-size: var(--font-size-sm);
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.section-tag,
.date-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: rgba(0, 69, 124, 0.08);
}

.section-tag {
    color: var(--primary-color);
}

.date-tag {
    color: #555;
}

.sources-list {
    font-size: var(--font-size-sm);
}

/* ===== CITATION STYLES ===== */
.subheading {
    color: #00457c;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.citation {
    display: inline-block;
    background-color: #eef7fd;
    color: #00457c;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 3px;
    vertical-align: middle;
}

.citation-link {
    color: #0095db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    cursor: pointer;
}

.citation-link:hover {
    color: #007bb5;
    text-decoration: underline;
}

.citation-tooltip {
    position: absolute;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    max-width: 300px;
    z-index: 1000;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.citation-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.citation-tooltip-title {
    font-weight: normal;
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.3;
}

.citation-tooltip-description {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.citation-tooltip-meta {
    font-size: 11px;
    color: #888;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.citation-tooltip-meta span {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
}

.citation-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid white;
}

.citation-tooltip::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #e0e0e0;
}

.citation-tooltip.tooltip-below::before {
    top: auto;
    bottom: -6px;
    border-bottom: none;
    border-top: 6px solid white;
}

.citation-tooltip.tooltip-below::after {
    top: auto;
    bottom: -7px;
    border-bottom: none;
    border-top: 7px solid #e0e0e0;
}

/* ===== MARKDOWN FORMATTING ===== */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.message-bubble h1 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.message-bubble h2 {
    font-size: 1.3rem;
}

.message-bubble h3 {
    font-size: 1.2rem;
}

.message-bubble h4 {
    font-size: 1.1rem;
}

.message-bubble h5,
.message-bubble h6 {
    font-size: 1rem;
}

.message-bubble ul,
.message-bubble ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.message-bubble ul li,
.message-bubble ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.message-bubble ul {
    list-style-type: disc;
}

.message-bubble ol {
    list-style-type: decimal;
}

.message-bubble blockquote {
    border-left: 4px solid var(--secondary-color);
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background-color: rgba(0, 149, 219, 0.05);
    font-style: italic;
    color: #555;
}

.message-bubble code {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 0.2rem 0.4rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #d63384;
}

.message-bubble pre {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.message-bubble pre code {
    background-color: transparent;
    border: none;
    padding: 0;
    color: #333;
    font-size: 0.9rem;
}

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

.message-bubble em,
.message-bubble i {
    font-style: italic;
}

.message-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.message-bubble table th,
.message-bubble table td {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: left;
}

.message-bubble table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--primary-color);
}

.message-bubble table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ===== FORM VALIDATION ===== */
.text-error {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.character-counter {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 4px;
    transition: color 0.2s ease;
}

.character-counter.error {
    color: #dc3545;
    font-weight: 600;
}

.warning-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
    font-weight: 500;
}

.warning-message.show {
    display: block;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

/* ===== DRAG AND DROP ===== */
.sortable-list {
    position: relative;
}

.sortable-item {
    transition: all 0.2s ease;
    cursor: move;
    position: relative;
}

.sortable-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.sortable-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.sortable-item.drag-over {
    border-top: 3px solid #007bff;
    margin-top: 3px;
}

.drag-handle {
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 100%;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: #007bff !important;
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-item:hover .drag-handle {
    color: #007bff !important;
}

.sortable-list.dragging-active {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.drop-zone {
    height: 3px;
    background-color: #007bff;
    margin: 2px 0;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.drop-zone.active {
    opacity: 1;
}

.sortable-item.moving {
    transition: transform 0.3s ease;
}

/* ===== FEEDBACK POPUP STYLES ===== */
.feedback-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.feedback-modal {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  width: calc(100% - 40px);
  max-width: 400px;
  margin: 0 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: fadeInScale 0.3s ease;
}

.feedback-modal h3 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.2rem;
}

.feedback-modal textarea {
  width: 100%;
  height: 80px;
  margin-top: 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  padding: 8px;
  font-family: 'Source Sans Pro', sans-serif;
  resize: none;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.feedback-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.feedback-actions .submit-feedback {
  background-color: #0088CC;
  color: #FFFFFF;
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 500;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.feedback-actions .submit-feedback:hover {
  background-color: #335F89;
}

.feedback-actions .submit-feedback:disabled {
  background-color: #CCD7E1;
  color: #FFFFFF;
  cursor: not-allowed;
}

.feedback-actions .cancel-feedback {
  background-color: #ccc;
  color: #333;
}

.feedback-actions .cancel-feedback:hover {
  background-color: #bbb;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Keyboard Support */
body.keyboard-active {
    overflow: hidden;
}

@supports not (font-size: clamp(10px, 2vw, 14px)) {
    .example-questions-grid-dynamic .example-question-button {
        font-size: 14px;
    }
}

@supports (height: 100dvh) {
    .fullscreen-main {
        height: 100dvh;
    }
}

/* ===== MEDIA QUERIES ===== */

/* Mobile First Approach */
@media (max-width: 768px) {
    body {
        padding-top: 0px;
    }

    .fullscreen-main {
        position: relative;
        top: 0;
        left: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 80px);
        background-color: white;
        padding-top: 0;
    }

    .unified-chat-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .chat-messages {
        padding-top: 0;
        padding-bottom: 13rem;
    }

    .chat-messages .message:first-child {
        padding-top: 8px;
    }

    .welcome-text {
        padding: 0 12px;
    }

    .header-section {
        display: none;
    }

    .chat-input-area {
        padding: 0 12px 20px 12px;
        bottom: env(keyboard-inset-height, 0px);
        transition: bottom 0.3s ease, transform 0.3s ease;
    }

    @supports not (bottom: env(keyboard-inset-height)) {
        .chat-input-area.keyboard-open {
            transition: transform 0.3s ease;
        }
    }

    body.keyboard-active .chat-messages {
        transition: padding-bottom 0.3s ease;
    }

    body.keyboard-active {
        position: fixed;
        width: 100%;
        height: 100vh;
        overflow: hidden;
    }

    .chat-input {
        padding: 0.75rem 1.25rem;
    }

    .send-button {
        right: 1.25rem;
        bottom: 0.75rem;
    }

    .drag-handle {
        width: 30px;
        font-size: 18px;
    }
    
    .sortable-item {
        padding: 15px 10px;
    }

    .citation-tooltip {
        max-width: 280px;
        font-size: 13px;
        padding: 10px;
    }
    
    .citation-tooltip-title {
        font-size: 14px;
    }
    
    .citation-tooltip-description {
        font-size: 12px;
    }

    .message-bubble h1 {
        font-size: 1.3rem;
    }
    
    .message-bubble h2 {
        font-size: 1.2rem;
    }
    
    .message-bubble h3 {
        font-size: 1.1rem;
    }
    
    .message-bubble ul,
    .message-bubble ol {
        padding-left: 1.2rem;
    }
    
    .message-bubble pre {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .message-bubble table {
        font-size: 0.8rem;
    }
    
    .message-bubble table th,
    .message-bubble table td {
        padding: 0.4rem;
    }

    /* Quality Banner Mobile Styles */
    .quality-banner {
        padding: 8px 12px;
    }

    .quality-banner-content {
        font-size: 14px;
        gap: 8px;
    }

    .lightning-icon {
        font-size: 16px;
    }

    .quality-banner-line {
        max-width: 90%;
    }

    /* Info Banner Mobile Styles */
    .info-banner-content {
        padding: 12px 16px;
        gap: 12px;
    }

    .info-banner-logo {
        width: 40px;
        height: 40px;
    }

    .banner-logo-image {
        width: 40px;
        height: 40px;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        padding: 3px;
        background-color: white;
    }

    .info-banner-title {
        font-size: 16px;
    }

    .info-banner-subtitle {
        font-size: 13px;
    }

    .chat-disclaimer {
        font-size: 12px !important;
    }

    .chat-disclaimer {
        padding: 10px 8px 0;
    }

    .custom-placeholder .placeholder-line-2 {
        display: block;
    }

    .example-questions-grid-dynamic .example-question-button {
        margin: 6px 12px 0 0;
    }

    @supports not (font-size: clamp(10px, 2vw, 14px)) {
        .example-questions-grid-dynamic .example-question-button {
            font-size: 12px;
        }
    }

    /* Einheitliche Schriftgröße für Mobile */
    body, p, li, .message-bubble, .welcome-text, .input-hint, 
    .sources-title, .source-card-title, .source-card-teaser, 
    .source-card-link, .answer-content, .feature-description, .feature-title {
        font-size: 16px !important;
        line-height: 1.5;
    }

    .example-question-button {
        font-size: 14px !important;
        font-weight: 500 !important;
    }
}

@media (max-width: 576px) {
    .header-title {
        font-size: 1.5rem;
    }

    .logo-image {
        height: 50px;
    }

    @supports not (font-size: clamp(10px, 2vw, 14px)) {
        .example-questions-grid-dynamic .example-question-button {
            font-size: 11px;
        }
    }
}

@media (max-width: 480px) {
    @supports not (font-size: clamp(10px, 2vw, 14px)) {
        .example-questions-grid-dynamic .example-question-button {
            font-size: 11px;
        }
    }
}

@media (max-width: 379px) {
    .example-questions-grid-dynamic .example-question-button {
        white-space: normal;
        text-align: left;
    }
}

@media (max-width: 360px) {
    @supports not (font-size: clamp(10px, 2vw, 14px)) {
        .example-questions-grid-dynamic .example-question-button {
            font-size: 10px;
        }
    }
}

/* Responsive Breakpoints for Input Container */
@media (min-width: 544px) {
    .input-container,
    .chat-disclaimer {
        max-width: 32rem;
    }

    .chat-disclaimer {
        display: block;
    }

    .example-questions-message .message-bubble {
        max-width: 32rem;
    }
}

@media (min-width: 640px) {
    .input-container,
    .chat-disclaimer {
        max-width: 40rem;
    }

    .example-questions-message .message-bubble {
        max-width: 40rem;
    }

    .sources-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .message-sources-section .sources-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Desktop Styles */
@media (min-width: 769px) {
    .header-section {
        display: flex;
    }
    
    .mobile-header {
        display: none;
    }
    
    .unified-chat-container {
        width: 1140px;
        height: 730px;
        margin: 0 auto;
        border-radius: 0;
        box-shadow: none;
    }
    
    .message.assistant,
    .message.user.example-questions-message,
    .chat-messages .message:first-child {
        padding-left: 0;
        padding-right: 0;
    }
    
    .chat-input-area {
        max-width: 1140px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* ===== Desktop Typography ===== */
    body, p, li, .welcome-text, .message-bubble {
        font-size: 18px;
        line-height: 24px;
    }

    li {
        margin-bottom: 4px;
    }
}

@media (min-width: 1024px) {
  .input-container {
    max-width: 650px;
    margin: 0 auto;
  }

  .example-questions-grid-dynamic {
  }

  .example-question-button {
    max-width: 100%;
  }

  .chat-disclaimer {
      max-width: 48rem;
  }

  .example-questions-message .message-bubble {
      max-width: 48rem;
  }

  .sources-grid {
      grid-template-columns: 1fr;
      gap: 16px;
      padding: 0;
  }

  .message-sources-section .sources-grid {
      grid-template-columns: 1fr;
      gap: 14px;
  }
}
