﻿/* wia-chatbot.css */
:root {
    --wia-primary: #E96A00;
    --wia-secondary: #C75500;
    --wia-header-start: #1B2A4A;
    --wia-header-end: #0F1B32;
    --wia-bg: rgba(255, 255, 255, 0.95);
    --wia-bot-msg: #f0f2f5;
    --wia-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.wia-bubble {
    position: fixed;
    bottom: 70px;
    right: 25px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--wia-primary), var(--wia-secondary));
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(233, 106, 0, 0.4);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: wia-pulse 2s ease-in-out 3;
}

@keyframes wia-pulse {
    0%, 100% {
        box-shadow: 0 5px 20px rgba(233, 106, 0, 0.4);
    }

    50% {
        box-shadow: 0 5px 30px rgba(233, 106, 0, 0.7), 0 0 0 10px rgba(233, 106, 0, 0.1);
    }
}

.wia-bubble:hover {
    transform: scale(1.1) rotate(5deg);
}

.wia-bubble img,
.wia-bubble svg {
    width: 32px;
    height: 32px;
}

.wia-container {
    position: fixed;
    bottom: 155px;
    right: 25px;
    width: 550px;
    height: 650px;
    background: var(--wia-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--wia-shadow);
    z-index: 10000;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

    .wia-container.d-none {
        display: flex !important;
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        pointer-events: none;
        visibility: hidden;
    }

    .wia-container.wia-hidden {
        display: none !important;
    }

.wia-header {
    background: linear-gradient(to right, var(--wia-header-start), var(--wia-header-end));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wia-header-info {
    display: flex;
    flex-direction: column;
}

    .wia-header-info strong {
        font-size: 18px;
        letter-spacing: 0.5px;
    }

    .wia-header-info small {
        font-size: 11px;
        opacity: 0.8;
    }

.wia-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

    .wia-close-btn:hover {
        background: rgba(255, 255, 255, 0.4);
    }

.wia-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    font-size: 14.5px;
    line-height: 1.5;
    word-wrap: break-word;
}

    .message.bot {
        background: var(--wia-bot-msg);
        color: #333;
        align-self: flex-start;
        border-bottom-left-radius: 4px;
    }

    .message.user {
        background: var(--wia-primary);
        color: white;
        align-self: flex-end;
        border-bottom-right-radius: 4px;
    }

.wia-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    align-items: center;
}

.wia-input-wrapper {
    flex: 1;
    position: relative;
}

#wia-user-input {
    width: 100%;
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    resize: none;
    max-height: 96px;
    overflow-y: auto;
    box-sizing: border-box;
    line-height: 1.4;
    display: block;
}

    #wia-user-input:focus {
        border-color: var(--wia-primary);
    }

.wia-char-counter {
    display: block;
    text-align: right;
    margin-top: 4px;
    padding-right: 8px;
    font-size: 12px;
    color: #999;
    transition: color 0.2s;
}

    .wia-char-counter.warn {
        color: #e67e22;
    }

    .wia-char-counter.limit {
        color: #e74c3c;
        font-weight: 600;
    }

.wia-send-btn {
    background: var(--wia-primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

    .wia-send-btn:hover {
        background: var(--wia-secondary);
        transform: translateY(-2px);
    }

    .wia-send-btn svg {
        width: 20px;
        height: 20px;
        fill: white;
    }

/* Typing animasyonu (bouncing dots) */
.wia-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
}

    .wia-typing span {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #999;
        animation: wia-bounce 1.4s ease-in-out infinite;
    }

        .wia-typing span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .wia-typing span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes wia-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Markdown içerik stilleri */
.message.bot img {
    max-width: 100%;
    border-radius: 10px;
    margin: 8px 0;
    cursor: pointer;
}

.message.bot h1, .message.bot h2, .message.bot h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 10px 0 4px 0;
    color: var(--wia-secondary);
}

.message.bot ul, .message.bot ol {
    margin: 4px 0;
    padding-left: 18px;
}

.message.bot li {
    margin-bottom: 2px;
}

.message.bot a {
    color: #D35400;
    text-decoration: underline;
    word-break: break-all;
}

    .message.bot a:hover {
        color: var(--wia-primary);
    }

.message.bot p {
    margin: 4px 0;
}

.message.bot strong {
    font-weight: 700;
}

.message.bot table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 13px;
}

.message.bot th, .message.bot td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: left;
}

.message.bot th {
    background: var(--wia-header-start);
    color: white;
}

/* Mobil uyumluluk */
@media (max-width: 600px) {
    .wia-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}
