/* ===== AI CHAT WIDGET ===== */

/* Chat butonu - sağ alt köşe */
.chat-widget-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-yellow), var(--secondary-yellow));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    border: none;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

.chat-widget-button i {
    font-size: 28px;
    color: var(--primary-black);
}

.chat-widget-button.active {
    background: var(--danger-red);
}

/* Bildirim badge */
.chat-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-red);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat penceresi */
.chat-widget-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-widget-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat header */
.chat-widget-header {
    background: linear-gradient(135deg, var(--primary-yellow), var(--secondary-yellow));
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
}

.chat-widget-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-widget-avatar {
    width: 45px;
    height: 45px;
    background: var(--primary-black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-yellow);
    font-size: 20px;
}

.chat-widget-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-black);
}

.chat-widget-status {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-widget-status-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-widget-close {
    background: none;
    border: none;
    color: var(--primary-black);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.chat-widget-close:hover {
    transform: rotate(90deg);
}

/* Chat mesajları */
.chat-widget-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-widget-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-widget-messages::-webkit-scrollbar-thumb {
    background: var(--primary-yellow);
    border-radius: 10px;
}

/* Mesaj baloncukları */
.chat-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-message.bot .chat-message-avatar {
    background: var(--primary-yellow);
    color: var(--primary-black);
    padding: 3px;
}

.chat-message.bot .chat-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.chat-message.user .chat-message-avatar {
    background: var(--primary-black);
    color: var(--primary-yellow);
}

.chat-message-content {
    max-width: 80%;
}

.chat-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.bot .chat-message-bubble {
    background: white;
    color: var(--primary-black);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-message.user .chat-message-bubble {
    background: var(--primary-yellow);
    color: var(--primary-black);
    border-bottom-right-radius: 4px;
}

.chat-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    padding: 0 5px;
}

.chat-message.user .chat-message-time {
    text-align: right;
}

/* Typing indicator */
.chat-typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.chat-typing-indicator.active {
    display: flex;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-yellow);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Chat input */
.chat-widget-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-widget-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-widget-input input:focus {
    border-color: var(--primary-yellow);
}

.chat-widget-send-btn {
    width: 45px;
    height: 45px;
    background: var(--primary-yellow);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--primary-black);
    font-size: 18px;
}

.chat-widget-send-btn:hover {
    background: var(--secondary-yellow);
    transform: scale(1.05);
}

.chat-widget-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: scale(1);
}

/* Hoş geldin mesajı */
.chat-welcome-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.chat-welcome-message i {
    font-size: 48px;
    color: var(--primary-yellow);
    margin-bottom: 15px;
}

.chat-welcome-message h4 {
    margin: 10px 0;
    color: var(--primary-black);
}

.chat-welcome-message p {
    font-size: 14px;
    margin: 5px 0;
}

/* Hızlı sorular */
.chat-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.chat-quick-question {
    padding: 8px 14px;
    background: white;
    border: 2px solid var(--primary-yellow);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--primary-black);
}

.chat-quick-question:hover {
    background: var(--primary-yellow);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .chat-widget-window {
        width: calc(100% - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        bottom: 80px;
    }
    
    .chat-widget-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}

/* Dark mode */
body.dark-mode .chat-widget-window {
    background: #1a1a1a;
}

body.dark-mode .chat-widget-messages {
    background: #2a2a2a;
}

body.dark-mode .chat-message.bot .chat-message-bubble {
    background: #333;
    color: white;
}

body.dark-mode .chat-widget-input {
    background: #1a1a1a;
    border-top-color: #333;
}

body.dark-mode .chat-widget-input input {
    background: #333;
    color: white;
    border-color: #444;
}
