﻿/* Synet AI Chat Widget - Modern Design v3 */

:root {
    --synet-color: #667eea;
    --synet-color-dark: #5568d3;
    --synet-gradient: linear-gradient(135deg, var(--synet-color) 0%, #764ba2 100%);
    --synet-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --synet-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#synet-ai-widget {
    position: fixed !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    box-sizing: border-box !important;
}

.synet-widget-bottom-right {
    bottom: 24px;
    right: 24px;
}

.synet-widget-bottom-left {
    bottom: 24px;
    left: 24px;
}

/* ========================================
   💎 ULTRA AGGRESSIVE PULSE ANIMATION
   ======================================== */

/* Pulse animation - uses CSS variables set by panel settings */
@keyframes synetUltraPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--synet-pulse-color-start);
    }
    50% {
        transform: scale(var(--synet-pulse-scale));
        box-shadow: 0 0 0 var(--synet-pulse-spread) var(--synet-pulse-color-transparent),
                    0 0 40px var(--synet-pulse-color-mid);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--synet-pulse-color-transparent);
    }
}

@keyframes synetMegaGlow {
    0%, 100% {
        filter: drop-shadow(0 0 15px var(--synet-pulse-color-mid))
                drop-shadow(0 0 30px var(--synet-pulse-color-low));
    }
    50% {
        filter: drop-shadow(0 0 30px var(--synet-pulse-color-full))
                drop-shadow(0 0 50px var(--synet-pulse-color-mid))
                drop-shadow(0 0 70px var(--synet-pulse-color-low));
    }
}

@keyframes synetShakeAttention {
    0%, 100% { transform: translateX(0) scale(1); }
    10% { transform: translateX(calc(-2px * var(--synet-shake-intensity, 1))) scale(calc(1 + 0.03 * var(--synet-shake-intensity, 1))); }
    20% { transform: translateX(calc(2px * var(--synet-shake-intensity, 1))) scale(calc(1 + 0.06 * var(--synet-shake-intensity, 1))); }
    30% { transform: translateX(calc(-2px * var(--synet-shake-intensity, 1))) scale(calc(1 + 0.03 * var(--synet-shake-intensity, 1))); }
    40% { transform: translateX(calc(2px * var(--synet-shake-intensity, 1))) scale(1); }
}

/* Pulse animation class - ULTRA AGGRESSIVE */
/* Animation timing is set dynamically by JavaScript based on strength setting */
.synet-ultra-pulse {
    /* Animation will be added dynamically by JavaScript */
}

/* ========================================
   💬 WELCOME BUBBLE - 16:9 FORMAT
   ======================================== */

.synet-welcome-bubble {
    position: absolute !important;
    bottom: 80px !important;
    right: 0 !important;
    width: 320px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-radius: 16px !important;
    padding: 0 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 
                0 2px 8px rgba(0, 0, 0, 0.08) !important;
    opacity: 0 !important;
    transform: translateY(10px) scale(0.95) !important;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    pointer-events: none !important;
    z-index: 99997 !important;
    border: 1px solid rgba(102, 126, 234, 0.1) !important;
    overflow: hidden !important;
}

/* 16:9 aspect ratio container */
.synet-bubble-inner {
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 16px 20px !important;
    position: relative !important;
}

/* Decorative gradient overlay */
.synet-bubble-inner::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: var(--synet-gradient) !important;
}

/* Arrow pointer */
.synet-welcome-bubble::after {
    content: '' !important;
    position: absolute !important;
    bottom: -8px !important;
    right: 28px !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 10px solid transparent !important;
    border-right: 10px solid transparent !important;
    border-top: 10px solid #f8fafc !important;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1)) !important;
}

/* Show state */
.synet-welcome-bubble.synet-bubble-show {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: all !important;
}

/* Message text */
.synet-bubble-message {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    padding-right: 30px !important;
    text-align: left !important;
}

/* Close button */
.synet-bubble-close {
    position: absolute !important;
    top: 12px !important;
    right: 20px !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: rgba(15, 23, 42, 0.05) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    line-height: 1 !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    border: none !important;
    font-family: Arial, sans-serif !important;
}

.synet-bubble-close:hover {
    background: rgba(15, 23, 42, 0.1) !important;
    color: #1e293b !important;
    transform: scale(1.1) !important;
}

/* Hover effect on entire bubble */
.synet-welcome-bubble:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 
                0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(102, 126, 234, 0.2) !important;
}

