/* TriggerTalk Widget General Styles */
:root {
    --triggertalk-primary: #4CAF50;
    --triggertalk-primary-dark: #388E3C;
    --triggertalk-text-dark: #333;
    --triggertalk-text-light: #fff;
    --triggertalk-background: #F4F5F7;
    --triggertalk-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --triggertalk-widget-bg: #F5F5DC;
}

.triggertalk-widget {
    position: fixed;
    z-index: 9999;
    font-family: var(--triggertalk-font);
}

/* Widget Positions */
.triggertalk-bottom-right {
    bottom: 20px;
    right: 20px;
}

.triggertalk-bottom-left {
    bottom: 20px;
    left: 20px;
}

.triggertalk-top-right {
    top: 20px;
    right: 20px;
}

.triggertalk-top-left {
    top: 20px;
    left: 20px;
}

/* Chat Box - New Design */
.triggertalk-chat {
    width: 350px;
    background: var(--triggertalk-widget-bg);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: bottom right;
    display: none; /* Initially hidden, controlled by JS */
}

.triggertalk-widget.triggertalk-bottom-left .triggertalk-chat,
.triggertalk-widget.triggertalk-top-left .triggertalk-chat {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.triggertalk-chat.show {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: triggertalk-slide-in 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes triggertalk-slide-in {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.triggertalk-chat-header {
    background: var(--triggertalk-primary);
    color: var(--triggertalk-text-light);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.triggertalk-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.triggertalk-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--triggertalk-text-light);
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.triggertalk-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Body */
.triggertalk-chat-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Welcome Message */
.triggertalk-welcome-message {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.triggertalk-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: #FEF3EF;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    overflow: hidden; /* Ensure images don't overflow the circle */
}

.triggertalk-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.triggertalk-avatar svg {
    width: 28px;
    height: 28px;
}

.triggertalk-message-content {
    font-size: 15px;
    line-height: 1.5;
    color: var(--triggertalk-text-dark);
}

.triggertalk-message-content strong {
    font-weight: 600;
}

/* Input Wrapper */
.triggertalk-input-wrapper {
    background: #fff;
    border-radius: 30px;
    padding: 8px;
    padding-left: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative; /* For send button */
}

#triggertalk-message-input {
    flex-grow: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--triggertalk-text-dark);
    height: 44px;
    padding-right: 50px; /* Space for send icon */
}

#triggertalk-message-input::placeholder {
    color: #aaa;
}

.triggertalk-send-icon {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.triggertalk-send-icon:hover {
    background-color: #f0f0f0;
}

.triggertalk-send-icon svg path {
    transition: fill 0.2s ease;
}

.triggertalk-send-icon:hover svg path {
    fill: var(--triggertalk-primary-dark);
}

/* Chat Footer */
.triggertalk-chat-footer {
    padding: 0 20px 20px 20px;
}

.triggertalk-send-btn {
    width: 100%;
    background: var(--triggertalk-primary);
    color: var(--triggertalk-text-light);
    border: none;
    padding: 15px 20px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
}

.triggertalk-send-btn:hover {
    background-color: var(--triggertalk-primary-dark);
}

.triggertalk-send-btn:active {
    transform: scale(0.98);
}

.triggertalk-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Sound Indicator - Removed as the button is removed */

/* Animation for initial button appearance - Removed */

/* Responsive */
@media (max-width: 480px) {
    .triggertalk-widget {
        right: 10px;
        bottom: 10px;
        left: 10px;
        max-width: calc(100vw - 20px);
    }
    .triggertalk-chat {
        width: 100%;
    }
    .triggertalk-bottom-right, .triggertalk-bottom-left,
    .triggertalk-top-right, .triggertalk-top-left {
        right: 10px;
        bottom: 10px;
        left: 10px;
        top: auto;
    }
}

/* Loading state */
.triggertalk-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Error state */
.triggertalk-error {
    background: #dc3545 !important;
}

/* Success state */
.triggertalk-success {
    background: #28a745 !important;
} 