/* Netdirekt Canlı Destek Widget - Sıfır bağımlılık */

#nd-lc,
#nd-lc *,
#nd-lc *::before,
#nd-lc *::after {
    box-sizing: border-box;
}

#nd-lc {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #212529;
    position: fixed;
    z-index: 999998;
    right: 20px;
    bottom: 20px;
    pointer-events: none;
}
#nd-lc > * { pointer-events: auto; }

/* ============ LAUNCHER BUTTON ============ */
.nd-lc-launcher {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0d5cab;
    color: #fff;
    border: 0;
    border-radius: 30px;
    padding: 12px 20px 12px 14px;
    box-shadow: 0 6px 18px rgba(13, 92, 171, 0.35);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.15s, box-shadow 0.15s;
}
.nd-lc-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(13, 92, 171, 0.45);
}
.nd-lc-launcher-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.nd-lc-launcher-icon::after {
    content: '';
    position: absolute;
    top: 2px; right: 2px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #adb5bd;
    border: 2px solid #0d5cab;
    box-sizing: content-box;
}
.nd-lc-launcher-badge {
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 7px;
    min-width: 18px;
    text-align: center;
    display: none;
}
.nd-lc-launcher.has-unread .nd-lc-launcher-badge { display: inline-block; }

/* ============ CHAT PANEL ============ */
.nd-lc-panel {
    display: none;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    flex-direction: column;
    position: absolute;
    right: 0;
    bottom: 70px;
    animation: nd-lc-in 0.2s ease-out;
}
#nd-lc.nd-lc-open .nd-lc-panel { display: flex; }
#nd-lc.nd-lc-open .nd-lc-launcher { display: none; }

@keyframes nd-lc-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.nd-lc-panel-header {
    background: #0d5cab;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 auto;
}
.nd-lc-panel-title h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}
.nd-lc-panel-title .nd-lc-status {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nd-lc-panel-title .nd-lc-status::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #adb5bd;
}
#nd-lc.agent-online .nd-lc-panel-title .nd-lc-status::before {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.7);
}
#nd-lc.agent-away .nd-lc-panel-title .nd-lc-status::before {
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.7);
}

.nd-lc-panel-actions {
    display: flex;
    gap: 4px;
}
.nd-lc-icon-btn {
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}
.nd-lc-icon-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

