/* ===================================================================
 * AI Chatbot Widget Styles
 * Gemini API ile çalışan akıllı sohbet botu
 * =================================================================== */

/* Chatbot Float Button */
.chatbot-trigger {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 123, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(0, 123, 255, 0.5);
}

.chatbot-trigger svg {
    width: 28px;
    height: 28px;
    color: white;
}

.chatbot-trigger .close-icon {
    display: none;
}

.chatbot-trigger.active .chat-icon {
    display: none;
}

.chatbot-trigger.active .close-icon {
    display: block;
}

/* Unread Badge */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #dc3545;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow: hidden;
}

.chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: move; /* Draggable */
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-info {
    flex: 1;
}

.chatbot-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-actions {
    display: flex;
    gap: 8px;
}

.chatbot-action-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chatbot-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-action-btn svg {
    width: 16px;
    height: 16px;
}

/* Chatbot Body */
.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    max-height: 450px;
}

.chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message Bubble */
.chatbot-message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.chatbot-message.user .chatbot-message-avatar {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.chatbot-message-content {
    max-width: 75%;
}

.chatbot-message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 14px;
    line-height: 1.5;
}

.chatbot-message.user .chatbot-message-bubble {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.chatbot-message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    padding: 0 8px;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    width: fit-content;
}

.chatbot-typing-dot {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Quick Replies */
.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chatbot-quick-reply {
    background: white;
    border: 2px solid #007bff;
    color: #007bff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chatbot-quick-reply:hover {
    background: #007bff;
    color: white;
}

/* Chatbot Footer */
.chatbot-footer {
    padding: 16px;
    background: white;
    border-top: 1px solid #dee2e6;
}

.chatbot-input-group {
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chatbot-input:focus {
    border-color: #007bff;
}

.chatbot-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Powered by */
.chatbot-powered {
    text-align: center;
    padding: 8px 16px;
    font-size: 11px;
    color: #6c757d;
    background: #f8f9fa;
}

.chatbot-powered a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

/* Dark Mode */
body.dark-mode .chatbot-window {
    background: #242830;
}

body.dark-mode .chatbot-body {
    background: #1a1d23;
}

body.dark-mode .chatbot-message-bubble {
    background: #2d3238;
    color: #e9ecef;
}

body.dark-mode .chatbot-input {
    background: #2d3238;
    border-color: #3a3f47;
    color: #e9ecef;
}

body.dark-mode .chatbot-footer {
    background: #242830;
    border-top-color: #3a3f47;
}

body.dark-mode .chatbot-quick-reply {
    background: #2d3238;
    border-color: #007bff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-trigger {
        bottom: 20px;
        left: 20px;
        width: 56px;
        height: 56px;
    }
    
    .chatbot-window {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }
    
    .chatbot-body {
        max-height: calc(100vh - 200px);
    }
}

/* Error State */
.chatbot-error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    margin: 8px 0;
}

/* Loading State */
.chatbot-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6c757d;
    font-size: 13px;
}