/* Entrance animation */
@keyframes synetBubbleEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    60% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.synet-welcome-bubble.synet-bubble-show {
    animation: synetBubbleEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Responsive */
@media (max-width: 480px) {
    .synet-welcome-bubble {
        width: calc(100vw - 90px) !important;
        max-width: 320px !important;
        right: 10px !important;
        bottom: 70px !important;
    }
    
    .synet-bubble-message {
        font-size: 13px !important;
    }
}

/* Toggle Button */
.synet-widget-toggle {
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
    background: var(--synet-gradient) !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    box-shadow: var(--synet-shadow-sm) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
    z-index: 99999 !important;
}

.synet-widget-toggle:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: var(--synet-shadow);
}

.synet-widget-toggle:active {
    transform: scale(0.98);
}

.synet-widget-toggle svg {
    display: block;
}

/* Widget Window - FIXED POSITIONING */
.synet-widget-window {
    position: fixed !important;
    bottom: 100px !important;  /* Alttan 30px yukarı */
    right: 15px !important;   /* Sağdan 30px sola */
    width: 370px;
    height: 670px;
    background: white;
    border-radius: 24px;
    box-shadow: var(--synet-shadow) !important;
    display: none;
    flex-direction: column !important;
    overflow: hidden !important;
    margin: 0 !important;
    z-index: 999999 !important;
}

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

