@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

:root {
    /* Modern color palette */
    --primary-bg: #faf9f7;
    --secondary-bg: #f5f3ef;
    --surface-bg: #ffffff;

    /* Text colors */
    --text-primary: #1a1a1a;
    --text-secondary: #5a5a5a;
    --text-muted: #8a8a8a;

    /* Accent colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-hover: #4f46e5;

    /* Message bubbles */
    --user-bubble-bg: #e8e5ff;
    --user-bubble-text: #1a1a1a;
    --ai-bubble-bg: #ffffff;
    --ai-bubble-border: #e5e5e5;

    /* Legacy support */
    --text-color: var(--text-primary);
    --primary-color: var(--accent-primary);
    --primary-hover: var(--accent-hover);
    --border-color: #e5e5e5;

    /* Semantic colors */
    --success-color: #10b981;
    --success-bg-color: #ecfdf5;
    --success-accent-color: #10b981;
    --info-color: #3b82f6;
    --info-bg-color: #eff6ff;
    --info-accent-color: #3b82f6;
    --error-color: #ef4444;
    --error-bg-color: #fef2f2;
    --error-accent-color: #ef4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* Dark theme variables */
[data-theme="dark"] {
    /* Modern color palette - dark mode */
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --surface-bg: #1e293b;

    /* Text colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Accent colors */
    --accent-primary: #818cf8;
    --accent-secondary: #a78bfa;
    --accent-hover: #6366f1;

    /* Message bubbles */
    --user-bubble-bg: #312e81;
    --user-bubble-text: #f1f5f9;
    --ai-bubble-bg: #1e293b;
    --ai-bubble-border: #334155;

    /* Legacy support */
    --text-color: var(--text-primary);
    --primary-color: var(--accent-primary);
    --primary-hover: var(--accent-hover);
    --border-color: #334155;

    /* Semantic colors */
    --success-color: #34d399;
    --success-bg-color: #064e3b;
    --success-accent-color: #10b981;
    --info-color: #60a5fa;
    --info-bg-color: #1e3a8a;
    --info-accent-color: #3b82f6;
    --error-color: #f87171;
    --error-bg-color: #7f1d1d;
    --error-accent-color: #ef4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--primary-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h2 {
    font-weight: bold;
}

.logo {
    margin: 30px;
}

.primary-color, a {
    color: var(--accent-primary);
}

a:hover {
    color: var(--accent-hover);
}

.animate-grow-down {
    animation: 0.5s ease-out 0s 1 GrowDown;
}

.animate-shrink-up {
    animation: 0.5s ease-out 0s 1 ShrinkUp;
}

.logo-small {
    width: 60px;
    height: 60px;
}

.logo-medium {
    width: 90px;
    height: 90px;
}

.logo-large {
    width: 150px;
    height: 150px;
}

.container {
    position: relative;
    justify-content: center;
    align-items: center;
    gap: 50px 50px;
    padding: 50px 50px 0px 50px;
}

.card {
    position: relative;
    width: 330px;
    height: 170px;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

    .card:hover {
        transform: translateY(-5px);
        transition: 0.5s;
        cursor: pointer;
    }

.card-body {
    align-content: center;
    text-align: center;
}

.card-title {
    margin-top: 25px;
}

.card-text {
    font-size: 12px;
}

.g-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 20px; /* Space between elements */
    justify-items: center;
}

.chat-question .chat-bubble {
    background-color: #dae9ff;
    border: none;
    align-self: end;
}

.chatResponses {
    display: flex;
    height: 55vh;
    overflow:auto;
    flex-wrap: nowrap;
}
.chat-unit > .col {
    margin: 10px 0;
    max-width: 75%;
    width: auto;

}

.chat-unit {
    display: flex;
    flex-direction: column;
}

    .chat-question {
        align-self: end;
    }

        .chat-question .feedback-row {
            display: none;
        }

.chat-bubble {
    border: solid 1px var(--border-color);
    border-radius: 0.5rem;
    padding: 15px;
}

.chat-bubble p {
    margin: 0px;
}

.chat-bubble pre {
    background-color: #e8e8e8;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid #000000;

}

.feedback-inputs label:hover {
    cursor: pointer;
}

.feedback-inputs label:hover > i {
    transition: 0.5s;
    color: var(--primary-color);
    font-weight: bold;
}

        .feedback-inputs label:hover > i.fa-thumbs-up {
            transform: translateY(-7px);
        }

        .feedback-inputs label:hover > i.fa-thumbs-down {
            transform: translateY(7px);
        }

.feedback-inputs input[type=checkbox] {
    -webkit-appearance: none;
    color: black;
}

    .feedback-inputs input[type=checkbox]:checked + i {
        color: var(--primary-color);
        font-weight: bold;
    }

.feedback-inputs label:hover input[type=checkbox]:checked + i {
    transition: 0.5s;
    font-weight: unset;
    color: unset;
}

.reaction-text {
    transition: 1s;
}

.innov-btn {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    font-style: normal;
    border: none;
    min-height: 55px;
    padding: 17px 20px;
    position: relative;
    text-align: center;
    text-decoration: none;
    transition: 0.4s;
    left: 13px;
}

    .innov-btn:before {
        bottom: 0;
        content: '';
        display: inline-block;
        left: -13px;
        position: absolute;
        top: 0;
        transition: 0.4s;
        -webkit-transition: 0.4s;
        width: 10px;
        background-color: var(--primary-color);
    }

.innov-btn:hover, .innov-btn:hover:before {
    background-color: var(--primary-hover);
}

.innov-input {
    background-color: rgba(68, 143, 255, 0.2);
    padding: 10px 12px;
    border: none;
    width: 100%
}

.button-clear-chat {
    height: 36px;
    width: 38px;
    padding: 14px;
    margin-left: 20px;
    border: none;
    background: url(../../Images/ClearHistory.png);
    background-size: auto;
}

.fadein-on-load {
    animation: 1s ease-out 0s 1 FadeInAnimation;
    opacity: 1;
}

.fadeout-on-click {
    opacity: 0;
    display: none;
}

.button-reference {
    background-color: transparent;
    color: var(--primary-color);
    opacity: .8;
    border: none;
    width: 70px;
    text-align: center;
    white-space: nowrap;
    margin-top: 10px;
}

.citation-card {
    position: relative;
    /*TODO: Can be adjusted once columns are fixed*/
    width: 500px;
    border-radius: 0px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
    margin-bottom: 20px;
}

.citation-card-body {
    align-content: center;
}

.citation-card-title {
    margin-top: 30px;
    float: left;
    margin-left: 30px;
}

.citation-card-text {
    font-size: 12px;
}

.citation-card img {
    max-width: 100% !important;
    height: auto !important;
}

.button-close-citations {
    background-color: transparent;
    border: none;
    width: 20px;
    text-align: center;
    margin-right: 30px;
    float: right;
    margin-top: 30px;
    font-size: 20px;
}

.citation-link-text {
    text-decoration-line: none;
    text-decoration: none;
    font-weight: bold;
    align-items: center;
}

/* Citation link buttons in chat messages */
.citation-link {
    display: inline;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    color: var(--accent-primary, #448fff);
    font-weight: 600;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.citation-link:hover {
    text-decoration: underline;
    color: var(--primary-hover, #2c6fd9);
}

.citation-link:active {
    opacity: 0.7;
}

.citation-arrow {
    text-decoration-line: none;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
    align-items: center;
}

.citation-arrow:hover * {
    color: var(--primary-color);
}

    .citation-arrow > div {
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

.clickable:hover, .clickable:hover * {
    cursor: pointer;
    color: var(--primary-color);
}

.my-accordian-body {
    padding: 0.25rem 1.25rem;
}

@keyframes GrowDown {
    0% {
        transform: scale(0.5) translate(0, -100%);
    }

    100% {
        transition: 0.1s;
        transform: none;
    }
}

@keyframes ShrinkUp {
    0% {
        transform: scale(2) translate(0, 50%);
    }

    100% {
        transition: 0.1s;
        transform: none;
    }
}

@keyframes FadeInAnimation {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes FadeOutAnimation {
    0% {
        opacity: 1;
    }
  
    100% {
        opacity: 0;
        display: none;
    }
}

.scrollarea {
    overflow-y: scroll;
    height: 65vh;
}

/* ===== Custom Dropdown (Global Styles for Portal) ===== */
.dropdown-menu-fixed {
    position: fixed;
    min-width: 240px;
    max-width: 500px;
    width: max-content;
    max-height: 280px;
    overflow-y: auto;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    padding: 6px;
    animation: dropdownFadeIn 150ms ease;
}

/* Small variant */
.dropdown-menu-fixed.small {
    min-width: 160px;
    max-width: 300px;
    max-height: 240px;
    padding: 4px;
    border-radius: 10px;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation for upward dropdowns */
.dropdown-menu-fixed.small {
    animation: dropdownFadeInUp 150ms ease;
}

@keyframes dropdownFadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu-fixed .dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 400;
    color: #1a1a1a;
    background-color: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 100ms ease;
    white-space: nowrap;
}

/* Small variant options */
.dropdown-menu-fixed.small .dropdown-option {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.dropdown-menu-fixed .dropdown-option:hover {
    background-color: #f5f3ef;
}

.dropdown-menu-fixed .dropdown-option.selected {
    background-color: #e8e5ff;
    color: #6366f1;
    font-weight: 500;
}

.dropdown-menu-fixed .check-icon {
    color: #6366f1;
    flex-shrink: 0;
}

.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: transparent;
}

.dropdown-menu-fixed::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu-fixed::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-menu-fixed::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

.dropdown-menu-fixed::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

/* Dark mode support for dropdowns */
[data-theme="dark"] .dropdown-menu-fixed {
    background-color: var(--surface-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-menu-fixed .dropdown-option {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-menu-fixed .dropdown-option:hover {
    background-color: var(--secondary-bg);
}

[data-theme="dark"] .dropdown-menu-fixed .dropdown-option.selected {
    background-color: #312e81;
    color: var(--accent-primary);
}

[data-theme="dark"] .dropdown-menu-fixed .check-icon {
    color: var(--accent-primary);
}

[data-theme="dark"] .dropdown-menu-fixed::-webkit-scrollbar-thumb {
    background-color: #475569;
}

[data-theme="dark"] .dropdown-menu-fixed::-webkit-scrollbar-thumb:hover {
    background-color: #64748b;
}

/* ===== C3.js Chart Dark Mode Support ===== */
/* Chart axis text (tick labels) */
[data-theme="dark"] .c3-axis text,
[data-theme="dark"] .c3-axis-x text,
[data-theme="dark"] .c3-axis-y text,
[data-theme="dark"] .c3-axis-x-label,
[data-theme="dark"] .c3-axis-y-label {
    fill: var(--text-primary) !important;
}

/* Chart legend text */
[data-theme="dark"] .c3-legend-item text {
    fill: var(--text-primary) !important;
}

/* Chart axis lines */
[data-theme="dark"] .c3-axis path,
[data-theme="dark"] .c3-axis line {
    stroke: var(--border-color) !important;
}

/* Chart grid lines */
[data-theme="dark"] .c3-grid line {
    stroke: var(--border-color) !important;
}

/* Chart tooltip */
[data-theme="dark"] .c3-tooltip {
    background-color: var(--surface-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .c3-tooltip th {
    background-color: var(--secondary-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .c3-tooltip td {
    background-color: var(--surface-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .c3-tooltip td.name {
    color: var(--text-primary) !important;
}

/* Pie chart labels */
[data-theme="dark"] .c3-chart-arc text {
    fill: var(--text-primary) !important;
}