/* aruna-chatbot/assets/css/style.css */
:root {
    --ac-primary: #101828;
    --ac-secondary: #475467;
    --ac-accent: #3b82f6;
    --ac-accent-hover: #2563eb;
    --ac-bg: #f9fafb;
    --ac-white: #ffffff;
    --ac-border: #eaecf0;
    --ac-shadow-sm: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
    --ac-shadow-lg: 0 12px 24px -4px rgba(16, 24, 40, 0.08), 0 4px 8px -4px rgba(16, 24, 40, 0.03);
    --ac-shadow-xl: 0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03);
    --ac-radius: 16px;
    --ac-font: 'Inter', sans-serif;
}

.aruna-chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999999;
    font-family: var(--ac-font);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ac-launcher {
    width: 60px;
    height: 60px;
    background: var(--ac-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ac-white);
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--ac-shadow-lg);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease;
    position: relative;
    z-index: 2;
}

.ac-launcher:hover {
    transform: scale(1.05);
    background: #1d2939;
}

.ac-launcher .ac-icon-open,
.ac-launcher .ac-icon-close {
    position: absolute;
    transition: all 0.3s ease;
}

.ac-launcher .ac-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

.aruna-chatbot-widget.is-open .ac-launcher .ac-icon-open {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

.aruna-chatbot-widget.is-open .ac-launcher .ac-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.ac-window {
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 100px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--ac-radius);
    box-shadow: var(--ac-shadow-xl);
    position: absolute;
    bottom: 80px;
    right: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.aruna-chatbot-widget.is-open .ac-window {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.ac-header {
    background: var(--ac-primary);
    color: var(--ac-white);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--ac-shadow-sm);
}

.ac-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ac-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ac-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    color: #ffffff;
}

.ac-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ac-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
}

.ac-header-actions button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s ease, transform 0.3s ease;
    padding: 8px;
    border-radius: 50%;
}

.ac-header-actions button:hover {
    color: var(--ac-white);
    background: rgba(255, 255, 255, 0.1);
}

.ac-messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(to bottom, transparent, rgba(249, 250, 251, 0.5));
}

.ac-messages-container::-webkit-scrollbar {
    width: 6px;
}

.ac-messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.ac-messages-container::-webkit-scrollbar-thumb {
    background: #d0d5dd;
    border-radius: 10px;
}

.ac-msg-row {
    display: flex;
    width: 100%;
    animation: acFadeInUp 0.4s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes acFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ac-msg-row.bot {
    justify-content: flex-start;
}

.ac-msg-row.user {
    justify-content: flex-end;
}

.ac-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: var(--ac-shadow-sm);
}

.ac-msg-row.bot .ac-bubble {
    background: var(--ac-white);
    color: var(--ac-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--ac-border);
}

.ac-msg-row.user .ac-bubble {
    background: var(--ac-primary);
    color: var(--ac-white);
    border-bottom-right-radius: 4px;
}

.ac-welcome-card {
    text-align: center;
}

.ac-welcome-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ac-primary);
}

.ac-welcome-card p {
    margin: 0;
    font-size: 14px;
    color: var(--ac-secondary);
    line-height: 1.4;
}

.ac-input-area {
    padding: 16px;
    background: var(--ac-white);
    border-top: 1px solid var(--ac-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ac-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ac-btn-option {
    background: var(--ac-white);
    border: 1px solid var(--ac-border);
    color: var(--ac-primary);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--ac-shadow-sm);
}

.ac-btn-option:hover {
    background: var(--ac-bg);
    border-color: var(--ac-primary);
    transform: translateY(-1px);
}

.ac-input-wrapper {
    display: flex;
    gap: 8px;
}

.ac-input-wrapper input, .ac-input-wrapper select {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--ac-border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--ac-font);
}

.ac-input-wrapper input:focus, .ac-input-wrapper select:focus {
    border-color: var(--ac-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ac-text-input.ac-input-error {
    border-color: #ef4444 !important;
}

.ac-input-error-msg {
    color: #ef4444;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    animation: acShake 0.4s ease-in-out;
}

@keyframes acShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.ac-btn-send {
    background: var(--ac-primary);
    color: var(--ac-white);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ac-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
    background: var(--ac-white);
    border: 1px solid var(--ac-border);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.ac-typing-dot {
    width: 6px;
    height: 6px;
    background: var(--ac-secondary);
    border-radius: 50%;
    animation: acTyping 1.4s infinite ease-in-out both;
}

.ac-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ac-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes acTyping {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.ac-attention-bubble {
    position: relative;
    background: var(--ac-white);
    color: var(--ac-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 20px 20px 4px 20px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
    margin-bottom: 10px;
    white-space: nowrap;
    border: 1px solid var(--ac-border);
    animation: acBubblePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               acBubbleBlink 2s ease-in-out 0.5s infinite;
    transform-origin: bottom right;
    cursor: pointer;
}

.ac-attention-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 14px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-top: 8px solid var(--ac-white);
}

@keyframes acBubblePop {
    0%   { opacity: 0; transform: scale(0.4) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes acBubbleBlink {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.04); box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2); }
}

.aruna-chatbot-widget.is-open .ac-attention-bubble {
    display: none;
}

.ac-footer {
    padding: 8px;
    text-align: center;
    background: var(--ac-white);
    border-top: 1px solid var(--ac-border);
    font-size: 11px;
    color: var(--ac-secondary);
}

.pac-container {
    z-index: 1000000000 !important;
}

@media (max-width: 480px) {
    .ac-window {
        width: calc(100vw - 40px);
        right: -4px;
        bottom: 70px;
    }
}
