/* ── Ratemo Canlı Destek Widget ── */
:root {
    --rcd-primary: #64221a;
    --rcd-accent:  #e8b86d;
    --rcd-bg:      #ffffff;
    --rcd-radius:  16px;
    --rcd-shadow:  0 8px 40px rgba(100,34,26,.22);
}

#rcd-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toggle butonu */
#rcd-toggle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(145deg, #7a2820, #64221a);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(100,34,26,.5), 0 2px 8px rgba(0,0,0,.15);
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
    overflow: hidden;
    padding: 0;
}
#rcd-toggle::after {
    content: '';
    position: absolute;
    top: 4px; left: 10px;
    width: 40px; height: 18px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    filter: blur(4px);
    pointer-events: none;
}
#rcd-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 36px rgba(100,34,26,.65), 0 2px 8px rgba(0,0,0,.2);
}
#rcd-toggle #rcd-icon-chat { display: flex; align-items: center; justify-content: center; }
#rcd-toggle #rcd-icon-chat svg { display: block; }
#rcd-toggle #rcd-icon-close { display: flex; align-items: center; justify-content: center; }

#rcd-unread-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
}

/* Chat kutusu */
#rcd-box {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 340px;
    background: var(--rcd-bg);
    border-radius: var(--rcd-radius);
    box-shadow: var(--rcd-shadow);
    overflow: hidden;
    animation: rcdSlideUp .25s ease;
}

@keyframes rcdSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.rcd-box-header {
    background: linear-gradient(135deg, #64221a 0%, #4a1812 100%);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.rcd-box-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rcd-box-info strong { color: #fff; font-size: 14px; display: block; font-weight: 700; }
.rcd-box-info small  { color: rgba(255,255,255,.7); font-size: 11px; }
.rcd-online-dot {
    display: inline-block;
    width: 7px; height: 7px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    box-shadow: 0 0 6px #4ade80;
}

/* Ekranlar */
.rcd-screen { padding: 20px 18px; }

#rcd-welcome p {
    font-size: 14px;
    color: #444;
    margin: 0 0 16px;
    line-height: 1.6;
}
#rcd-start-btn, #rcd-new-chat-btn {
    width: 100%;
    padding: 12px;
    background: #64221a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
#rcd-start-btn:hover, #rcd-new-chat-btn:hover { background: #4a1812; }

/* Mesaj listesi */
#rcd-chat-screen { padding: 0; display: flex; flex-direction: column; }
#rcd-msg-list {
    height: 280px;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}
#rcd-msg-list::-webkit-scrollbar { width: 4px; }
#rcd-msg-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.rcd-msg-label {
    font-size: 10px;
    font-weight: 700;
    opacity: .55;
    margin-bottom: 3px;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.rcd-msg {
    max-width: 80%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.rcd-msg.visitor {
    background: #f0f0f0;
    color: #222;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.rcd-msg.admin {
    background: var(--rcd-primary);
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.rcd-msg-time {
    font-size: 10px;
    opacity: .5;
    margin-top: 3px;
    text-align: right;
}

/* Input */
.rcd-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #f0f0f0;
}
#rcd-msg-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: border-color .2s;
    max-height: 100px;
    overflow-y: auto;
}
#rcd-msg-input:focus { border-color: var(--rcd-primary); }
#rcd-msg-send {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: #64221a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
    padding: 0;
}
#rcd-msg-send:hover { background: #4a1812; }
#rcd-msg-send svg { display: block; pointer-events: none; }

#rcd-closed-screen p { font-size: 13px; color: #666; margin: 0 0 14px; }

@media (max-width: 400px) {
    #rcd-box { width: calc(100vw - 40px); right: -14px; }
}

/* ── Offline Form ── */
.rcd-offline-msg {
    font-size: 13px;
    color: #555;
    margin: 0 0 14px;
    line-height: 1.6;
}
#rcd-offline-form input,
#rcd-offline-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 8px;
    outline: none;
    transition: border-color .2s;
}
#rcd-offline-form input:focus,
#rcd-offline-form textarea:focus { border-color: #64221a; }
#rcd-offline-form textarea { resize: none; }
#rcd-offline-form button[type="submit"] {
    width: 100%;
    padding: 11px;
    background: #64221a;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
#rcd-offline-form button[type="submit"]:hover { background: #4a1812; }
.rcd-offline-success {
    text-align: center;
    font-size: 13px;
    color: #2ecc71;
    font-weight: 600;
    padding: 10px 0;
}
