/* Avatar Chat Widget Styles */

/* Context-specific base styles */
.avatar-widget {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999999 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Landing page context styles */
.avatar-widget.landing-context {
    /* Landing page specific styles */
}

/* User panel context styles */
.avatar-widget.user-context {
    /* User panel specific styles */
}

.avatar-trigger {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    padding: 15px !important;
    cursor: pointer !important;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    width: 60px !important;
    height: 60px !important;
    font-size: 20px !important;
    font-weight: bold !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 999999 !important;
    justify-content: center !important;
}

.avatar-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.4);
}

.avatar-trigger i {
    font-size: 18px;
}

/* Chat Panel */
.avatar-chat-panel {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.1);
    pointer-events: auto !important;
    z-index: 999999 !important;
}

.avatar-chat-panel.open {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

/* Konu┼şma modu - panel b├╝y├╝r */
.avatar-chat-panel.voice-mode {
    width: 500px;
    height: 700px;
    transition: all 0.3s ease;
}

/* G├Âr├╝nt├╝l├╝ konu┼şma modu - panel boyutu ayn─▒ kal─▒r */
.avatar-chat-panel.video-call-mode {
    width: 400px;
    height: 600px;
    transition: all 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
}

.avatar-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-video {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

/* Konu┼şma modunda video b├╝y├╝r */
.avatar-chat-panel.voice-mode .avatar-video {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

/* G├Âr├╝nt├╝l├╝ konu┼şma modunda video ├ğok b├╝y├╝r ve ortaya gelir - chat penceresi boyutuna s─▒─şd─▒r */
.avatar-chat-panel.video-call-mode .avatar-video {
    width: 100%;
    height: 100%;
    max-width: 360px;
    max-height: 380px;
    object-fit: cover;
    border: 4px solid #10b981;
    border-radius: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.status-text {
    font-size: 14px;
    font-weight: 500;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-chat:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-toggle, .history-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    opacity: 0.8;
}

.mode-toggle:hover, .history-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.mode-toggle.active {
    background-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.history-toggle.active {
    background-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.video-call-toggle {
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 12px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 15px;
    transition: background-color 0.2s ease;
    opacity: 0.8;
    white-space: nowrap;
    font-weight: 500;
}

.video-call-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.video-call-toggle.active {
    background-color: #10b981 !important;
    opacity: 1;
}

.chat-toggle {
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 12px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 15px;
    transition: background-color 0.2s ease;
    opacity: 0.8;
    white-space: nowrap;
    font-weight: 500;
}

.chat-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.chat-toggle.active {
    background-color: #3b82f6 !important;
    opacity: 1;
}

/* Chat modu */
.avatar-chat-panel.chat-mode {
    width: 400px;
    height: 600px;
    transition: all 0.3s ease;
}

/* Context-specific chat panel styles */
.avatar-chat-panel.landing-context {
    /* Landing page chat panel styles */
    border: 2px solid #6366f1;
}

.avatar-chat-panel.landing-context .chat-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.avatar-chat-panel.user-context {
    /* User panel chat panel styles */
    border: 2px solid #10b981;
}

.avatar-chat-panel.user-context .chat-header {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* G├Âr├╝nt├╝l├╝ konu┼şma modunda chat messages gizlenir */
.avatar-chat-panel.video-call-mode .chat-messages {
    display: none;
}

/* Chat modunda video call elementleri gizlenir */
.avatar-chat-panel.chat-mode .video-call-status,
.avatar-chat-panel.chat-mode .siri-listening-button,
.avatar-chat-panel.chat-mode .start-conversation-button {
    display: none !important;
}

/* Video call modunda chat input ve voice button gizlenir */
.avatar-chat-panel.video-call-mode .chat-input,
.avatar-chat-panel.video-call-mode .voice-btn {
    display: none !important;
}

/* Video call modunda sadece close butonu ve status text gizlenir, tab'lar kal─▒r */
.avatar-chat-panel.video-call-mode .close-chat,
.avatar-chat-panel.video-call-mode .video-call-status {
    display: none !important;
}

/* Chat modunda voice button gizlenir - sadece metin chat */
.avatar-chat-panel.chat-mode .voice-btn {
    display: none !important;
}

/* G├Âr├╝nt├╝l├╝ konu┼şma modunda input alan─▒ k├╝├ğ├╝l├╝r */
.avatar-chat-panel.video-call-mode .chat-input {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 10px;
}

/* G├Âr├╝nt├╝l├╝ konu┼şma durumu g├Âstergesi */
.video-call-status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 15;
}

/* Konu┼şmaya Ba┼şla butonu */
.start-conversation-button {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    cursor: pointer;
    display: none; /* Varsay─▒lan olarak gizli */
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    z-index: 15;
}

/* Dinleme animasyonu */
.start-conversation-button.listening {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse 1.5s infinite;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* ─░┼şleniyor durumunda buton t─▒klanamaz */
.start-conversation-button.processing {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.7;
}


@keyframes pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

@keyframes listeningPulse {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.2); }
}

/* Avatar konu┼şma animasyonu */
.avatar-video.speaking {
    animation: speakingPulse 0.8s infinite;
    border-color: #10b981 !important;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4) !important;
}

@keyframes speakingPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.02); }
}

/* Konu┼şmay─▒ Bitir butonu */
.end-call-button {
    position: absolute;
    bottom: 60px;
    right: 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    transition: all 0.3s ease;
    z-index: 15;
}

.end-call-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Video call modunda g├Âster */
.avatar-chat-panel.video-call-mode .end-call-button {
    display: flex !important;
}

/* Video call modunda g├Âster */
.avatar-chat-panel.video-call-mode .start-conversation-button {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.start-conversation-button:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.4);
}

.start-conversation-button i {
    font-size: 18px;
}

/* Siri tarz─▒ dinleme butonu */
.siri-listening-button {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
    z-index: 15;
}

.siri-listening-button:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.4);
}

.siri-listening-button.listening {
    animation: siriPulse 1.5s infinite;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

@keyframes siriPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
    }
    50% {
        transform: translateX(-50%) scale(1.1);
        box-shadow: 0 12px 35px rgba(239, 68, 68, 0.5);
    }
}

/* Dinleme/Konu┼şma animasyonu */
.listening-indicator {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 15;
}

.listening-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.listening-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.listening-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

/* Chat ge├ğmi┼şi gizli */
.chat-messages.hidden {
    display: none;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.message.assistant {
    background: white;
    color: #374151;
    align-self: flex-start;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    align-self: flex-start;
    max-width: 80px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.typing-indicator.active {
    display: flex;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    pointer-events: auto !important;
    background: white !important;
    color: black !important;
    cursor: text !important;
}

.chat-input input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.voice-btn, .send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.voice-btn {
    background: #f3f4f6;
    color: #6b7280;
}

.voice-btn:hover {
    background: #e5e7eb;
}

.voice-btn.active {
    background: #ef4444;
    color: white;
    animation: pulse 1s infinite;
}

.send-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

@keyframes 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);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .avatar-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .avatar-trigger {
        min-width: 160px;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .avatar-chat-panel {
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 15px;
        left: 15px;
        border-radius: 15px;
    }
    
    .chat-header {
        border-radius: 15px 15px 0 0;
    }
}

@media (max-width: 480px) {
    .avatar-trigger {
        min-width: 140px;
        padding: 10px 14px;
        font-size: 12px;
    }
    
    .avatar-trigger span {
        display: none;
    }
    
    .avatar-trigger i {
        font-size: 20px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

