/* Rupcharcha AI Frontend Styles - uses CSS variables injected by PHP */

/* Launcher Button */
.rupcharcha-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--rupcharcha-primary-color);
    color: var(--rupcharcha-text-color);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
    z-index: 9998;
}

.rupcharcha-launcher:hover {
    transform: scale(1.1);
}

.rupcharcha-launcher svg {
    width: 30px;
    height: 30px;
    fill: var(--rupcharcha-text-color);
}


/* Chat Window */
.rupcharcha-chat-widget {
    position: fixed;
    z-index: 9999;
}

.rupcharcha-chat-window {
    font-family: var(--rupcharcha-font-family);
    display: none;
    flex-direction: column;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Chat Header */
.rupcharcha-chat-header {
    background: var(--rupcharcha-primary-color);
    color: var(--rupcharcha-text-color);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rupcharcha-header-info {
    display: flex;
    align-items: center;
}

.rupcharcha-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.rupcharcha-chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.rupcharcha-close-btn {
    background: none;
    border: none;
    color: var(--rupcharcha-text-color);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

/* Chat Body */
.rupcharcha-chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.rupcharcha-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.rupcharcha-message p {
    margin: 0;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Bot messages */
.rupcharcha-message.bot {
    align-items: flex-start;
}
.rupcharcha-message.bot p {
    background: var(--rupcharcha-secondary-color);
    color: #333;
    border-bottom-left-radius: 4px;
}

/* User messages */
.rupcharcha-message.user {
    align-items: flex-end;
}
.rupcharcha-message.user p {
    background: var(--rupcharcha-primary-color);
    color: var(--rupcharcha-text-color);
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.rupcharcha-message.typing-indicator p {
    padding: 10px 15px;
    background: var(--rupcharcha-secondary-color);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.rupcharcha-message.typing-indicator .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #aaa;
    margin: 0 2px;
    animation: typing-blink 1.4s infinite both;
}

.rupcharcha-message.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.rupcharcha-message.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}


/* Chat Footer */
.rupcharcha-chat-footer {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.rupcharcha-chat-footer textarea {
    flex: 1;
    border: none;
    padding: 10px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    background: #f0f0f1;
    border-radius: 20px;
    height: 24px; /* for single line */
    max-height: 80px; /* max height before scroll */
    line-height: 24px;
    padding-left: 15px;
    padding-right: 15px;
}

.rupcharcha-chat-footer textarea:focus {
    outline: none;
}

.rupcharcha-send-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rupcharcha-send-btn svg {
    fill: var(--rupcharcha-primary-color);
    width: 24px;
    height: 24px;
}

