/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

    .chatbot-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    }

/* Badge (Kırmızı Bildirim) */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

/* Badge Pulse Animasyonu (Büyüyüp Küçülme) */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    }

    50% {
        transform: scale(1.2);
        box-shadow: 0 4px 16px rgba(255, 68, 68, 0.6);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    }
}

/* Chatbot açıldığında badge'i gizle */
.chatbot-window.active ~ .chatbot-toggle .chatbot-badge {
    display: none;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

    .chatbot-window.active {
        display: flex;
    }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chatbot-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

    .chatbot-close-btn:hover {
        opacity: 0.8;
    }

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message-icon {
    font-size: 20px;
    margin-top: 4px;
    flex-shrink: 0;
}

/* Bot Message - Beyaz arka plan, koyu metin */
.message-text {
    background: white;
    color: #2c3e50;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
}

.bot-message .message-icon {
    color: #667eea;
}
/* Badge varsayılan olarak gizli, JavaScript gösterecek */
.chatbot-badge-hidden {
    display: none !important;
}
/* User Message - Mor arka plan, beyaz metin */
.user-message {
    display: flex;
    justify-content: flex-end;
}

    .user-message .message-content {
        flex-direction: row-reverse;
    }

    .user-message .message-icon {
        color: #28a745;
    }

    .user-message .message-text {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }

/* Error Message - Kırmızı arka plan, koyu metin */
.error-message .message-icon {
    color: #dc3545;
}

.error-message .message-text {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Input Container */
.chatbot-input-container {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
    color: #2c3e50;
    background: white;
}

    .chatbot-input::placeholder {
        color: #6c757d;
    }

    .chatbot-input:focus {
        border-color: #667eea;
    }

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

    .chatbot-send-btn:hover:not(:disabled) {
        transform: scale(1.05);
    }

    .chatbot-send-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Loading */
.chatbot-loading {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 14px;
}

/* Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

    .chatbot-messages::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

/* ===== RESPONSIVE (MOBİL DÜZELTMELERİ) ===== */

/* Tablet ve küçük ekranlar */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-toggle {
        width: 65px;
        height: 65px;
        font-size: 28px;
    }

    .chatbot-window {
        width: calc(100vw - 30px);
        max-width: 380px;
        height: 450px;
        right: -15px; /* Sağ hizalama düzeltmesi */
    }
}

/* Mobil telefonlar (küçük ekranlar) */
@media (max-width: 480px) {
    .chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .chatbot-toggle {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }

    .chatbot-badge {
        width: 22px;
        height: 22px;
        font-size: 12px;
        top: -3px;
        right: -3px;
    }

    .chatbot-window {
        position: fixed; /* absolute yerine fixed */
        bottom: 75px;
        right: 10px;
        left: 10px; /* Sol taraftan da boşluk */
        width: calc(100vw - 20px); /* Tam genişlik */
        max-width: none; /* Max width kaldır */
        height: calc(100vh - 150px); /* Ekran yüksekliğine göre */
        max-height: 500px;
        border-radius: 12px;
    }

    .chatbot-header {
        padding: 12px 16px;
        font-size: 14px;
    }

    .chatbot-messages {
        padding: 15px;
    }

    .message-text {
        max-width: 80%;
        font-size: 14px;
        padding: 10px 12px;
    }

    .chatbot-input-container {
        padding: 12px;
    }

    .chatbot-input {
        font-size: 14px;
        padding: 8px 12px;
    }

    .chatbot-send-btn {
        width: 36px;
        height: 36px;
    }
}

/* Çok küçük telefonlar */
@media (max-width: 360px) {
    .chatbot-window {
        bottom: 65px;
        height: calc(100vh - 130px);
    }

    .chatbot-toggle {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
}
