/* ARTEMİZ — site sohbet paneli (edge rail + mobil uyum) */

.artemis-chat-root {
    position: relative;
    z-index: 10050;
}

.artemis-chat-root .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.artemis-chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

body.dark-theme .artemis-chat-overlay {
    background: rgba(0, 0, 0, 0.55);
}

.artemis-chat-panel {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(400px, calc(100vw - 24px));
    max-height: min(560px, calc(100vh - 100px - env(safe-area-inset-bottom, 0px)));
    max-height: min(560px, calc(100dvh - 100px - env(safe-area-inset-bottom, 0px)));
    display: flex;
    flex-direction: column;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    box-shadow:
        0 24px 48px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(30, 144, 255, 0.06);
    overflow: hidden;
    font-family: var(--font-sans, Inter, system-ui, sans-serif);
}

body.dark-theme .artemis-chat-panel {
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(148, 163, 184, 0.12);
}

.artemis-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 14px 14px;
    background: linear-gradient(135deg, rgba(30, 144, 255, 0.12) 0%, rgba(255, 184, 0, 0.1) 100%);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.artemis-chat-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.artemis-chat-header__icon {
    font-size: 2rem;
    color: #6366f1;
    flex-shrink: 0;
}

.artemis-chat-header__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-color, #0f172a);
    font-family: var(--font-display, Poppins, sans-serif);
}

.artemis-chat-header__sub {
    margin: 2px 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
}

.artemis-chat-header__actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.artemis-chat-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    color: var(--text-color, #0f172a);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

body.dark-theme .artemis-chat-icon-btn {
    background: rgba(30, 41, 59, 0.85);
    color: #e2e8f0;
}

.artemis-chat-icon-btn:hover {
    background: rgba(30, 144, 255, 0.15);
    transform: scale(1.04);
}

.artemis-chat-icon-btn .material-symbols-rounded {
    font-size: 1.35rem;
}

.artemis-chat-warn {
    padding: 10px 14px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #92400e;
    background: rgba(251, 191, 36, 0.2);
    border-bottom: 1px solid rgba(251, 191, 36, 0.35);
}

body.dark-theme .artemis-chat-warn {
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.12);
}

.artemis-chat-messages {
    flex: 1 1 auto;
    min-height: 200px;
    max-height: 340px;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-color, #f8fafc);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

body.dark-theme .artemis-chat-messages {
    background: var(--bg-color, #0f172a);
}

.artemis-chat-bubble {
    max-width: 92%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.artemis-chat-bubble--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #1e90ff 0%, #0ea5e9 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.artemis-chat-bubble--assistant {
    align-self: flex-start;
    background: var(--card-bg, #fff);
    color: var(--text-color, #0f172a);
    border: 1px solid var(--border-color, #e2e8f0);
    border-bottom-left-radius: 4px;
}

.artemis-chat-bubble--assistant.artemis-chat--pending {
    opacity: 0.75;
    font-style: italic;
}

.artemis-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    background: var(--card-bg, #fff);
}

.artemis-chat-form textarea {
    flex: 1 1 auto;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-color, #0f172a);
    background: var(--glass-bg, rgba(255, 255, 255, 0.9));
    line-height: 1.4;
}

body.dark-theme .artemis-chat-form textarea {
    background: rgba(30, 41, 59, 0.6);
}

.artemis-chat-form textarea:focus {
    outline: none;
    border-color: #1e90ff;
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.2);
}

.artemis-chat-form textarea:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.artemis-chat-send {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    background: linear-gradient(135deg, #ffb800 0%, #f59e0b 100%);
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(255, 184, 0, 0.35);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.artemis-chat-send:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.artemis-chat-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.artemis-chat-send .material-symbols-rounded {
    font-size: 1.35rem;
}

@media (max-width: 768px) {
    .artemis-chat-panel {
        left: 0;
        right: 0;
        top: env(safe-area-inset-top, 0px);
        bottom: 0;
        width: 100%;
        max-width: none;
        height: calc(100vh - env(safe-area-inset-top, 0px));
        height: calc(100dvh - env(safe-area-inset-top, 0px));
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border-color, #e2e8f0);
    }

    body.dark-theme .artemis-chat-panel {
        box-shadow: none;
        border-top-color: rgba(148, 163, 184, 0.2);
    }

    .artemis-chat-header {
        padding: 12px 12px 10px;
        flex-shrink: 0;
    }

    .artemis-chat-header__icon {
        font-size: 1.65rem;
    }

    .artemis-chat-header__title {
        font-size: 1.05rem;
    }

    .artemis-chat-header__sub {
        font-size: 0.72rem;
    }

    .artemis-chat-warn {
        flex-shrink: 0;
    }

    .artemis-chat-messages {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding: 12px;
    }

    .artemis-chat-bubble {
        font-size: 0.95rem;
        max-width: 90%;
    }

    .artemis-chat-form {
        flex-shrink: 0;
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        gap: 10px;
    }

    .artemis-chat-form textarea {
        font-size: 16px;
        min-height: 48px;
        max-height: 36dvh;
    }

    .artemis-chat-send {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }
}

/* Arka plan kaydırmasını kapat (JS ile .artemis-chat--open eklenir) */
html.artemis-chat--open,
body.artemis-chat--open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .artemis-chat-icon-btn,
    .artemis-chat-send {
        transition: none;
    }
}