/* ============ MESSAGES AREA ============ */
.nd-lc-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nd-lc-greeting {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    color: #6c757d;
    font-size: 13px;
    border: 1px dashed #dee2e6;
}
.nd-lc-greeting strong { color: #212529; display: block; margin-bottom: 4px; }

.nd-lc-msg {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nd-lc-msg-visitor { align-self: flex-end; align-items: flex-end; }
.nd-lc-msg-agent { align-self: flex-start; align-items: flex-start; }
.nd-lc-msg-system {
    align-self: stretch;
    max-width: 100%;
    align-items: stretch;
}

.nd-lc-msg-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.nd-lc-msg-visitor .nd-lc-msg-bubble {
    background: #0d5cab;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.nd-lc-msg-agent .nd-lc-msg-bubble {
    background: #fff;
    color: #212529;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}
.nd-lc-msg-system .nd-lc-msg-bubble {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 12px;
    margin: 4px 20px;
}
.nd-lc-msg-system .nd-lc-msg-meta {
    text-align: center;
    padding-top: 2px;
}

.nd-lc-msg-meta {
    font-size: 10px;
    color: #adb5bd;
    padding: 0 4px;
}

/* ============ FORMS ============ */
.nd-lc-intro-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 4px;
}
.nd-lc-intro-form p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #495057;
}
.nd-lc-intro-form input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    margin-bottom: 8px;
    outline: none;
}
.nd-lc-intro-form input:focus {
    border-color: #0d5cab;
    box-shadow: 0 0 0 3px rgba(13, 92, 171, 0.15);
}
.nd-lc-intro-form button {
    width: 100%;
    padding: 8px;
    background: #0d5cab;
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.nd-lc-intro-form button:hover { background: #0a4a8c; }
.nd-lc-intro-skip {
    background: transparent;
    border: 0;
    color: #6c757d;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    padding: 4px 8px;
    display: block;
    margin: 4px auto 0;
    font-family: inherit;
}

/* ============ COMPOSER ============ */
.nd-lc-composer {
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    flex: 0 0 auto;
}
.nd-lc-composer-inner {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.nd-lc-composer textarea {
    flex: 1 1 auto;
    resize: none;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    max-height: 100px;
    outline: none;
}
.nd-lc-composer textarea:focus {
    border-color: #0d5cab;
    box-shadow: 0 0 0 3px rgba(13, 92, 171, 0.15);
}
.nd-lc-composer button {
    background: #0d5cab;
    border: 0;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    flex-shrink: 0;
}
.nd-lc-composer button:disabled { background: #adb5bd; cursor: not-allowed; }
.nd-lc-composer button:hover:not(:disabled) { background: #0a4a8c; }
.nd-lc-composer-counter {
    font-size: 11px;
    color: #adb5bd;
    text-align: right;
    padding: 4px 4px 0;
    letter-spacing: 0.3px;
}
.nd-lc-composer-counter.near-limit { color: #dc3545; font-weight: 600; }

.nd-lc-closed-note,
.nd-lc-offline-note {
    padding: 16px;
    background: #fff9db;
    color: #856404;
    font-size: 13px;
    text-align: center;
    border-top: 1px solid #ffe58f;
    line-height: 1.5;
}
.nd-lc-closed-note p,
.nd-lc-offline-note p { margin: 0 0 8px 0; }
.nd-lc-closed-note p:last-child,
.nd-lc-offline-note p:last-child { margin-bottom: 0; }
.nd-lc-offline-note {
    background: #f1f3f5;
    color: #495057;
    border-top-color: #dee2e6;
}
.nd-lc-offline-note strong { color: #212529; }
.nd-lc-offline-note a {
    color: #0d5cab;
    font-weight: 500;
    text-decoration: underline;
}
.nd-lc-offline-note a:hover { color: #084a8f; }
.nd-lc-new-chat-btn {
    background: #0d5cab;
    color: #fff;
    border: 0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
}
.nd-lc-new-chat-btn:hover { background: #0a4a8c; }

/* Launcher status renkleri */
.nd-lc-launcher.online .nd-lc-launcher-icon::after {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}
.nd-lc-launcher.away .nd-lc-launcher-icon::after {
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}
.nd-lc-launcher.offline .nd-lc-launcher-icon::after {
    background: #adb5bd;
}

/* ============ MOBILE ============ */
@media (max-width: 480px) {
    #nd-lc {
        right: 12px;
        bottom: 12px;
    }
    .nd-lc-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 90px);
        bottom: 65px;
    }
    .nd-lc-launcher {
        padding: 10px 16px 10px 12px;
    }
}

/* Düzenlenen mesaj ibaresi */
.nd-lc-edited { font-style: italic; opacity: .7; font-size: 10px; }

/* ===== Görüşme puanlama ===== */
.nd-lc-rating-form, .nd-lc-rating-done { margin: 10px 0; text-align: center; }
.nd-lc-rating-form p, .nd-lc-rating-done p { margin: 0 0 6px; font-size: 13px; }
.nd-lc-rating-stars { display: flex; justify-content: center; gap: 4px; margin-bottom: 8px; }
.nd-lc-star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    color: #cbd5e1;
    padding: 2px;
    transition: color .15s, transform .1s;
}
.nd-lc-star-btn:hover { transform: scale(1.15); }
.nd-lc-star-btn.selected { color: #f59e0b; }
.nd-lc-star { font-size: 22px; color: #cbd5e1; }
.nd-lc-star.filled { color: #f59e0b; }
.nd-lc-rating-comment {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 10px;
    font: inherit;
    font-size: 13px;
    resize: none;
    margin-bottom: 8px;
}
.nd-lc-rating-send {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 10px;
}
.nd-lc-rating-send:disabled { opacity: .5; cursor: default; }
.nd-lc-rating-done .nd-lc-rating-stars { margin-bottom: 4px; }
