/* =====================================================
   AI CANLI DESTEK WIDGET (Sağ alt köşede yüzen)
   ===================================================== */

.ai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    font-family: var(--sans, 'Inter', sans-serif);
}

/* TOGGLE BUTONU */
.ai-chat-toggle {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #0bbcc7 0%, #14d4dc 100%);
    color: #001a1c;
    cursor: pointer;
    box-shadow: 
        0 12px 32px rgba(11, 188, 199, 0.45),
        0 0 0 6px rgba(11, 188, 199, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 
        0 16px 40px rgba(11, 188, 199, 0.6),
        0 0 0 8px rgba(11, 188, 199, 0.15);
}

.ai-chat-toggle-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4rem;
    transition: opacity 0.2s, transform 0.2s;
}

.ai-icon-close {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg) scale(0.5);
}

.ai-chat-widget.open .ai-icon-chat {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg) scale(0.5);
}

.ai-chat-widget.open .ai-icon-close {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* Pulse efekti */
.ai-chat-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(11, 188, 199, 0.6);
    animation: ai-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes ai-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* SOHBET PENCERESİ */
.ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #0a1424;
    border: 1px solid rgba(78, 168, 255, 0.25);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(78, 168, 255, 0.1);
}

.ai-chat-widget.open .ai-chat-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* HEADER */
.ai-chat-header {
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(11, 188, 199, 0.12) 0%, rgba(20, 212, 220, 0.08) 100%);
    border-bottom: 1px solid rgba(78, 168, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0bbcc7 0%, #14d4dc 100%);
    color: #001a1c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ai-chat-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.ai-chat-status {
    font-size: 0.72rem;
    color: #6dd5ff;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 8px #2ecc71;
    animation: status-blink 2s ease-in-out infinite;
}

@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-chat-close {
    width: 32px;
    height: 32px;
    background: transparent;
    color: #94a3b8;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* MESAJLAR */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(78, 168, 255, 0.2);
    border-radius: 3px;
}

.ai-msg {
    display: flex;
    gap: 10px;
    animation: msg-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes msg-appear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.ai-msg-bot .ai-msg-avatar {
    background: linear-gradient(135deg, #0bbcc7 0%, #14d4dc 100%);
    color: #001a1c;
}

.ai-msg-bubble {
    max-width: 78%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-msg-bot .ai-msg-bubble {
    background: rgba(78, 168, 255, 0.1);
    color: #e8eef7;
    border: 1px solid rgba(78, 168, 255, 0.15);
    border-top-left-radius: 6px;
}

.ai-msg-user {
    flex-direction: row-reverse;
}

.ai-msg-user .ai-msg-avatar {
    background: rgba(78, 168, 255, 0.2);
    color: #6dd5ff;
}

.ai-msg-user .ai-msg-bubble {
    background: linear-gradient(135deg, #0bbcc7 0%, #14d4dc 100%);
    color: #001a1c;
    border-top-right-radius: 6px;
    font-weight: 500;
}

/* Hızlı yanıt butonları */
.ai-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    margin-left: 42px;
}

.ai-quick-btn {
    padding: 8px 14px;
    background: rgba(78, 168, 255, 0.08);
    border: 1px solid rgba(78, 168, 255, 0.2);
    color: #6dd5ff;
    border-radius: 50px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.ai-quick-btn:hover {
    background: rgba(78, 168, 255, 0.15);
    border-color: rgba(78, 168, 255, 0.4);
    color: #fff;
}

/* Typing göstergesi */
.ai-chat-typing {
    padding: 8px 18px;
}

.ai-typing-dots {
    display: inline-flex;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(78, 168, 255, 0.1);
    border: 1px solid rgba(78, 168, 255, 0.15);
    border-radius: 16px;
    border-top-left-radius: 6px;
    margin-left: 42px;
}

.ai-typing-dots span {
    width: 7px;
    height: 7px;
    background: #6dd5ff;
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.ai-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* FORM */
.ai-chat-form {
    padding: 12px 16px;
    border-top: 1px solid rgba(78, 168, 255, 0.15);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    background: rgba(15, 29, 51, 0.5);
}

.ai-chat-form input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(78, 168, 255, 0.08);
    border: 1px solid rgba(78, 168, 255, 0.2);
    border-radius: 50px;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.ai-chat-form input::placeholder {
    color: #6b7d96;
}

.ai-chat-form input:focus {
    border-color: rgba(78, 168, 255, 0.5);
    background: rgba(78, 168, 255, 0.12);
}

.ai-chat-form button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0bbcc7 0%, #14d4dc 100%);
    color: #001a1c;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.ai-chat-form button:hover {
    transform: scale(1.05);
}

.ai-chat-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer not */
.ai-chat-footer-note {
    padding: 8px 18px 12px;
    font-size: 0.7rem;
    color: #6b7d96;
    text-align: center;
    background: rgba(15, 29, 51, 0.5);
    flex-shrink: 0;
    line-height: 1.4;
}

.ai-chat-footer-note i {
    color: #6dd5ff;
    margin-right: 4px;
}

.ai-chat-footer-note a {
    color: #6dd5ff;
    text-decoration: none;
}

.ai-chat-footer-note a:hover {
    text-decoration: underline;
}

/* MOBİL */
@media (max-width: 480px) {
    .ai-chat-widget {
        bottom: 16px;
        right: 16px;
    }
    
    .ai-chat-toggle {
        width: 56px;
        height: 56px;
    }
    
    .ai-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 72px;
    }
}
