/* Refresh Kimya – yapay zeka sohbet asistanı */
.rk-chat-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #1c75bc, #145a8c);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(28, 117, 188, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
}
.rk-chat-launcher:hover { transform: scale(1.06); box-shadow: 0 10px 28px rgba(28, 117, 188, .55); }
.rk-chat-launcher .rk-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff5252;
    border: 2px solid #fff;
    display: none;
}
.rk-chat-launcher.has-unread .rk-chat-badge { display: block; }
.rk-chat-launcher .rk-icon-close { display: none; }
.rk-chat-launcher.open .rk-icon-chat { display: none; }
.rk-chat-launcher.open .rk-icon-close { display: inline; }

.rk-chat-window {
    position: fixed;
    right: 20px;
    bottom: 92px;
    z-index: 9001;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(.98);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}
.rk-chat-window.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.rk-chat-header {
    background: linear-gradient(135deg, #1c75bc, #145a8c);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.rk-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.rk-chat-header-text { flex: 1; min-width: 0; }
.rk-chat-header-text strong { display: block; font-size: 15px; line-height: 1.2; }
.rk-chat-header-text span { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.rk-chat-header-text span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #5cff8d; display: inline-block; }
.rk-chat-header button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    opacity: .85;
}
.rk-chat-header button:hover { background: rgba(255, 255, 255, .15); opacity: 1; }

.rk-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f4f7fb;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}
.rk-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.rk-msg a { color: #1c75bc; text-decoration: underline; }
.rk-msg.user { align-self: flex-end; background: #1c75bc; color: #fff; border-bottom-right-radius: 4px; }
.rk-msg.user a { color: #fff; }
.rk-msg.bot { align-self: flex-start; background: #fff; color: #333; border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.rk-msg.bot ul { margin: 6px 0 0 18px; padding: 0; }
.rk-msg.error { background: #fdecea; color: #b71c1c; }
.rk-msg-time { display: block; font-size: 10px; opacity: .6; margin-top: 4px; text-align: right; white-space: normal; }
.rk-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rk-sources a { font-size: 11px; background: #eef4fa; color: #1c75bc; padding: 3px 8px; border-radius: 10px; text-decoration: none; }
.rk-sources a:hover { background: #1c75bc; color: #fff; }

.rk-typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.rk-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9db4c8; animation: rkBlink 1.2s infinite ease-in-out; }
.rk-typing span:nth-child(2) { animation-delay: .2s; }
.rk-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes rkBlink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.rk-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; background: #f4f7fb; }
.rk-suggestions button {
    background: #fff;
    border: 1px solid #cfdcea;
    color: #1c75bc;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 14px;
    cursor: pointer;
    transition: all .15s ease;
}
.rk-suggestions button:hover { background: #1c75bc; border-color: #1c75bc; color: #fff; }

.rk-chat-input {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e6ebf1;
    background: #fff;
}
.rk-chat-input textarea {
    flex: 1;
    resize: none;
    border: 1px solid #d9e1ea;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    max-height: 110px;
    min-height: 42px;
    font-family: inherit;
    outline: none;
}
.rk-chat-input textarea:focus { border-color: #1c75bc; box-shadow: 0 0 0 3px rgba(28, 117, 188, .12); }
.rk-chat-input button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #1c75bc;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rk-chat-input button:disabled { background: #a9c3d9; cursor: not-allowed; }
.rk-chat-footer { font-size: 10px; color: #98a4b3; text-align: center; padding: 0 12px 8px; background: #fff; }

@media (max-width: 576px) {
    .rk-chat-launcher { right: 14px; bottom: 14px; width: 54px; height: 54px; font-size: 21px; }
    .rk-chat-window {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .rk-chat-window.open ~ .rk-chat-launcher { display: none; }
}
