/* ==========================================
   FİNANSTİK ASİSTAN
   ========================================== */

:root {
    --as-panel: #ffffff;
    --as-zemin: #f6f8fc;
    --as-balon: #ffffff;
    --as-cizgi: #e8edf5;
    --as-metin: #1e293b;
    --as-metin-2: #64748b;
    --as-mavi: #0f5cff;
    --as-mavi-koyu: #0b4ed8;
    --as-hizli-metin: #1e40af;
    --as-hizli-hover: #eef4ff;
}

:root[data-theme="dark"] {
    --as-panel: #141c2e;
    --as-zemin: #0f1626;
    --as-balon: #1a2338;
    --as-cizgi: #2a3550;
    --as-metin: #e6ebf5;
    --as-metin-2: #a3afc4;
    --as-mavi: #2f74ff;
    --as-mavi-koyu: #1f5fe6;
    --as-hizli-metin: #9cc0ff;
    --as-hizli-hover: #1d2a47;
}

#finanstikAsistan {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 48px);
    background: var(--as-panel);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transition: all 0.25s ease;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

#finanstikAsistan.aktif {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}


/* AÇMA DÜĞMESİ (her sayfada sağ altta) */

.fs-asistan-ac {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 13px 18px 13px 14px;
    background: linear-gradient(135deg, #0f5cff, #1749c6);
    color: #fff;
    font: inherit;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(15, 92, 255, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.fs-asistan-ac:hover {
    transform: translateY(-2px);
}

.fs-asistan-ac span {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.fs-asistan-ac.gizli {
    opacity: 0;
    pointer-events: none;
}


/* BAŞLIK */

.asistan-baslik {
    background: linear-gradient(135deg, #0f5cff, #1749c6);
    color: white;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.asistan-baslik-sol {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asistan-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
}

.asistan-baslik strong {
    display: block;
    font-size: 15px;
}

.asistan-baslik span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    opacity: 0.82;
}

.asistan-kapat {
    border: 0;
    background: transparent;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 3px 6px;
}


/* MESAJ ALANI */

.asistan-mesajlar {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: var(--as-zemin);
}

.asistan-mesaj {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.asistan-mesaj.asistan {
    background: var(--as-balon);
    color: var(--as-metin);
    border: 1px solid var(--as-cizgi);
    border-top-left-radius: 5px;
}

.asistan-mesaj.kullanici {
    margin-left: auto;
    background: var(--as-mavi);
    color: white;
    border-top-right-radius: 5px;
}

/* Cevap yazılırken yanıp sönen imleç */
.asistan-mesaj.yaziyor::after {
    content: "▍";
    margin-left: 2px;
    color: var(--as-mavi);
    animation: asistan-imlec 1s steps(2) infinite;
}

@keyframes asistan-imlec {
    50% { opacity: 0; }
}

.asistan-not {
    font-size: 11px;
    color: var(--as-metin-2);
    margin: -6px 0 12px 2px;
}


/* HIZLI BUTONLAR */

.asistan-hizli {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.asistan-hizli button {
    border: 1px solid var(--as-cizgi);
    background: var(--as-balon);
    color: var(--as-hizli-metin);
    border-radius: 20px;
    padding: 8px 11px;
    font-size: 11px;
    cursor: pointer;
    transition: 0.2s;
}

.asistan-hizli button:hover {
    background: var(--as-hizli-hover);
}


/* ÖRNEK SORULAR */

.asistan-ornekler {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.asistan-ornekler small {
    font-size: 11px;
    font-weight: 700;
    color: var(--as-metin-2);
}

.asistan-ornekler button {
    text-align: left;
    border: 1px dashed var(--as-cizgi);
    background: transparent;
    color: var(--as-metin);
    border-radius: 12px;
    padding: 8px 11px;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
}

.asistan-ornekler button:hover {
    border-style: solid;
    border-color: var(--as-mavi);
}


/* SAYFA LİNKLERİ */

.asistan-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--as-mavi);
    font-weight: 700;
    text-decoration: none;
    font-size: 12px;
}

:root[data-theme="dark"] .asistan-link {
    color: #8db6ff;
}

.asistan-link:hover {
    text-decoration: underline;
}


/* YAZMA ALANI */

.asistan-yazma {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--as-panel);
    border-top: 1px solid var(--as-cizgi);
}

.asistan-yazma input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border: 1px solid var(--as-cizgi);
    border-radius: 13px;
    padding: 0 13px;
    outline: none;
    font-size: 13px;
    background: var(--as-balon);
    color: var(--as-metin);
}

.asistan-yazma input:focus {
    border-color: var(--as-mavi);
    box-shadow: 0 0 0 3px rgba(15,92,255,0.12);
}

.asistan-yazma button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 13px;
    background: var(--as-mavi);
    color: white;
    font-size: 17px;
    cursor: pointer;
}

.asistan-yazma button:hover {
    background: var(--as-mavi-koyu);
}

.asistan-yazma button:disabled {
    opacity: 0.5;
    cursor: wait;
}


/* MOBİL */

@media (max-width: 600px) {

    #finanstikAsistan {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        max-width: none;
        height: min(620px, calc(100vh - 30px));
        border-radius: 20px;
    }

    .asistan-mesajlar {
        padding: 14px;
    }

    .fs-asistan-ac {
        right: 14px;
        bottom: 14px;
        padding: 12px;
    }

    .fs-asistan-ac b {
        display: none;
    }
}


/* ==========================================
   CEVAP BİÇİMİ (tablo, başlık, madde)
   ========================================== */

.asistan-cevap {
    line-height: 1.45;
}

.asistan-cevap p {
    margin: 0 0 8px 0;
}

.asistan-cevap strong {
    line-height: 1.4;
}

.asistan-tablo-wrap {
    margin: 6px 0 10px 0;
    overflow-x: auto;
}

.asistan-tablo {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.asistan-tablo th,
.asistan-tablo td {
    padding: 7px 9px;
    line-height: 1.3;
    border-bottom: 1px solid var(--as-cizgi);
    text-align: left;
}

.asistan-tablo th {
    font-weight: 700;
    color: var(--as-metin-2);
}

.asistan-tablo td {
    vertical-align: middle;
}

.asistan-tablo td:last-child {
    text-align: right;
    font-weight: 700;
}

.asistan-alt-baslik {
    display: block;
    margin: 7px 0 5px 0;
}

.asistan-bosluk {
    height: 5px;
}

.asistan-madde {
    margin: 2px 0;
    line-height: 1.4;
}
