/* AI Controller - Gelişmiş Chatbot UI */
:root {
    --ai-primary: #4A8FE7;
    --ai-secondary: #2E5BBA;
    --ai-accent: #60a5fa;
    --ai-bg: rgba(15, 23, 42, 0.95);
    --ai-white-border: rgba(255, 255, 255, 0.8);
    --ai-neon-glow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Ana Konteynır - Yatay Hareket İçin Hazır */
.ai-widget-container {
    position: fixed;
    bottom: 10px;
    left: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 15px;
    font-family: 'Inter', sans-serif;
    transition: align-items 0.3s ease; /* Sürüklerken gecikme olmaması için left geçişi kaldırıldı */
}

/* Sağ tarafa yaklaşıldığında hizalamayı değiştir */
.ai-widget-container.right-side {
    align-items: flex-end;
}

/* Başlatma / Durum Butonu - Sade Haline Dönüş */
.ai-status-circle {
    width: 65px;
    height: 65px;
    background: var(--ai-bg);
    backdrop-filter: blur(15px);
    border: 2px solid var(--ai-white-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--ai-neon-glow), 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    user-select: none;
}

.ai-status-circle:hover {
    transform: scale(1.1);
}

/* Hoparlör/Sessiz Butonu - Gelişmiş UX */
.ai-mute-btn {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #0f172a;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 2px solid white;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-mute-btn:hover { transform: scale(1.1); }

.ai-mute-btn.muted {
    background: #f3f4f6;
    color: #9ca3af;
}

/* Kırmızı Çizgi (Slash) Efekti */
.ai-mute-btn.muted::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #ef4444;
    transform: rotate(-45deg);
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

.ai-icon-inner {
    width: 32px;
    height: 32px;
    pointer-events: none;
}

/* Ses Dalgaları (Konuşurken) */
.ai-status-circle.speaking::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: ai-wave 1.5s infinite;
}

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

/* Chat Penceresi */
.ai-chat-window {
    width: 350px;
    height: 450px;
    background: var(--ai-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--ai-white-border);
    border-radius: 24px;
    box-shadow: var(--ai-neon-glow), 0 20px 50px rgba(0,0,0,0.6);
    display: none; /* Başlangıçta kapalı */
    flex-direction: column;
    overflow: hidden;
    animation: slideInUp 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-chat-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header-info {
    display: flex;
    flex-direction: column;
}

.ai-header-title {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
}

.ai-header-status {
    font-size: 11px;
    color: var(--ai-accent);
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 5px #10b981;
}

/* Mesaj Alanı */
.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.ai-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    position: relative;
}

.ai-message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.ai-message.user {
    align-self: flex-end;
    background: var(--ai-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Giriş Alanı */
.ai-chat-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

.ai-text-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px 15px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: 0.3s;
}

.ai-text-input:focus {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.ai-send-btn, .ai-mic-btn {
    width: 38px;
    height: 38px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

.ai-send-btn:hover, .ai-mic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.ai-mic-btn.recording {
    background: #ef4444;
    animation: mic-pulse 1s infinite;
}

@keyframes mic-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.ai-send-btn svg, .ai-mic-btn svg {
    color: var(--ai-bg);
}

.ai-mic-btn.recording svg {
    color: #fff;
}

/* Kapatma Butonu */
.ai-close-btn {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: 0.2s;
}

.ai-close-btn:hover {
    color: #fff;
}

/* Başlatma Rozeti */
.ai-start-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #fff;
    color: #0f172a;
    font-size: 10px;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
    white-space: nowrap;
}
