/* ============================================
   GÃ–KO CHATBOT - MOBILE MINIMAL TASARIM
   Mobilde minimal, desktop'te normal
   ============================================ */

/* Root positioning - Daima sag alta */
#goko-chatbot-root {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 99999 !important;
    font-family: var(--sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   TOGGLE BUTTON
   ============================================ */

.goko-chat-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.4),
        0 0 0 0 rgba(102, 126, 234, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: chatbotPulse 3s ease-in-out infinite;
}

@keyframes chatbotPulse {
    0%, 100% {
        box-shadow: 
            0 8px 32px rgba(102, 126, 234, 0.4),
            0 0 0 0 rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 
            0 8px 32px rgba(102, 126, 234, 0.4),
            0 0 0 20px rgba(102, 126, 234, 0);
    }
}

.goko-chat-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 
        0 12px 40px rgba(102, 126, 234, 0.6),
        0 0 0 0 rgba(102, 126, 234, 0.5);
}

.goko-chat-toggle svg {
    width: 32px;
    height: 32px;
    fill: white;
    transition: all 0.3s ease;
}

.goko-chat-toggle .close-icon {
    display: none;
    position: absolute;
}

.goko-chat-toggle.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.goko-chat-toggle.active .chat-icon {
    display: none;
}

.goko-chat-toggle.active .close-icon {
    display: block;
}

/* ============================================
   WELCOME MESSAGE - İlk Ziyaret
   ============================================ */

.goko-welcome-bubble {
    position: fixed;
    bottom: 110px;
    right: 20px;
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    animation: bubbleSlideIn 0.5s ease forwards 2s;
    pointer-events: all;
    z-index: 99998;
    cursor: pointer;
    transition: all 0.3s ease;
}

@keyframes bubbleSlideIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bubbleSlideOut {
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
}

.goko-welcome-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
}

.goko-welcome-bubble p {
    margin: 0;
    color: #1a1f3a;
    font-size: 14px;
    line-height: 1.5;
}

.goko-welcome-bubble .bubble-emoji {
    font-size: 20px;
    margin-right: 8px;
}

.goko-welcome-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
    color: #666;
}

.goko-welcome-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.goko-welcome-bubble:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* ============================================
   CHAT WINDOW - Desktop Normal, Mobile Minimal
   ============================================ */

.goko-chat-window {
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(102, 126, 234, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatWindowSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes chatWindowSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.goko-chat-window.active {
    display: flex;
}

/* ============================================
   HEADER
   ============================================ */

.goko-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.goko-chat-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 70%);
    border-radius: 50%;
}

.goko-chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.goko-chat-avatar::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #00E676;
    border: 3px solid white;
    border-radius: 50%;
    bottom: 0;
    right: 0;
}

.goko-chat-header-info {
    position: relative;
    z-index: 1;
}

.goko-chat-header-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--serif);
}

.goko-chat-header-info p {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.95;
}

/* ============================================
   MESSAGES
   ============================================ */

.goko-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.goko-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.goko-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.goko-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.goko-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.goko-chat-message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.goko-chat-message.user {
    flex-direction: row-reverse;
}

.goko-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.goko-chat-message.bot .goko-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.goko-chat-message.user .goko-message-avatar {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.goko-message-content {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.goko-chat-message.bot .goko-message-content {
    background: white;
    color: #1a1f3a;
    border-bottom-left-radius: 4px;
}

.goko-chat-message.user .goko-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */

.goko-typing-indicator {
    display: none;
    gap: 6px;
    padding: 14px 18px;
    background: white;
    border-radius: 16px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.goko-typing-indicator.active {
    display: flex;
}

.goko-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: typingBounce 1.4s infinite;
}

.goko-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.goko-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* ============================================
   INPUT AREA
   ============================================ */

.goko-chat-input {
    padding: 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 12px;
    align-items: center;
}

.goko-chat-input input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: var(--sans);
}

.goko-chat-input input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.goko-chat-input input::placeholder {
    color: #9aa0a6;
}

.goko-chat-input button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.goko-chat-input button:hover:not(:disabled) {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.goko-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   MOBILE RESPONSIVE - Minimal Tasarım
   ============================================ */

@media (max-width: 768px) {
    #goko-chatbot-root {
        bottom: 20px !important;
        right: 15px !important;
    }
    
    .goko-chat-toggle {
        width: 56px;
        height: 56px;
    }
    
    .goko-chat-toggle svg {
        width: 28px;
        height: 28px;
    }
    
    /* Chat penceresi mobilde daha küçük ve minimal */
    .goko-chat-window {
        width: calc(100vw - 30px);
        height: auto;
        max-height: 70vh;
        bottom: 76px;
        right: 15px;
        max-width: 100%;
        border-radius: 16px;
    }
    
    /* Welcome bubble mobilde de minimal */
    .goko-welcome-bubble {
        max-width: calc(100vw - 80px);
        right: 15px;
        bottom: 90px;
        font-size: 13px;
        padding: 12px 16px;
    }
    
    .goko-welcome-bubble p {
        font-size: 13px;
    }
    
    .goko-chat-header {
        padding: 16px 20px;
    }
    
    .goko-chat-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .goko-chat-header-info h3 {
        font-size: 16px;
    }
    
    .goko-chat-header-info p {
        font-size: 12px;
    }
    
    .goko-chat-messages {
        padding: 16px;
        gap: 12px;
    }
    
    .goko-message-content {
        font-size: 13px;
        padding: 12px 14px;
        max-width: 80%;
    }
    
    .goko-chat-input {
        padding: 12px 16px;
        gap: 10px;
    }
    
    .goko-chat-input input {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .goko-chat-input button {
        width: 44px;
        height: 44px;
    }
    
    .goko-chat-input button svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .goko-chat-window {
        width: calc(100vw - 20px);
        bottom: 70px;
        right: 10px;
    }
    
    .goko-welcome-bubble {
        max-width: calc(100vw - 60px);
        right: 10px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .goko-chat-toggle,
    .goko-chat-window,
    .goko-chat-message,
    .goko-welcome-bubble {
        animation: none !important;
    }
}

.goko-chat-toggle:focus,
.goko-chat-input button:focus,
.goko-chat-input input:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}