/* ===============================================
   CHATBOT STYLES - Agile Çözüm
   Modern, responsive chatbot UI with theme support
   =============================================== */

/* Chat Bubble Button */
.chatbot-bubble {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-blue), #3B82F6);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(31, 110, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    border: none;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(31, 110, 234, 0.6);
}

.chatbot-bubble i {
    font-size: 1.8rem;
    color: white;
}

.chatbot-bubble.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Chat Window Container */
.chatbot-window {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 380px;
    max-width: calc(100vw - 50px);
    height: 550px;
    max-height: calc(100vh - 150px);
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.chatbot-window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--primary-blue), #3B82F6);
    color: white;
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary-blue);
}

.chatbot-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.chatbot-status {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 2px;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-secondary);
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-items: flex-start;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, var(--primary-blue), #3B82F6);
    color: white;
}

.message.user .message-avatar {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-light);
}

.message-content {
    max-width: 75%;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary-blue), #3B82F6);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

/* Service Selection Buttons */
.service-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.service-btn {
    background: var(--bg-primary);
    border: 2px solid var(--primary-blue);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-btn:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateX(5px);
}

.service-btn i {
    font-size: 1.1rem;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.3rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Chat User Input (Conversational Style) */
.chatbot-user-input {
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chatbot-user-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 0.9rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-user-input input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(31, 110, 234, 0.1);
}

.chatbot-user-input input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-user-input button {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue), #3B82F6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-user-input button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(31, 110, 234, 0.3);
}

.chatbot-user-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Clear History Button - Removed since no longer using localStorage */


/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-bubble {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }

    .chatbot-bubble i {
        font-size: 1.5rem;
    }

    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 85px;
        right: 20px;
    }

    .chatbot-messages {
        padding: 1rem;
    }

    .message-content {
        max-width: 80%;
    }
}

/* Dark Theme Specific Adjustments */
html[data-theme="dark"] .chatbot-window {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .message.bot .message-bubble {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}