#egh-chat-wrapper {
    display: flex;
    width: 100%;
    max-width: 1200px;
    height: 600px;
    margin: 20px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    background: #fff;
    font-family: 'Tahoma', 'Segoe UI', sans-serif;
}

.egh-sidebar {
    width: 280px;
    background: #f3f4f6;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.egh-sidebar.egh-collapsed {
    width: 60px;
}

.egh-sidebar-header {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.egh-new-chat-btn {
    width: 100%;
    padding: 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.egh-new-chat-btn:hover {
    background: #2563eb;
}

.egh-theme-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    float: right;
    margin-top: 4px;
}

.egh-theme-btn:hover {
    background: #e5e7eb;
}

.egh-conversations {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.egh-conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    background: #fff;
    transition: background 0.2s;
}

.egh-conversation-item:hover {
    background: #e5e7eb;
}

.egh-conversation-item.active {
    background: #dbeafe;
    font-weight: 600;
}

.egh-conversation-actions {
    display: none;
    gap: 4px;
}

.egh-conversation-item:hover .egh-conversation-actions {
    display: flex;
}

.egh-conversation-actions button {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    color: #6b7280;
}

.egh-conversation-actions button:hover {
    background: #d1d5db;
}

.egh-sidebar-footer {
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.egh-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.egh-profile-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
}

.egh-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.egh-sidebar.egh-collapsed .egh-profile-name {
    display: none;
}

.egh-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.egh-chat-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.egh-toggle-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.egh-toggle-btn:hover {
    background: #e5e7eb;
}

.egh-chat-header h2 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
    flex: 1;
    margin-left: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.egh-rename-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #6b7280;
}

.egh-rename-btn:hover {
    background: #e5e7eb;
}

.egh-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.egh-message {
    display: flex;
    gap: 10px;
}

.egh-message.egh-user {
    justify-content: flex-end;
}

.egh-message.egh-bot {
    justify-content: flex-start;
}

.egh-msg-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.egh-user .egh-msg-content {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 2px;
}

.egh-bot .egh-msg-content {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 2px;
}

.egh-input-area {
    display: flex;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    gap: 10px;
}

#egh-input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    min-height: 44px;
    max-height: 120px;
}

#egh-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.egh-send-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.egh-send-btn:hover {
    background: #2563eb;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    #egh-chat-wrapper {
        height: 100vh;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }

    .egh-sidebar {
        position: absolute;
        left: -280px;
        top: 0;
        height: 100%;
        z-index: 100;
        transition: left 0.3s ease;
    }

    .egh-sidebar.egh-open {
        left: 0;
    }

    .egh-main {
        margin-left: 0;
    }

    .egh-toggle-btn {
        display: block;
    }

    .egh-profile-name {
        display: none;
    }

    .egh-sidebar-footer {
        display: none;
    }
}
