/* Generali Versicherung & Investment - Styles */

:root {
    --generali-red: #b30000;
    --generali-red-light: #e60000;
    --generali-red-dark: #8c0000;
    --generali-white: #ffffff;
    --generali-grey: #f5f5f5;
    --generali-dark-grey: #333333;
}

body {
    font-family: 'Orbitron', sans-serif;
    background-color: var(--generali-white);
    color: var(--generali-dark-grey);
}

h1, h2, h3, h4, h5, h6, .brand-logo, .btn, .btn-large, .card-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
}

p, span, div, li, td, th, input, label, select {
    font-family: 'Orbitron', sans-serif;
    font-weight: 400;
}

.nav-wrapper {
    background-color: var(--generali-red);
}

.brand-logo {
    font-weight: 700;
    padding-left: 20px !important;
    text-transform: uppercase;
}

.tabs .tab a {
    color: var(--generali-red);
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
}

.tabs .tab a:hover, .tabs .tab a.active {
    color: var(--generali-red);
    background-color: rgba(179, 0, 0, 0.1);
}

.tabs .indicator {
    background-color: var(--generali-red);
    height: 3px;
}

.btn, .btn-large {
    background-color: var(--generali-red);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(179, 0, 0, 0.3);
}

.btn:hover, .btn-large:hover {
    background-color: var(--generali-red-light);
    box-shadow: 0 3px 8px rgba(179, 0, 0, 0.5);
}

.card {
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card .card-content {
    padding: 24px;
}

.card .card-title {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--generali-red);
}

.card .card-action {
    border-top: 1px solid rgba(179, 0, 0, 0.2);
    padding: 16px 24px;
}

.card .card-action a:not(.btn):not(.btn-large):not(.btn-small):not(.btn-large):not(.btn-floating) {
    color: var(--generali-red);
    text-transform: uppercase;
    font-weight: 600;
    transition: color 0.3s ease;
}

.card .card-action a:not(.btn):not(.btn-large):not(.btn-small):not(.btn-large):not(.btn-floating):hover {
    color: var(--generali-red-light);
}

.collection .collection-item.active {
    background-color: var(--generali-red);
    color: var(--generali-white);
}

.page-footer {
    background-color: var(--generali-red);
}

.product-card {
    height: 320px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.product-card .card-content {
    flex-grow: 1;
}

.dashboard-card {
    height: 100%;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin: 15px 0;
}

.feature-icon {
    font-size: 48px;
    color: var(--generali-red);
}

.input-field input:focus + label,
.input-field textarea:focus + label {
    color: var(--generali-red) !important;
}

.input-field input:focus,
.input-field textarea:focus {
    border-bottom: 2px solid var(--generali-red) !important;
    box-shadow: 0 1px 0 0 var(--generali-red) !important;
}

[type="radio"]:checked + span:after,
[type="radio"].with-gap:checked + span:before,
[type="radio"].with-gap:checked + span:after {
    border: 2px solid var(--generali-red);
}

[type="radio"]:checked + span:after,
[type="radio"].with-gap:checked + span:after {
    background-color: var(--generali-red);
}

[type="checkbox"]:checked + span:not(.lever):before {
    border-right: 2px solid var(--generali-red);
    border-bottom: 2px solid var(--generali-red);
}

.dropdown-content li > a, .dropdown-content li > span {
    color: var(--generali-red);
    font-family: 'Orbitron', sans-serif;
}

.progress {
    background-color: rgba(179, 0, 0, 0.2);
    height: 8px;
    border-radius: 4px;
}

.progress .determinate, .progress .indeterminate {
    background-color: var(--generali-red);
}

.preloader-wrapper .spinner-layer {
    border-color: var(--generali-red);
}

.section-title {
    font-weight: 700;
    color: var(--generali-red);
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 10px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--generali-red);
}

.risk-low {
    color: #4CAF50;
    font-weight: 700;
}

.risk-medium {
    color: #FF9800;
    font-weight: 700;
}

.risk-high {
    color: #F44336;
    font-weight: 700;
}

