﻿/* ============================================================
   GLOBAL
============================================================ */

#wc-chat-root {
    font-family: inherit;
}

.wc-hidden {
    display: none !important;
}

/* ============================================================
   FAB (SAĞ ALTA BUTON)
============================================================ */

.wc-chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    outline: none;
    background: #25d366;
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 999000;
}

    .wc-chat-fab i {
        pointer-events: none;
    }

/* Kırmızı bildirim noktası */
#wc-chat-fab-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: red;
    border-radius: 50%;
}

/* ============================================================
   CHAT WINDOW
============================================================ */

.wc-chat-window {
    position: fixed;
    bottom: 94px;
    right: 24px;
    width: 780px;
    height: 520px;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 26px rgba(0,0,0,0.28);
    z-index: 999001;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   HEADER
============================================================ */

.wc-chat-header {
    height: 64px;
    background: #075e54;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
}

.wc-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #128c7e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    font-size: 18px;
}

.wc-chat-header-info {
    display: flex;
    flex-direction: column;
}

.wc-chat-main-name {
    font-size: 15px;
    font-weight: 600;
}

.wc-chat-main-status {
    font-size: 12px;
    opacity: 0.85;
}

.wc-chat-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wc-chat-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Sohbeti sonlandır butonu */

.wc-chat-end-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #d9534f;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

    .wc-chat-end-btn i {
        font-size: 15px;
    }

    .wc-chat-end-btn:hover {
        background: #c9302c;
    }

/* ============================================================
   BODY
============================================================ */

.wc-chat-body {
    flex: 1;
    display: flex;
    background: #e5ddd5;
    min-height: 0;
}

/* ============================================================
   SIDEBAR (SOHBET LİSTESİ)
============================================================ */

.wc-chat-sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.wc-chat-sidebar-header {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.wc-chat-search {
    width: 100%;
    border-radius: 18px;
    border: 1px solid #ddd;
    padding: 6px 10px;
    font-size: 13px;
}

.wc-chat-conv-list {
    flex: 1;
    overflow-y: auto;
}

.wc-chat-conv-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f2f2f2;
}

    .wc-chat-conv-item:hover {
        background: #f5f5f5;
    }

.wc-chat-conv-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #555;
}

.wc-chat-conv-texts {
    flex: 1;
}

.wc-chat-conv-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wc-chat-conv-name {
    font-size: 13px;
    font-weight: 600;
}

.wc-chat-conv-time {
    font-size: 11px;
    opacity: .8;
}

.wc-chat-conv-last {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
    display: flex;
    align-items: center;
}

/* Sol listede unread badge */

.wc-chat-unread-badge {
    background: red;
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
}


/* ============================================================
   MAIN CHAT
============================================================ */

.wc-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #efeae2;
}

.wc-chat-main-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
}

.wc-chat-main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ============================================================
   MESSAGES
============================================================ */

.wc-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: rgba(240,240,240,0.35);
}

.wc-chat-msg-row {
    display: flex;
    margin-bottom: 6px;
}

.wc-chat-msg-row-me {
    justify-content: flex-end;
}

.wc-chat-msg-row-other {
    justify-content: flex-start;
}

.wc-chat-msg-bubble {
    max-width: 75%;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.wc-chat-msg-row-me .wc-chat-msg-bubble {
    background: #dcf8c6;
}

.wc-chat-msg-meta {
    font-size: 10px;
    opacity: .7;
    margin-top: 2px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.wc-chat-msg-ticks {
    font-size: 11px;
}

/* Tek/çift tik renkleri */

.wc-ticks-sent {
    color: #4fc3f7;
}

.wc-ticks-delivered {
    color: #81d4fa;
}

.wc-ticks-read {
    color: #2979ff;
}

/* ============================================================
   FOOTER
============================================================ */

.wc-chat-main-footer {
    padding: 8px 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    background: #f0f0f0;
    border-top: 1px solid #ddd;
}

    .wc-chat-main-footer input {
        flex: 1;
        height: 40px;
        border-radius: 20px;
        border: 1px solid #ddd;
        padding: 0 12px;
        font-size: 13px;
    }

    .wc-chat-main-footer button {
        height: 40px;
        padding: 0 14px;
        border-radius: 20px;
        border: none;
        background: #25d366;
        color: #fff;
        font-size: 13px;
        cursor: pointer;
    }

/* ============================================================
   REVIEW MODAL
============================================================ */

.wc-review-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999002;
}

.wc-review-box {
    width: 360px;
    background: #fff;
    padding: 22px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.28);
    animation: wcModalPop .22s ease-out;
}

    .wc-review-box h4 {
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .wc-review-box p {
        font-size: 14px;
        margin-bottom: 12px;
        color: #444;
    }

@keyframes wcModalPop {
    from {
        transform: scale(.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Yıldızlar */

#wc-stars {
    margin-bottom: 14px;
}

    #wc-stars span {
        font-size: 28px;
        cursor: pointer;
        color: #ccc;
        transition: .2s;
        margin: 0 4px;
    }

        #wc-stars span.wc-star-selected {
            color: #ffb400;
            transform: scale(1.2);
        }

/* Yorum alanı */

.wc-review-text {
    width: 100%;
    height: 70px;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 8px;
    font-size: 14px;
    resize: none;
    margin-bottom: 18px;
}

/* Gönder butonu */

#wc-review-submit {
    width: 100%;
    background: #25d366;
    border: none;
    padding: 10px;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

    #wc-review-submit:hover {
        background: #1ebe5c;
    }

