/* Chat Layout - 3 Sütun Desktop */
.fanchaty-chat-layout {
    display: grid;
    grid-template-columns: 320px 1fr 380px;
    height: calc(100vh - 65px);
    background: #0a0a0a;
    position: relative;
}

/* Sol Sidebar - Chat Geçmişi */
.fanchaty-chat-sidebar {
    background: #141414;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.fanchaty-chat-sidebar.active {
    margin-left: 0;
}

.chat-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-sidebar-header h3 {
    color: white;
    font-size: 18px;
    margin: 0;
}

.toggle-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: none;
}

.chat-list-item {
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.chat-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-list-item.active {
    background: rgba(83, 79, 224, 0.1);
    border-left: 3px solid #534fe0;
}

.chat-list-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-list-info strong {
    color: white;
    font-size: 15px;
}

.chat-list-info span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Orta - Chat Alanı */
.fanchaty-chat-main {
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
}

.fanchaty-chat-header {
    padding: 16px 24px;
    background: #141414;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle-sidebar-btn,
.toggle-profile-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    display: none;
}

.chat-header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.chat-header-profile img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header-profile span {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

/* Mesajlar */
.fanchaty-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-message {
    text-align: center;
    padding: 20px;
}

.welcome-message p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 70%;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.bot {
    align-self: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.4;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #534fe0, #dd4791);
    color: white;
}

.chat-message.bot .message-bubble {
    background: #1a1a1a;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mesaj Input */
.fanchaty-chat-input {
    padding: 20px 24px;
    background: #141414;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    align-items: center;
}

.fanchaty-chat-input textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: white;
    padding: 14px 18px;
    font-size: 15px;
    resize: none;
    height: 50px;
    font-family: 'Poppins', sans-serif;
}

.fanchaty-chat-input textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fanchaty-chat-input textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.fanchaty-chat-input textarea:focus {
    outline: none;
    border-color: rgba(83, 79, 224, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.send-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #534fe0, #dd4791);
    border: none;
    border-radius: 14px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(83, 79, 224, 0.5);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sağ - Chatbot Profili */
.fanchaty-chat-profile {
    background: #141414;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    padding: 24px;
    transition: all 0.3s ease;
}

.profile-header {
    display: none;
}

.profile-avatar {
    margin-bottom: 24px;
}

.profile-avatar img {
    width: 100%;
    aspect-ratio: 832 / 1120;
    object-fit: cover;
    border-radius: 16px;
}

.profile-info h2 {
    color: white;
    font-size: 28px;
    margin: 0 0 16px 0;
}

.profile-info .age {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.profile-info .bio {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    line-height: 1.6;
}

/* Mobil - Sadece Chat */
@media (max-width: 1024px) {
    .fanchaty-chat-layout {
        grid-template-columns: 1fr;
    }
    
    .fanchaty-chat-sidebar {
        position: fixed;
        left: -100%;
        top: 65px;
        width: 320px;
        height: calc(100vh - 65px);
        z-index: 1000;
    }
    
    .fanchaty-chat-sidebar.active {
        left: 0;
    }
    
    .toggle-sidebar,
    .toggle-sidebar-btn,
    .toggle-profile-btn {
        display: flex !important;
    }
    
    .fanchaty-chat-profile {
        position: fixed;
        right: -100%;
        top: 65px;
        width: 380px;
        height: calc(100vh - 65px);
        z-index: 1000;
    }
    
    .fanchaty-chat-profile.active {
        right: 0;
    }
    
    .profile-header {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 16px;
    }
    
    .close-profile {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 20px;
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    .fanchaty-chat-layout {
        height: calc(100vh - 70px);
    }
    
    .fanchaty-chat-sidebar,
    .fanchaty-chat-profile {
        top: 70px;
        height: calc(100vh - 70px);
    }
    
    .fanchaty-chat-profile {
        width: 100%;
        right: -100%;
    }
}