.alert-box {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.alert-success {
    background-color: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid #4CAF50;
}

.alert-warning {
    background-color: #FFF8E1;
    color: #F57F17;
    border-left: 4px solid #FFC107;
}

.alert-danger {
    background-color: #FFEBEE;
    color: #C62828;
    border-left: 4px solid #F44336;
}

.asset-allocation-container {
    height: 300px;
    width: 100%;
    margin: 15px 0;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 8px;
}

.search-results {
    position: absolute;
    z-index: 1000;
    background-color: white;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border-radius: 0 0 8px 8px;
}

.search-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-item:hover {
    background-color: #f5f5f5;
}

.highlight {
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0% { box-shadow: 0 0 0 0 rgba(179, 0, 0, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(179, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(179, 0, 0, 0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

.tooltip-custom {
    position: absolute;
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    padding: 12px;
    border-radius: 4px;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
}

.tool-card {
    border-left: 4px solid var(--generali-red);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.tool-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.tool-header i {
    font-size: 36px;
    color: var(--generali-red);
    margin-right: 15px;
}

.tool-header .card-title {
    margin: 0;
}

.stat-box {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
    transition: background-color 0.3s ease;
}

.stat-box:hover {
    background-color: #eeeeee;
}

.stat-box h5 {
    margin: 0;
    color: var(--generali-red);
    font-weight: 700;
}

.stat-box p {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
}

.tab-highlight {
    position: relative;
}

.tab-highlight:after {
    content: 'NEU';
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--generali-red);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.sidenav {
    background-color: #fafafa;
    width: 280px;
}

.sidenav li > a {
    font-family: 'Orbitron', sans-serif;
    color: var(--generali-dark-grey);
    font-weight: 500;
}

.sidenav li > a:hover {
    background-color: rgba(179, 0, 0, 0.1);
}

.sidenav li.active > a {
    background-color: rgba(179, 0, 0, 0.2);
    color: var(--generali-red);
    font-weight: 700;
}

.result-card {
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    animation: slideUp 0.5s ease-out;
}

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

.data-point {
    display: inline-block;
    background: rgba(179, 0, 0, 0.1);
    color: var(--generali-red);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    margin: 0 2px;
}

.tool-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    overflow-x: auto;
    padding: 5px 0;
}

.tool-nav-item {
    padding: 10px 20px;
    margin: 0 5px;
    background-color: #f5f5f5;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tool-nav-item:hover {
    background-color: rgba(179, 0, 0, 0.1);
}

.tool-nav-item.active {
    background-color: var(--generali-red);
    color: white;
}

@media only screen and (max-width: 992px) {
    .tool-nav {
        justify-content: flex-start;
    }
}

/* Modern Chat Interface */
.chat-container {
    background: transparent;
    display: flex;
    flex-direction: column;
    height: 700px;
    max-width: 900px;
    margin: 0 auto;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 12px;
    background: transparent;
    scroll-behavior: smooth;
}

.chat-message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

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

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--generali-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: #4a4a4a;
    margin-right: 0;
    margin-left: 12px;
    order: 2;
}

.message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.user-message .message-content {
    align-items: flex-end;
}

.message-bubble {
    background: white;
    padding: 14px 18px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
}

.user-message .message-bubble {
    background: var(--generali-red);
    color: white;
}

/* Markdown styling in bot messages */
.bot-message .message-bubble strong {
    font-weight: 700;
    color: var(--generali-red);
}

.bot-message .message-bubble em {
    font-style: italic;
    opacity: 0.9;
}

.bot-message .message-bubble ul {
    margin: 10px 0;
    padding-left: 0;
    list-style: none;
}

.bot-message .message-bubble li {
    margin: 6px 0;
    padding-left: 20px;
    position: relative;
}

.bot-message .message-bubble li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--generali-red);
    font-weight: bold;
    font-size: 18px;
}

.bot-message .message-bubble br {
    line-height: 1.8;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    padding: 0 8px;
}

.chat-input-area {
    background: transparent;
    padding: 16px 12px;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.chat-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    padding: 14px 20px;
    font-size: 15px;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.chat-input:focus {
    border-color: var(--generali-red);
    box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.1);
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--generali-red);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #900000;
    transform: scale(1.05);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn i {
    font-size: 24px;
}

.chat-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.chat-action-btn {
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
}

.chat-action-btn:hover {
    background: #f5f5f5;
    border-color: var(--generali-red);
    color: var(--generali-red);
}

.chat-action-btn i {
    font-size: 16px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

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

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Streaming cursor animation */
.streaming-cursor {
    display: inline-block;
    color: #b30000;
    font-weight: bold;
    animation: blink 0.8s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Chat Bubble Content Styling - Prevent Overflow */
.chat-bubble {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    overflow: hidden !important;
}

.chat-bubble h1,
.chat-bubble h2,
.chat-bubble h3,
.chat-bubble h4,
.chat-bubble h5,
.chat-bubble h6 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    overflow: hidden !important;
    max-width: 100% !important;
    font-size: 1.2rem !important;
    margin: 0.5rem 0 !important;
    line-height: 1.4 !important;
}

.chat-bubble h1 { font-size: 1.4rem !important; }
.chat-bubble h2 { font-size: 1.3rem !important; }
.chat-bubble h3 { font-size: 1.2rem !important; }

.chat-bubble a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important;
    max-width: 100% !important;
    display: inline !important;
}

.chat-bubble p,
.chat-bubble li,
.chat-bubble td,
.chat-bubble th {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
}

.chat-bubble table {
    width: 100% !important;
    table-layout: fixed !important;
    overflow-x: auto !important;
    display: block !important;
}

.chat-bubble td,
.chat-bubble th {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 150px !important;
}

@media only screen and (max-width: 600px) {
    .product-card {
        height: auto;
    }

    .brand-logo {
        font-size: 1.3rem !important;
        padding-left: 10px !important;
    }

    .chart-container {
        height: 250px;
    }

    .asset-allocation-container {
        height: 250px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .tool-header i {
        font-size: 28px;
    }

    .tool-card .card-title {
        font-size: 1.2rem;
    }
    
    .chat-container {
        height: 600px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-input-area {
        padding: 12px 16px;
    }
    
    /* AI-Support Chat Mobile Optimization */
    #chatMessages {
        height: 400px !important;
        max-height: 50vh !important;
        padding: 20px !important;
    }
    
    #scrollToBottomBtn {
        bottom: 80px !important;
        right: 20px !important;
        width: 40px !important;
        height: 40px !important;
    }
    
    #scrollToBottomBtn i {
        font-size: 20px !important;
        line-height: 40px !important;
    }
    
    /* Chat Bubble Mobile - Extra tight */
    .chat-bubble {
        max-width: 85% !important;
        padding: 12px 16px !important;
    }
    
    .chat-bubble h1,
    .chat-bubble h2,
    .chat-bubble h3 {
        font-size: 1.1rem !important;
    }
    
    .chat-bubble table {
        font-size: 0.85rem !important;
    }
    
    .chat-bubble td,
    .chat-bubble th {
        max-width: 100px !important;
        padding: 6px 8px !important;
    }
}

