/* =========================================================
   Datachat – style.css (consolidated)
   Includes: app layout (sidebar/content), dashboard embed,
   chat (25/75), markdown styling (accent rgb(255,95,0)),
   landing + centered container, value cards/grid, login page
========================================================= */

/* ===============================
   Variables
================================ */

:root {
    --bg-main: #121212;
    --bg-elevated: #1a1a1a;
    --bg-elevated-soft: #181818;

    /* glass variants */
    --bg-alpha-main: rgba(19,20,28,0.65);
    --bg-alpha-transparent: rgba(19,20,28,0);
    --bg-alpha-card: rgba(26,26,26,0.55);

    --border-subtle: #2a2a2a;

    --text-main: #ffffff;
    --text-muted: #b0b0b0;

    --accent: #FD7119;
    --accent-light: rgb(255, 150, 25);
    --accent-strong: rgb(255,95,0);
    --accent-hover: rgb(230,90,0);

    --font-ui: "Segoe UI", "Segoe UI Light", "Segoe UI Semibold", Arial, sans-serif;

    /* centered container */
    --container-max: 1280px;
    --container-pad: 20px;

    /* illustration sizing (landing value cards) */
    --value-illustration-height: 300px;
    --value-illustration-max-img: 300px;
}

/* ===============================
   Reset / Base
================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: var(--font-ui);
    font-weight: 400;
    background: var(--bg-main);
    color: var(--text-main);
}

body.dashboard-page {
    height: 100%;
    overflow: hidden;
}

/* links */
a {
    color: var(--accent);
    text-decoration: underline;
}
a:hover {
    color: var(--accent-hover);
}

/* typography */
h1, h2, h3 {
    font-weight: 400;
    margin: 0 0 10px 0;
}
p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}


.page-actions {
    display: flex;
    justify-content: flex-end;

    padding-left: 24px;
    padding-right: 24px;
    margin-bottom: 12px;
}

