/* Ada AI Assistant Widget Styles - Minimalist Clean Design */
:root {
    --ada-primary-color: #0066cc;
    --ada-text-dark: #1a1a1a;
    --ada-text-light: #666;
    --ada-bg-light: #f8f9fa;
    --ada-border-color: #e0e0e0;
    --ada-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --ada-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);
}

#ada-widget[data-primary-color] {
    --ada-primary-color: attr(data-primary-color);
}

/* Widget positioning */
#ada-widget {
    position: fixed;
    z-index: 9999 !important; /* !important para PS 1.6 */
}

#ada-widget.ada-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

#ada-widget.ada-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

#ada-widget.ada-position-top-right {
    top: 80px;
    right: 20px;
}

#ada-widget.ada-position-top-left {
    top: 80px;
    left: 20px;
}

/* Toggle button */
.ada-button {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: #0066cc; /* Fallback */
    background: var(--ada-primary-color);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* Fallback */
    box-shadow: var(--ada-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.ada-button .ada-custom-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.ada-button:hover {
    transform: scale(1.05);
    box-shadow: var(--ada-shadow-lg);
}

.ada-button:active {
    transform: scale(0.95);
}

.ada-notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #ff3b30;
    border-radius: 50%;
    border: 2px solid white;
}

/* Chat container */
.ada-container {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: var(--ada-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.ada-position-bottom-left .ada-container {
    right: auto;
    left: 0;
}

.ada-position-top-right .ada-container {
    bottom: auto;
    top: 70px;
}

.ada-position-top-left .ada-container {
    bottom: auto;
    top: 70px;
    right: auto;
    left: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.ada-header {
    background: var(--ada-primary-color);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.ada-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.ada-header-actions {
    display: flex;
    gap: 8px;
}

.ada-icon-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ada-icon-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages area */
.ada-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--ada-bg-light);
    scroll-behavior: smooth;
}

.ada-message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ada-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
}

.ada-message-user {
    justify-content: flex-end;
}

.ada-message-user .ada-message-content {
    background: var(--ada-primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.ada-message-assistant .ada-message-content {
    background: white;
    color: var(--ada-text-dark);
    border: 1px solid var(--ada-border-color);
    border-bottom-left-radius: 4px;
}

/* Typing indicator */
.ada-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.ada-typing span {
    width: 8px;
    height: 8px;
    background: var(--ada-text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.ada-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ada-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input area */
.ada-input-container {
    border-top: 1px solid var(--ada-border-color);
    background: white;
    padding: 16px 20px;
}

#ada-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#ada-input {
    flex: 1;
    border: 1px solid var(--ada-border-color);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
}

#ada-input:focus {
    outline: none;
    border-color: var(--ada-primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.ada-send-button {
    background: var(--ada-primary-color);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ada-send-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.ada-send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.ada-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Suggestions */
.ada-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ada-suggestion {
    background: white;
    border: 1px solid var(--ada-border-color);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--ada-text-dark);
}

.ada-suggestion:hover {
    background: var(--ada-primary-color);
    color: white;
    border-color: var(--ada-primary-color);
}

/* Error message */
.ada-error {
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

/* Link styling in messages */
.ada-message-content a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

.ada-message-assistant .ada-message-content a {
    color: var(--ada-primary-color);
}

/* Scrollbar */
.ada-messages::-webkit-scrollbar {
    width: 6px;
}

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

.ada-messages::-webkit-scrollbar-thumb {
    background: var(--ada-border-color);
    border-radius: 3px;
}

.ada-messages::-webkit-scrollbar-thumb:hover {
    background: var(--ada-text-light);
}

/* Mobile responsive */
@media (max-width: 768px) {
    #ada-widget {
        bottom: 10px;
        right: 10px;
    }

    .ada-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: -10px;
    }

    .ada-button {
        width: 56px;
        height: 56px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --ada-bg-light: #1a1a1a;
        --ada-border-color: #333;
        --ada-text-dark: #f5f5f5;
        --ada-text-light: #aaa;
    }

    .ada-container,
    .ada-input-container,
    #ada-input {
        background: #2a2a2a;
        color: var(--ada-text-dark);
    }

    .ada-message-assistant .ada-message-content {
        background: #333;
        border-color: #444;
    }
}