/* ============================================================
   SWEETALERT Z-INDEX
============================================================ */

.swal2-container {
    z-index: 2147483647 !important;
}

/* ============================================================
   MOBILE
============================================================ */



.wc-chat-avatar {
    position: relative;
}

.wc-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #075e54;
}

.wc-online {
    background: #25d366;
}

.wc-offline {
    background: #ccc;
}
.wc-status-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

#wc-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

    #wc-online-dot.wc-online {
        background-color: #25d366; /* yeşil */
    }

    #wc-online-dot.wc-offline {
        background-color: #aaa; /* gri */
    }
/* CHAT CLOSE BUTTON */
.wc-close-btn {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    padding: 6px 10px;
    line-height: 1;
    border-radius: 6px;
    user-select: none;
}

    .wc-close-btn:hover {
        background: rgba(255,255,255,0.2);
    }

@media (max-width: 768px) {

    .wc-chat-sidebar {
        position: absolute;
        top: 64px;
        left: 0;
        width: 260px;
        height: calc(100% - 64px);
        background: #fff;
        border-right: 1px solid #ddd;
        z-index: 999999;
        display: flex;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

        .wc-chat-sidebar.wc-chat-sidebar-open {
            transform: translateX(0);
        }

    #wc-chat-menu-btn {
        display: flex !important;
    }

    .wc-chat-main {
        width: 100%;
    }
}
@media (max-width: 768px) {


    .wc-chat-main {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .wc-chat-main-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .wc-chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 12px;
    }

    .wc-chat-main-footer {
        flex-shrink: 0;
        height: 60px;
        padding-bottom: env(safe-area-inset-bottom);
        background: #f0f0f0;
        border-top: 1px solid #ddd;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {

    /* SADECE CHAT AÇIKKEN sayfayı kilitle */
    body.wc-chat-open {
        overflow: hidden;
        height: 100dvh;
    }

    
}
@media (max-width: 768px) {

    .wc-chat-body {
        flex: 1;
        min-height: 0;
        display: flex;
        overflow: hidden;
    }
}
@media (max-width: 768px) {
    .wc-chat-window {
        position: fixed;
        inset: 0; /* 🔴 KRİTİK SATIR */
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
}
/* ============================================================
   MOBILE ONLINE STATUS – FINAL FIX
   (structure safe, desktop untouched)
============================================================ */

@media (max-width: 768px) {
    #wc-online-dot {
        display: inline-block !important;
        flex-shrink: 0;
        width: 8px;
        height: 8px;
        min-width: 8px;
        min-height: 8px;
        border-radius: 50%;
        opacity: 1;
        visibility: visible;
    }

        #wc-online-dot.wc-online {
            background-color: #25d366 !important;
        }

        #wc-online-dot.wc-offline {
            background-color: #aaa !important;
        }

    .wc-status-row {
        display: flex;
        align-items: center;
        gap: 6px;
    }
}
/* ============================================================
   TASIYICIN – CHAT TEMA OVERRIDE (sadece görünüm)
   Çalışmayı bozmaz — yalnızca renkler güncellenir
============================================================ */

:root {
    /* ---- Ana Tema ---- */
    --wc-primary: #3B4CCA; /* header / fab */
    --wc-primary-dark: #3141B0; /* hover */
    --wc-accent: #6C9BFF; /* gönder butonu */
    /* ---- Zeminler ---- */
    --wc-bg: #f6f8fc;
    --wc-chat-bg: #eef2ff;
    /* ---- Mesaj Balonları ---- */
    --wc-msg-me: #eef3ff;
    --wc-msg-other: #ffffff;
    /* ---- Durum Renkleri ---- */
    --wc-online: #2ecc71;
    --wc-offline: #bdbdbd;
    /* ---- Uyarılar ---- */
    --wc-danger: #ff5a5f;
}

/* HEADER */
.wc-chat-header {
    background: var(--wc-primary) !important;
}

/* FAB */
.wc-chat-fab {
    background: var(--wc-primary) !important;
}

    .wc-chat-fab:hover {
        background: var(--wc-primary-dark) !important;
    }

/* GÖVDE ARKA PLAN */
.wc-chat-body {
    background: var(--wc-chat-bg) !important;
}

/* MESAJ BALONLARI */
.wc-chat-msg-row-me .wc-chat-msg-bubble {
    background: var(--wc-msg-me) !important;
}

.wc-chat-msg-bubble {
    background: var(--wc-msg-other) !important;
}

/* GÖNDER BUTONU */
.wc-chat-main-footer button {
    background: var(--wc-accent) !important;
}

/* ONLINE – OFFLINE DURUM */
#wc-online-dot.wc-online,
.wc-online-dot.wc-online {
    background-color: var(--wc-online) !important;
}

#wc-online-dot.wc-offline,
.wc-online-dot.wc-offline {
    background-color: var(--wc-offline) !important;
}

/* UNREAD BADGE / UYARI */
.wc-chat-unread-badge,
#wc-chat-fab-badge,
#wc-review-submit:hover {
    background: var(--wc-danger) !important;
}

/* REVIEW SUBMIT (normal) */
#wc-review-submit {
    background: var(--wc-accent) !important;
}
