/* Risepage AI Chat - Polished CSS v6.3.4
   Exact same visual appearance - only cleaner, more maintainable code */

#risepage-ai-chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
}

/* Floating Chat Button */
#risepage-ai-chat-button {
    width: 54px;
    height: 54px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    transition: all 0.2s ease;
}

#risepage-ai-chat-button:hover {
    transform: scale(1.12);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

/* Chat Window */
#risepage-ai-chat-window {
    display: none;
    width: 360px;
    height: 520px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    flex-direction: column;
    position: absolute;
    bottom: 78px;
    right: 0;
    z-index: 99999;
}

/* Menu & Close Buttons */
#risepage-ai-menu-btn,
#risepage-ai-close {
    position: absolute;
    top: 12px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    z-index: 10;
    background: none;
    border: none;
}
#risepage-ai-menu-btn { left: 14px; }
#risepage-ai-close { right: 14px; }
#risepage-ai-menu-btn:hover,
#risepage-ai-close:hover { color: #000; }

/* Messages Area */
#risepage-ai-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.risepage-ai-msg {
    max-width: 78%;
    padding: 11px 15px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
}
.risepage-ai-msg.bot {
    align-self: flex-start;
    background: #e9ecef;
    border-bottom-left-radius: 5px;
}
.risepage-ai-msg.user {
    align-self: flex-end;
    background: #000;
    color: #fff;
    border-bottom-right-radius: 5px;
}

/* Input Area */
#risepage-ai-input-area {
    padding: 12px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}
#risepage-ai-input {
    flex: 1;
    padding: 13px 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}
#risepage-ai-image-btn {
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
}
#risepage-ai-image-btn:hover { color: #333; }
#risepage-ai-image-btn.active { color: #222; }

/* History Panel */
#risepage-ai-history-panel {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    height: calc(100% - 50px);
    background: #fff;
    z-index: 10;
    display: none;
    flex-direction: column;
    border-top: 1px solid #eee;
}
.history-header {
    padding: 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.new-chat-btn {
    background: #000;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}
#risepage-ai-history-list {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    max-height: 420px;
}
.history-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.view-history-btn,
.rename-history-btn,
.delete-history-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
}
.view-history-btn,
.rename-history-btn { color: #666; }
.delete-history-btn { color: #ff4444; }

/* Image Modal */
#risepage-ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 999999999;
    display: none;
    align-items: center;
    justify-content: center;
}
#risepage-ai-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}
#risepage-ai-modal-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
#risepage-ai-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 42px;
    height: 42px;
    background: #fff;
    color: #000;
    border: 3px solid #000;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
#risepage-ai-modal-close-btn:hover {
    background: #000;
    color: #fff;
    transform: scale(1.1);
}
#risepage-ai-modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
#risepage-ai-modal-actions button {
    padding: 12px 24px;
    font-size: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #000;
    color: #fff;
}
#risepage-ai-modal-actions button:hover {
    background: #333;
}
