:root {
    --chat-primary: #6366f1;
    --chat-bg: rgba(255, 255, 255, 0.85);
    --chat-text: #1f2937;
    --chat-bot-msg: #f3f4f6;
    --chat-user-msg: #6366f1;
    --chat-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Yüzen Buton */
.chat-launcher {
    position: fixed !important;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: var(--chat-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 999999 !important;
    transition: all 0.3s ease;
    animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.chat-launcher i {
    color: white !important;
    font-size: 28px !important;
}

.chat-launcher:hover {
    transform: scale(1.1) rotate(5deg);
    animation: none;
}

/* Chat Penceresi */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--chat-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: var(--chat-shadow);
    display: flex;
    /* Flex kalsın ama opacity ile gizle */
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;

    /* Fade Effects */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-window.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Header */
.chat-header {
    background: var(--chat-primary);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.message.bot {
    align-self: flex-start;
    background: var(--chat-bot-msg);
    border-bottom-left-radius: 5px;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-user-msg);
    color: white;
    border-bottom-right-radius: 5px;
}

/* Footer / Input */
.chat-footer {
    padding: 15px;
    background: white;
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid #f3f4f6;
}

.chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    padding: 10px 15px;
    border-radius: 10px;
    outline: none;
    font-size: 14px;
}

.chat-send {
    background: var(--chat-primary);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
}

/* Messages */
.message {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    max-width: 75%;
    margin-bottom: 25px;
    /* Increased for better icon spacing */
    position: relative;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Message Content & Links */
.message {
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
}

.message a {
    color: var(--chat-primary);
    text-decoration: underline;
    font-weight: 600;
}

.bot.message a {
    color: #2563eb;
}

/* Typing Indicator */
.typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px !important;
    background: #f1f5f9;
    border-radius: 15px 15px 15px 2px;
    margin-bottom: 10px;
    width: fit-content;
}

.typing span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.message::after {
    content: "";
    width: 28px;
    height: 28px;
    border-radius: 50%;
    position: absolute;
    bottom: -12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 11px;
    color: white;
}

.message.bot {
    background: #f1f5f9;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    margin-left: 35px;
}

.message.bot::after {
    left: -35px;
    bottom: 0;
    background: var(--chat-primary, #6366f1);
    content: "\f590";
    /* Headset */
}

.message.user {
    background: var(--chat-primary, #6366f1);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    margin-right: 35px;
}

.message.user::after {
    right: -35px;
    bottom: 0;
    background: #94a3b8;
    content: "\f007";
    /* User */
}

/* Form Styles */
.chat-form {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.chat-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.chat-form input:focus {
    border-color: var(--chat-primary);
}

.chat-form button {
    background: var(--chat-primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 5px;
    transition: opacity 0.2s;
}

.chat-form button:hover {
    opacity: 0.9;
}

/* Sohbeti Bitir Butonu */
.end-chat-btn {
    font-size: 11px;
    color: #ef4444;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 5px;
    display: inline-block;
}

/* Rating Stars */
.rating-area {
    text-align: center;
    padding: 20px;
}

.stars {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.star {
    font-size: 30px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s;
}

.star.active {
    color: #fbbf24;
}

.rating-comment {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.btn-rate-submit {
    background: #6366f1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

/* Suggested Options (Buttons) */
.suggested-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 0 10px;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.suggested-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--chat-primary);
    color: var(--chat-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.suggested-btn:hover {
    background: var(--chat-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}