/*
 * QuickCare Live Chat Widget Styles
 * File: public/assets/css/chat-widget.css
 */

:root {
    --chat-primary: #5e2594;
    --chat-primary-light: #7c44b2;
    --chat-background: #ffffff;
    --chat-header-text: #ffffff;
    --chat-body-background: #f8f9fc;
    --chat-sent-bubble: #5e2594;
    --chat-sent-text: #ffffff;
    --chat-received-bubble: #e9ecef;
    --chat-received-text: #2c3e50;
    --chat-border-color: #e9ecef;
    --chat-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    --chat-font: 'Roboto', 'Open Sans', sans-serif;
}

.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    font-family: var(--chat-font);
}

.chat-widget-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chat-primary-light), var(--chat-primary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--chat-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
}

.chat-widget-button:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.chat-widget-window {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 370px;
    max-height: 600px;
    height: 80vh;
    background-color: var(--chat-body-background);
    border-radius: 16px;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

/* Hide/show animations */
.chat-widget-window.hidden {
    transform: scale(0);
    opacity: 0;
}
.chat-widget-button.hidden {
    transform: scale(0);
    opacity: 0;
}

.chat-widget-header {
    background: linear-gradient(135deg, var(--chat-primary-light), var(--chat-primary));
    color: var(--chat-header-text);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-widget-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: white !important;
}

#chat-widget-close-button {
    background: none;
    border: none;
    color: var(--chat-header-text);
    font-size: 1.8rem;
    line-height: 1;
    opacity: 0.8;
    cursor: pointer;
    transition: all 0.2s ease;
}
#chat-widget-close-button:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.chat-widget-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Session List View */
#chat-session-list-view {
    padding: 1rem;
}
.chat-channel-list h4, .chat-session-list-container h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--chat-primary);
    margin-bottom: 0.75rem;
}
.chat-channel-list ul, .chat-session-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.chat-channel-list li a, .chat-session-item {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--chat-background);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--chat-received-text);
    font-weight: 500;
    border-left: 4px solid var(--chat-primary-light);
    transition: all 0.2s ease;
}
.chat-channel-list li a:hover, .chat-session-item:hover {
    background-color: #f1f3f9;
    transform: translateX(5px);
    border-left-color: var(--chat-primary);
}

/* Message View */
#chat-message-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--chat-border-color);
    background: var(--chat-background);
}
#chat-back-to-sessions-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--chat-primary);
    cursor: pointer;
    margin-right: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
}
#chat-back-to-sessions-button:hover {
    background-color: var(--chat-received-bubble);
}
#chat-current-channel-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--chat-primary);
    margin: 0;
}

#chat-messages-container {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    padding: 0.6rem 1rem;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.sent {
    background-color: var(--chat-sent-bubble);
    color: var(--chat-sent-text);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-message.received {
    background-color: var(--chat-received-bubble);
    color: var(--chat-received-text);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

#chat-typing-indicator {
    padding: 0 1rem 0.5rem;
    font-style: italic;
    color: #6c757d;
    font-size: 0.85rem;
}

.chat-message-input-area {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--chat-border-color);
    background: var(--chat-background);
    gap: 0.75rem;
    align-items: center;
}

#chat-message-input {
    flex-grow: 1;
    border-radius: 20px;
    padding: 10px 15px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
    resize: none;
    transition: border-color 0.2s ease;
}
#chat-message-input:focus {
    outline: none;
    border-color: var(--chat-primary);
}

#chat-send-button {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: var(--chat-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
#chat-send-button:hover {
    background-color: var(--chat-primary-light);
    transform: scale(1.1);
}
#chat-send-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
