/* Enhanced Chat Styles - İyileştirilmiş Versiyon */

/* Ana chat container - Desktop */
@media (min-width: 769px) {
    .flex-1.flex.flex-col.px-6 {
        max-width: 800px;
        margin: 0 auto;
        width: 100%;
        padding: 0 1.5rem;
        position: relative;
    }

    /* Mesaj balonları - Geliştirilmiş */
    .message-bubble {
        max-width: 70% !important;
        border-radius: 1.2rem;
        padding: 1rem 1.5rem;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        margin: 0.5rem 0;
        backdrop-filter: blur(10px);
    }

    /* Kullanıcı mesajları */
    .user-message .message-bubble {
        margin-left: auto;
        margin-right: 1rem;
        background: linear-gradient(135deg, #1EC98F 0%, #17A377 100%);
        color: #ffffff;
        transform-origin: right bottom;
        border-top-right-radius: 0.4rem;
        box-shadow: 0 4px 16px rgba(30, 201, 143, 0.25);
    }

    /* AI mesajları */
    .ai-message .message-bubble {
        margin-left: 1rem;
        margin-right: auto;
        background: linear-gradient(135deg, #2a2a2a 0%, #323232 100%);
        border: 1px solid rgba(255, 255, 255, 0.08);
        transform-origin: left bottom;
        border-top-left-radius: 0.4rem;
    }

    /* Hover efektleri - Daha yumuşak */
    .message-bubble:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }

    .user-message .message-bubble:hover {
        box-shadow: 0 6px 24px rgba(30, 201, 143, 0.35);
    }

    /* Chat input container */
    .chat-input-container {
        max-width: 800px;
        margin: 1.5rem auto;
        border-radius: 1.2rem;
        background: linear-gradient(180deg, #2a2a2a 0%, #2e2e2e 100%);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.06);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0.75rem;
    }

    .chat-input-container:focus-within {
        border-color: rgba(30, 201, 143, 0.5);
        box-shadow: 0 6px 24px rgba(30, 201, 143, 0.2);
        transform: translateY(-2px);
        background: linear-gradient(180deg, #2e2e2e 0%, #323232 100%);
    }

    /* Gönder butonu */
    .send-button {
        background: linear-gradient(135deg, #1EC98F 0%, #17A377 100%);
        box-shadow: 0 2px 12px rgba(30, 201, 143, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0.8rem;
    }

    .send-button:hover {
        transform: scale(1.08);
        box-shadow: 0 4px 16px rgba(30, 201, 143, 0.45);
    }

    .send-button:active {
        transform: scale(0.98);
    }

    /* Mesaj animasyonları */
    @keyframes messageAppear {
        0% {
            opacity: 0;
            transform: translateY(15px) scale(0.95);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .message-container {
        animation: messageAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        margin-bottom: 1.8rem;
    }

    /* Tipografi */
    .message-bubble p {
        font-size: 1rem;
        line-height: 1.65;
        color: #ffffff;
        margin: 0;
    }

    /* AI Avatar */
    .ai-message .w-8 {
        width: 2.5rem !important;
        height: 2.5rem !important;
        background: transparent;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(30, 201, 143, 0.15);
        margin-top: 0.5rem !important;
        transition: all 0.3s ease;
    }

    /* Hoş geldin bölümü */
    #welcome-section {
        max-width: 1000px;
        margin: 0 auto;
        padding: 3rem 2rem;
    }

    /* Hızlı eylemler */
    .quick-action {
        background: linear-gradient(135deg, #2a2a2a 0%, #323232 100%);
        border: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 1rem;
    }

    .quick-action:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        border-color: rgba(30, 201, 143, 0.4);
        background: linear-gradient(135deg, #2e2e2e 0%, #353535 100%);
    }

    /* Scrollbar styling */
    #chat-messages::-webkit-scrollbar {
        width: 8px;
    }

    #chat-messages::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.02);
        border-radius: 4px;
    }

    #chat-messages::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #1EC98F 0%, #17A377 100%);
        border-radius: 4px;
    }

    #chat-messages::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, #22D9A0 0%, #1AB584 100%);
    }
}

/* Yazma göstergesi */
.typing-indicator {
    padding: 1rem 0;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.typing-indicator.active {
    opacity: 1;
    transform: translateY(0);
}

/* Avatar pulse - Yazarken */
.typing-indicator.active .w-8 {
    animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(30, 201, 143, 0.15);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 4px 16px rgba(30, 201, 143, 0.3);
    }
}

/* Yazma noktaları animasyonu */
.typing-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1EC98F 0%, #17A377 100%);
    animation: typingWave 1.4s ease-in-out infinite;
    box-shadow: 0 2px 6px rgba(30, 201, 143, 0.4);
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingWave {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-12px) scale(1.3);
        opacity: 1;
    }
}

/* Yazma metni animasyonu */
.typing-indicator.active span.text-sm {
    animation: textFade 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes textFade {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Balon ışıltı efekti */
.typing-indicator.active .message-bubble {
    animation: bubbleGlow 2.5s ease-in-out infinite;
}

@keyframes bubbleGlow {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }
    50% {
        border-color: rgba(30, 201, 143, 0.25);
        box-shadow: 0 4px 20px rgba(30, 201, 143, 0.2);
    }
}

/* Pulse animasyonu */
.pulse-animation {
    animation: pulse 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Mesaj hizalama ve boşluklar */
.message-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 1.2rem 0;
    gap: 0.5rem;
}

.message-container.user-message {
    justify-content: flex-end;
}

.message-container.ai-message {
    justify-content: flex-start;
}

.user-message > .flex {
    width: 100%;
}

/* Mobil görünüm */
@media (max-width: 768px) {
    .message-bubble {
        border-radius: 1rem;
    }
    
    .user-message .message-bubble { 
        margin-right: 0.75rem;
        border-top-right-radius: 0.3rem;
    }
    
    .ai-message .message-bubble { 
        margin-left: 0.75rem;
        border-top-left-radius: 0.3rem;
    }
}

.message-container + .message-container {
    margin-top: 1rem;
}

/* Mesaj içeriği */
.message-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Markdown formatlaması */
.message-bubble strong {
    font-weight: 700;
    color: #1EC98F;
}

.message-bubble em {
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
}

.message-bubble code {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    margin: 0 0.15rem;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.1);
    color: #1EC98F;
    border: 1px solid rgba(30, 201, 143, 0.2);
}

/* Input alanı */
.chat-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chat-input:focus {
    border-color: rgba(30, 201, 143, 0.5);
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(30, 201, 143, 0.1);
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Görsel önizleme */
#image-preview-container {
    margin-bottom: 0.75rem;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#image-preview-container > div {
    position: relative;
    width: 96px;
    height: 96px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.75rem;
    overflow: hidden;
}

#image-preview-container > div:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.image-remove-btn {
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#image-preview-container > div:hover .image-remove-btn {
    opacity: 1;
}

.image-remove-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.15);
}