/* Destek Widget CSS */

#destek-widget-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#destek-launcher {
    width: 60px;
    height: 60px;
    background-color: #2563eb;
    /* Tailwind blue-600 */
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#destek-launcher:hover {
    transform: scale(1.05);
    background-color: #1d4ed8;
    /* Tailwind blue-700 */
}

#destek-launcher svg {
    width: 30px;
    height: 30px;
}

.destek-bounce {
    animation: destek-bounce-anim 2s infinite;
}

@keyframes destek-bounce-anim {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

#destek-chat-window {
    width: 350px;
    height: 500px;
    max-height: calc(100vh - 40px);
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom left;
}

#destek-chat-window.destek-closed {
    display: none;
    opacity: 0;
    transform: scale(0.9);
}

#destek-chat-header {
    background-color: #2563eb;
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

#destek-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

#destek-agent-status {
    background-color: #f3f4f6;
    color: #4b5563;
    font-size: 12px;
    padding: 8px 16px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

#destek-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#destek-partner-typing {
    padding: 4px 16px;
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
    animation: destek-fade-in 0.3s ease;
}

@keyframes destek-fade-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.destek-msg {
    display: flex;
    max-width: 85%;
}

.destek-msg-right {
    align-self: flex-end;
}

.destek-msg-left {
    align-self: flex-start;
}

.destek-msg-name {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 2px;
    margin-left: 4px;
    font-weight: 600;
}

.destek-msg-text {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.destek-msg-right .destek-msg-text {
    background-color: #2563eb;
    color: white;
    border-bottom-right-radius: 4px;
}

.destek-msg-left .destek-msg-text {
    background-color: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

#destek-chat-footer {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background-color: white;
}

#destek-chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

#destek-attach-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s ease;
}

#destek-attach-label:hover {
    color: #2563eb;
}

#destek-chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#destek-chat-input:focus {
    border-color: #2563eb;
}

#destek-chat-form button {
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#destek-chat-form button:hover {
    background-color: #1d4ed8;
}

/* Base resets inside container to prevent main site CSS collisions */
#destek-widget-container * {
    box-sizing: border-box;
}

.destek-msg-image {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 4px;
    display: block;
}

.destek-msg-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    margin-bottom: 4px;
    word-break: break-all;
}

.destek-msg-right .destek-msg-file {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 480px) {
    #destek-widget-container {
        bottom: 0;
        left: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    #destek-chat-window {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    #destek-launcher {
        margin-left: 20px;
        margin-bottom: 20px;
    }
}

/* Rating Screen Styles */
#destek-rating-screen {
    flex: 1;
    display: none;
    flex-direction: column;
    padding: 30px 20px;
    align-items: center;
    background: white;
    text-align: center;
    border-radius: 12px;
}

.destek-rating-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.destek-rating-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 24px;
}

.destek-stars {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.destek-star {
    font-size: 32px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease;
}

.destek-star.active {
    color: #fbbf24;
    /* yellow-400 */
}

.destek-rating-tags {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    margin-bottom: 24px;
}

.destek-tag {
    padding: 8px 4px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 11px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.destek-tag.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
    font-weight: 600;
}

#destek-rating-comment {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    resize: none;
    margin-bottom: 20px;
}

#destek-submit-rating {
    width: 100%;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

#destek-submit-rating:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.destek-thanks-msg {
    color: #059669;
    font-weight: 600;
    margin-top: 10px;
}

/* ---- Bağlantı Durumu Dot ---- */
.destek-conn-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.4s ease;
}

.destek-conn-online {
    background-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.3);
    animation: destek-pulse-green 2s infinite;
}

.destek-conn-offline {
    background-color: #ef4444;
}

.destek-conn-reconnecting {
    background-color: #f59e0b;
    animation: destek-blink 1s infinite;
}

@keyframes destek-pulse-green {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

@keyframes destek-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ---- Mesaj Zaman Damgası ---- */
.destek-msg-time {
    font-size: 10px;
    margin-top: 6px;
    margin-bottom: -2px;
    opacity: 0.8;
    display: block;
    line-height: 1;
}

.destek-msg-right .destek-msg-time {
    text-align: right;
    color: rgba(255, 255, 255, 0.85);
}

.destek-msg-left .destek-msg-time {
    text-align: right;
    color: #9ca3af;
}

/* ---- Mesaj wrapper dikey düzen ---- */
.destek-msg {
    flex-direction: column;
}

/* ---- Mobil iyileştirme ---- */
@media (max-width: 480px) {
    #destek-chat-window {
        border-radius: 0 !important;
        box-shadow: none;
    }
    #destek-chat-header {
        padding: 12px 16px;
    }
}