.page-actions .btn {
    height: 44px;
    margin-left: 20px;
    padding:  20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===============================
   Buttons
================================ */
.sidebarbtn{
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    

    font-size: 0.95rem;
    font-weight: 400;

    background: var(--accent-light);
    color: #fff;
    text-decoration: none;

    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;

    font-size: 0.95rem;
    font-weight: 600;

    background: var(--accent);
    color: #fff;
    text-decoration: none;

    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* ===============================
   Inputs (generic)
================================ */

input[type="text"],
input[type="password"],
textarea {
    font-family: inherit;
    font-size: 0.95rem;
}

/* ===============================
   Center container
================================ */

.center-container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
}

/* ===============================
   App layout (base.html)
================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-main);
}

/* sidebar */
.sidebar {
    width: 240px;
    padding: 16px;

    background: #141414;
    border-right: 1px solid var(--border-subtle);

    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0 14px;
}

.sidebar-logo img {
    width: 100%;
    display: block;
    object-fit: contain;
}

/* navigation */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;

    color: var(--text-main);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover {
    background: #232323;
    color: #ffffff;
}

.sidebar-nav a.active {
    background: var(--accent);
    color: #ffffff;
}

.disabled-link {
    opacity: 0.55;
    cursor: not-allowed;
}
.disabled-link:hover {
    background: transparent;
}

/* sidebar footer */
.sidebar-footer {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sidebar-footer strong {
    color: var(--text-main);
    font-weight: 600;
}

.logout-link {
    margin-top: 10px;
}

.logout-link a {
    color: var(--accent);
    text-decoration: none;
}
.logout-link a:hover {
    text-decoration: underline;
}

/* content */
.app-content {
    flex: 1;
    padding: 16px 24px;
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
    min-height: 0;

    background: var(--bg-elevated-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 18px;
}

body.dashboard-page .app-content {
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

body.dashboard-page .app-main {
    padding: 0;
    border-radius: 0;
    display: flex;
    height: 100%;
    overflow: hidden;
}

body.dashboard-page .app-layout {
    height: 100%;
}

body.dashboard-page .sidebar {
    height: 100%;
    overflow: hidden;
    padding: 12px;
}

body.dashboard-page .sidebar-logo img {
    max-height: 72px;
}

body.dashboard-page .sidebar-nav a {
    padding: 8px 10px;
}

body.dashboard-page .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 6px;
    margin-bottom: 8px;
}

body.dashboard-page .sidebar-footer {
    flex: 0 0 auto;
}

/* ===============================
   Generic box
================================ */

.box {
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0;
    overflow: auto;
    color: var(--text-main);
}

/* ===============================
   Dashboard / Power BI embed
================================ */

.dashboard-container {
    width: 100%;
    height: 100%;
    flex: 1;
    margin: 0 auto;
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0px;
    padding: 0px;
}

.dashboard-ratio-wrapper {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;

    display: block;
    background: #0e0e0e;

    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

#reportContainer {
    width: 100%;
    height: 100%;
}

#reportContainer iframe,
#reportContainer .powerbi-frame,
.dashboard-ratio-wrapper iframe,
.dashboard-ratio-wrapper .powerbi-frame {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

/* ===============================
   Chat page
================================ */

/* 25% input / 75% answer, no html wrapper required */
.app-main:has(.chat-input-panel):has(.chat-answer-panel):not(:has(.chat-top)) {
    display: grid;
    grid-template-columns: 0.25fr 0.75fr;
    gap: 18px;
    align-items: start;
}

.app-main:has(.chat-top) {
    display: block !important;
}

@media (max-width: 980px) {
    .app-main:has(.chat-input-panel):has(.chat-answer-panel) {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .chat-top {
        flex-direction: column;
    }
}

.chat-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.chat-left {
    flex: 1 1 380px;
}

.chat-right {
    flex: 1 1 520px;
    height: 400px;
    display: flex;
}

.chat-answer-full {
    width: 100%;
}

.chat-right .chat-answer-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-right .box {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* panels */
.chat-input-panel,
.chat-answer-panel {
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    min-height: 400px;
    padding: 16px 18px;
}

.chat-input-panel {
    max-height: 300px;
    overflow: auto;
}

.chat-input-panel h2,
.chat-answer-panel h2 {
    margin: 0 0 8px 0;
    font-weight: 600;
}

.chat-input-panel p {
    margin: 0 0 12px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* textarea */
.chat-textarea {
    width: 100%;
    min-height: 160px;

    border-radius: 12px;
    border: 1px solid #333;

    background: #0e0e0e;
    color: #f5f5f5;

    padding: 12px;
    resize: vertical;

    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(255, 85, 0, 0.35);
}

#askBtn {
    margin-top: 0px;
}

/* answer box */
#answerBox {
    min-height: 246px;
    background: rgba(0,0,0,0.18);
}

/* ===============================
   Markdown styling (answer)
================================ */

.markdown-answer {
    white-space: normal;
    line-height: 1.6;
}

/* Force emphasis + headings to accent-strong (rgb(255,95,0)) */
#answerBox.markdown-answer strong,
#answerBox.markdown-answer b,
#answerBox.markdown-answer h1,
#answerBox.markdown-answer h2,
#answerBox.markdown-answer h3,
#answerBox.markdown-answer h4,
#answerBox.markdown-answer thead th {
    color: var(--accent-strong) !important;
    font-weight: 700;
}

.markdown-answer p {
    margin: 0 0 0.7rem 0;
}

.markdown-answer ul,
.markdown-answer ol {
    margin: 0 0 0.7rem 1.4rem;
}

.markdown-answer li {
    margin: 0.2rem 0;
}

/* tables */
.markdown-answer table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8rem 0;
    font-size: 0.92rem;
}

.markdown-answer th,
.markdown-answer td {
    border: 1px solid var(--border-subtle);
    padding: 6px 8px;
    text-align: left;
}

.markdown-answer thead {
    background: rgba(255,255,255,0.04);
}

/* code */
.markdown-answer code {
    font-family: Consolas, "Fira Code", monospace;
    font-size: 0.9em;
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 6px;
}

.markdown-answer pre {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 12px 14px;
    overflow: auto;
}

.markdown-answer pre code {
    background: transparent;
    padding: 0;
}

/* ===============================
   Landing page (marketing)
================================ */

body.landing-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(0, 119, 255, 0.18), transparent 45%),
        linear-gradient(160deg, #0b0b0b, #141414);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

/* optional glass panel for landing content */
.landing-main {
    margin-top: 8px;
    padding: 24px;

    background: var(--bg-alpha-transparent);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
}

/* ===============================
   Landing container (centered)
================================ */

.landing-container {
    width: 100%;
    max-width: var(--container-max, 1280px);
    margin-left: auto;
    margin-right: auto;
    background: --bg-alpha-transparent;

    padding-left: var(--container-pad, 20px);
    padding-right: var(--container-pad, 20px);
}


/* landing sections */
.landing-section {
    margin-top: 14px;
    background: --bg-alpha-transparent;
}

.section-title {
    margin-bottom: 14px;
}

.hero-lead {
    margin: 0;
    color: #ffffff;
}

/* value cards grid */
.value-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    background: --bg-alpha-transparent;

    width: 100%;
    max-width: 1200px;
    margin: 16px auto 0;
}

@media (max-width: 960px) {
    .value-grid {
        grid-template-columns: 1fr;
    }
}

.value-card {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 14px;

    padding: 18px;
    border-radius: 14px;

    background: var(--bg-alpha-transparent);
    border: 1px solid rgba(255,255,255,0.08);

    text-align: center;
}

.value-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.value-illustration {
    min-height: var(--value-illustration-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.value-illustration img {
    max-width: 100%;
    max-height: var(--value-illustration-max-img);
    object-fit: contain;
    display: block;
}

.value-illustration--hover {
    position: relative;
    cursor: help;
}

.value-illustration--hover:focus {
    outline: 2px solid rgba(255, 255, 255, 0.25);
    outline-offset: 6px;
}

.value-illustration-tooltip {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    background: rgba(8, 8, 8, 0.9);
    color: var(--text-main);
    border-radius: 12px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.value-illustration--hover:hover .value-illustration-tooltip,
.value-illustration--hover:focus .value-illustration-tooltip,
.value-illustration--hover:focus-within .value-illustration-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.value-illustration-tooltip p {
    margin: 0;
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.5;
}

.value-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.landing-footer {
    padding: 28px 0 38px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===============================
   Login page
================================ */

body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(circle at top right, rgba(255,85,0,0.20), transparent 55%),
        linear-gradient(180deg, #0b0b0b, #121212);
}

.login-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 380px;
    padding: 32px;

    background: rgba(12,12,12,0.65);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;

    backdrop-filter: blur(14px);

    box-shadow:
        0 18px 45px rgba(0,0,0,0.8),
        0 0 0 1px rgba(255,255,255,0.03);

    text-align: center;
}

.login-title {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
}

.login-subtitle {
    margin: 0 0 22px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.login-actions .btn {
    width: 100%;
}

/* ===============================
   Responsive sidebar
================================ */

@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .sidebar-nav {
        display: flex;
        gap: 8px;
        margin: 0;
    }

    .sidebar-nav li {
        margin: 0;
    }

    .sidebar-footer {
        display: none;
    }
}

.app-header {
    padding: 14px 0 10px;
}

.app-header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-header-logo {
    height: clamp(52px, 8vw, 120px);
    width: auto;
    max-width: 70%;
    object-fit: contain;
}

.app-header-brand .btn {
    margin-left: auto;
}