/* Header */
.synet-widget-header {
    background: var(--synet-gradient);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.synet-widget-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Logo instead of emoji */
.synet-widget-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.synet-widget-name {
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.synet-widget-status {
    font-size: 12px;
    opacity: 0.95;
    font-weight: 400;
}

/* Header Actions */
.synet-widget-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ==== KAPATMA (X) BUTONU ==== */
.synet-icon-btn  {
  background: none !important;
  border: none !important;
  color: #fff !important;
  font-size: 20px !important;
  cursor: pointer !important;
  padding: 2px 4px !important;
  line-height: 1 !important;
  opacity: 0.6 !important;
}
.synet-icon-btn :hover,
.synet-icon-btn :hover i,
.synet-icon-btn :hover svg {
  color: #A3A3A3 !important;
  opacity: 1 !important;
  transform: scale(1.1) !important;
  transition: all 0.2s ease !important;
}

/* Messages Container */
.synet-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    scroll-behavior: smooth;
}

.synet-widget-messages::-webkit-scrollbar {
    width: 6px;
}

.synet-widget-messages::-webkit-scrollbar-track {
    background: transparent;
}

.synet-widget-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.synet-widget-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Messages */
.synet-message {
    margin-bottom: 16px;
    display: flex;
    animation: messageSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.synet-message-user {
    justify-content: flex-end;
}

.synet-message-bubble {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.synet-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.synet-message-assistant .synet-message-content {
    background: white;
    color: #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-bottom-left-radius: 4px;
}

.synet-message-user .synet-message-content {
    background: var(--synet-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    border-bottom-right-radius: 4px;
}

/* Message Timestamp - WhatsApp Style */
.synet-message-time {
    font-size: 11px;
    margin-top: 4px;
    padding: 0 4px;
}

.synet-message-assistant .synet-message-time {
    color: #383d43;
    text-align: left;
    opacity: 0.8;
}

.synet-message-user .synet-message-time {
    color: #383d43;
    text-align: right;
    opacity: 0.8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Typing Indicator */
.synet-message-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    align-items: center;
}

.synet-typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.synet-typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.synet-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.synet-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.synet-widget-input {
    padding: 16px !important;
    background: white !important;
    border-top: 1px solid #e5e7eb !important;
    display: flex !important;
    gap: 12px !important;
    align-items: flex-end !important;
    box-sizing: border-box !important;
}

#synet-widget-textarea {
    flex: 1 !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 14px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    resize: none !important;
    max-height: 70px !important;
    font-family: inherit !important;
    transition: all 0.2s !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-height: 40px !important; height: 40px !important;
    background: white !important;
    color: #2d3748 !important;
}

#synet-widget-textarea:focus {
    outline: none;
    border-color: var(--synet-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.synet-widget-send-btn {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: var(--synet-gradient) !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 44px !important;
    min-height: 40px !important; height: 40px !important;
}

.synet-widget-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.synet-widget-send-btn:active {
    transform: scale(0.95);
}

.synet-widget-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.synet-widget-send-btn svg {
    display: block;
}

/* Footer - NEW LAYOUT */
.synet-widget-footer {
    padding: 10px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Left: Footer Actions (Language + Clear) */
.synet-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Footer Buttons - Only Icons Visible */
.synet-footer-btn {
    background: none !important;
    border: none !important;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0 !important;
}

.synet-footer-btn:hover {
    transform: scale(1.15);
}

.synet-footer-btn:active {
    transform: scale(0.9);
}

.synet-footer-btn svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    color: #4b5563 !important;
    fill: currentColor !important;
    opacity: 0.7 !important;
}

.synet-footer-btn:hover svg {
    color: #1f2937 !important;
    opacity: 1 !important;
}

/* Dil Menüsü Kapsayıcı */
.synet-lang-menu {
    position: absolute !important;
    bottom: 35px;
    left: 10 !important;
    background: white !important;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 0 !important; /* Dış padding sıfır */
    min-width: 110px !important; max-width: 140px !important; max-height: 320px !important; overflow-y: auto !important;
    z-index: 99999;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

/* Her Bir Dil Seçeneği */
.synet-lang-option {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100%;
    padding: 4px 8px !important;
    min-height: 30px !important;
    border: none !important;
    background: white !important;
    cursor: pointer;
    font-size: 11px !important;
    color: #4b4b4b !important;
    text-align: left;
    line-height: 1.2 !important;
    transition: background 0.2s;
}

/* İkon ile Yazı Arasındaki Boşluk */
.synet-lang-option img, 
.synet-lang-option span:first-child {
    margin-right: 8px !important;
    display: inline-block;
}

.synet-lang-menu {
    padding: 4px 0 !important;
}

.synet-lang-option + .synet-lang-option {
    margin-top: 0 !important;
}

/* Üzerine Gelince (Hover) Ayarları */
.synet-lang-option:hover {
    background: #f8f9fa !important; /* Üzerine gelince sadece çok hafif gri arka plan */
    color: #000000 !important;      /* YAZI RENGİ DEĞİŞMEYECEK (SİYAH KALACAK) */
}

/* Eğer buton içinde span varsa onun rengini de siyah yapalım */
.synet-lang-option span {
    color: #000000 !important;
}
.synet-lang-option:hover {
    background: #f0f0f0;
}

/* Center: Powered by */
.synet-powered-by {
    font-size: 11px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.synet-powered-by strong {
    color: var(--synet-color);
    font-weight: 600;
}

.synet-powered-by svg {
    color: var(--synet-color);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .synet-widget-window {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        animation: slideUpMobile 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999999 !important;
    }
    
    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .synet-widget-bottom-right,
    .synet-widget-bottom-left {
        bottom: 20px;
        right: 20px;
    }
    
    .synet-widget-toggle {
        width: 58px;
        height: 58px;
    }
}
    
    .synet-widget-header {
        padding: 18px;
    }
    
    .synet-widget-name {
        font-size: 16px;
    }
    
    .synet-message-bubble {
        max-width: 85%;
    }
}

/* Smooth Transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* İkonların görünmesini garanti altına alalım */
.synet-widget-send-btn svg,
.synet-lang-toggle svg,
.synet-clear-chat svg {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 20px !important;
    min-height: 20px !important;
}

/* Send butonu tasarımı */
.synet-widget-send-btn {
    background: var(--synet-gradient) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ==== FORCE SIZE – Prevent Theme/CartFlows Override ==== */

#synet-ai-widget .synet-widget-toggle{
  width: 60px !important;
  height: 60px !important;
  min-width: 60px !important;
  min-height: 60px !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 0 !important;
}

#synet-ai-widget .synet-widget-toggle svg,
#synet-ai-widget .synet-widget-toggle img{
  width: 26px !important;
  height: 26px !important;
}

/* Send button fix */
#synet-ai-widget .synet-send-button{
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 40px !important; height: 40px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#synet-ai-widget .synet-send-button svg{
  width: 18px !important;
  height: 18px !important;
}

/* === CartFlows/theme overrides fix: keep send icon stable === */
.synet-widget-send-btn{
  /* CartFlows bazen button padding/font-size şişiriyor */
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 0 !important;   /* svg 1em ise şişmeyi keser */
}

.synet-widget-send-btn svg{
  width: 18px !important;
  height: 18px !important;
  display: block;
  flex: 0 0 auto;
}

.synet-widget-send-btn svg *{
  vector-effect: non-scaling-stroke; /* stroke büyümesi varsa */
}