/* ================================================
   GLOBAL VARIABLES & RESET
   ================================================ */
:root {
    /* Shared Gradients & Colors */
    --primary-gradient: linear-gradient(135deg, #164293 0%, #87047a 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Chat Specific Colors */
    --chat-bg: #f8f9fa;
    --user-bubble: linear-gradient(135deg, #164293 0%, #87047a 100%);
    --ai-bubble: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
}

/* ================================================
   PAGE LAYOUT (Header, Footer, Content)
   ================================================ */

/* Header Styles */
.O-Header {
    background: linear-gradient(135deg, #164293 0%, #87047a 100%);
    padding: 12px 0;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.O-Header__wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.O-Header__mainRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.O-Header__brandLogo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 80px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 20px;
    transition: opacity 0.3s ease;
}

.O-Header__brandLogo:hover {
    opacity: 0.8;
}

.O-Header__brandLogo svg {
    height: 40px;
    width: auto;
    fill: white;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
}

.page-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin: 40px 0 20px 0;
    color: #333;
}

/* Teaser Grid */
.teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* Card/Tile Styling - ETAS Design */
.tile {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    min-height: 240px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tile:hover {
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
    transform: translateY(-6px);
}

.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #164293 0%, #87047a 50%, #164293 100%);
}

.tile-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.tile-headline {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #164293;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tile-description {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #164293;
}

.tile-link {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #164293;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tile-link:hover {
    gap: 12px;
}

/* Search Block Specific Styling */
.search-block-wrapper {
    position: relative;
}

.search-block-wrapper::before {
    background: linear-gradient(90deg, #f5576c 0%, #f093fb 50%, #f5576c 100%);
}

.beta-label {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 4px 14px rgba(245, 87, 108, 0.35);
}

.search-container {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
}

.search-input-wrapper {
    position: relative;
    margin-top: 30px;
}

.search-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
    color: #333;
    background-color: #f9f9f9;
}

.search-input:focus {
    outline: none;
    border-color: #164293;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(22, 66, 147, 0.12);
}

.search-input::placeholder {
    color: #999;
}

.search-button {
    margin-top: 12px;
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-button:hover {
    box-shadow: 0 6px 20px rgba(22, 66, 147, 0.3);
    transform: translateY(-2px);
}

.search-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(22, 66, 147, 0.2);
}

/* Footer */
.O-Footer {
    background-color: #1a1a1a;
    color: #fff;
    padding: 40px 20px;
    margin-top: auto;
    flex-shrink: 0;
}

.O-Footer__content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 8px;
}

.footer-column ul li a {
    color: #ccc;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.footer-column ul li a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

/* Link Styling */
a.tile {
    cursor: pointer;
}

/* Additional Info Section */
.info-section {
    margin-top: 60px;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #164293;
}

.info-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #164293;
}

.info-section p {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(22, 66, 147, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 12px 24px;
    background: white;
    color: #164293;
    border: 2px solid #164293;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    box-shadow: 0 4px 12px rgba(22, 66, 147, 0.15);
}

/* ================================================
   SEARCH MODAL
   ================================================ */
#resultModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999; /* Höher als Chat Widget (1000) */
    justify-content: center;
    align-items: center;
}
#modalContent {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
#closeModal {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 24px;
    font-weight: bold;
    color: #444;
    background: none;
    border: none;
    cursor: pointer;
}
#resultsContainer div {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
#resultsContainer div:last-child {
    border-bottom: none;
}
#resultsContainer div > div:first-child {
    font-weight: 700;
    color: #164293;
}
#resultsContainer div > div:last-child {
    font-size: 12px;
    color: #666;
}

/* ================================================
   DOCUMENT CHATBOT STYLES
   ================================================ */

/* Floating Chat Button */
.chat-toggle-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 1000;
    animation: pulse 2s infinite;
}

.chat-toggle-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.chat-toggle-button:active {
    transform: scale(0.95);
}

/* Pulse animation for chat button */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.6);
    }
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 400px;
    max-width: calc(100vw - 50px);
    height: 600px;
    max-height: calc(100vh - 150px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Show chat widget when active */
.chat-widget.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Hide chat button when widget is open */
.chat-toggle-button.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
}

/* Chat Card */
.chat-card {
    border-radius: 20px;
    overflow: hidden;
    border: none;
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.chat-header {
    background: var(--primary-gradient);
    color: white;
    padding: 1.25rem;
    border: none;
    flex-shrink: 0;
}

.chat-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.774);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    backdrop-filter: blur(10px);
}

.chat-header h4 {
    font-size: 1.1rem;
}

.chat-header small {
    font-size: 0.8rem;
}

/* Close button in header */
.btn-close-chat {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-close-chat:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.btn-close-chat i {
    font-size: 0.9rem;
}

/* Chat Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--chat-bg);
    scroll-behavior: smooth;
}

/* Custom scrollbar for chat body */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 10px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Message Styles */
.message {
    display: flex;
    margin-bottom: 1rem;
    animation: messageSlideIn 0.3s ease-out;
}

.message.user {
    justify-content: flex-end;
}

.message.ai {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    position: relative;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
}

/* User message bubble */
.message.user .message-bubble {
    background: var(--user-bubble);
    color: white;
    border-bottom-right-radius: 4px;
}

/* AI message bubble */
.message.ai .message-bubble {
    background: var(--ai-bubble);
    color: #333;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* Timestamp styling */
.timestamp {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.3rem;
    display: block;
}

.message.user .timestamp {
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
}

.message.ai .timestamp {
    text-align: left;
    color: #666;
}

/* Footer Styles */
.chat-footer {
    background: white;
    padding: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.chat-input {
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    padding: 0.65rem 0.9rem;
    resize: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.chat-input:focus {
    border-color: #164293;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Send Button */
.btn-gradient {
    background: var(--primary-gradient);
    border: none;
    color: white;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #87047a 0%, #164293 100%);
}

.btn-gradient:active {
    transform: translateY(0);
}

.btn-send {
    min-width: 45px;
    height: 45px;
}

/* Loading Indicator */
.loading-indicator {
    display: none;
    align-items: center;
    color: #164293;
    font-size: 0.85rem;
}

.loading-indicator.active {
    display: flex;
}

/* Typing animation dots */
.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    background: #164293;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

/* Animations */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 90px;
        right: 15px;
        width: calc(100vw - 30px);
        height: 500px;
    }
    
    .chat-toggle-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .message-bubble {
        max-width: 85%;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .chat-widget {
        bottom: 80px;
        right: 10px;
        width: calc(100vw - 20px);
        height: 450px;
    }
    
    .chat-toggle-button {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .chat-body {
        padding: 1rem;
    }
    
    .chat-footer {
        padding: 0.8rem;
    }
    
    .message-bubble {
        max-width: 90%;
        padding: 0.65rem 0.85rem;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .chat-widget {
        height: calc(100vh - 100px);
    }
}