/**
 * Chat Widget Styles
 */

/* Widget container */
body {
    font-family: 'Roboto', sans-serif;
    font-weight: 400; /* Light weight */
}
.chat-widget-container {
    --theme-color: #6C47FF;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chat-widget-container.iframe-mode {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Widget button */
.chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background-color: var(--theme-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.chat-widget-button:hover {
    transform: scale(1.05);
}

.chat-widget-button svg {
    width: 28px;
    height: 28px;
}

/* Widget panel */
.chat-widget-panel {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    flex-direction: column;
    overflow: hidden;
}

.iframe-mode .chat-widget-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Position-specific styles */
.chat-widget-container[style*="bottom-left"] .chat-widget-panel {
    bottom: 100px;
    right: 20px;
    left: auto;
    top: auto;
}

.chat-widget-container[style*="top-right"] .chat-widget-panel {
    top: 100px;
    right: 20px;
    bottom: auto;
    left: auto;
}

.chat-widget-container[style*="top-left"] .chat-widget-panel {
    top: 100px;
    left: 20px;
    bottom: auto;
    right: auto;
}

.chat-widget-container[style*="bottom-right"] .chat-widget-panel {
    bottom: 100px;
    right: 20px;
    left: auto;
    top: auto;
}

/* Widget header */
.chat-widget-header {
    background: var(--theme-color);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-widget-header,
.chat-header {
    background: var(--theme-color);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.end-chat-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
    border-radius: 6px;
}

.end-chat-button:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.1);
}

.end-chat-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-widget-back {
    cursor: pointer;
    padding: 4px;
}

.chat-widget-back svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.chat-widget-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-image {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    background: white;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
}

.profile-status {
    font-size: 13px;
    opacity: 0.9;
}

/* Messages container */
.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #F8F9FB;
}

/* Message bubbles */
.chat-widget-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 80%;
}

.chat-widget-message.assistant {
    align-self: flex-start;
}

.chat-widget-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-widget-message.assistant .message-content {
    background: white;
    color: #1A1A1A;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-widget-message.user .message-content {
    background: var(--theme-color);
    color: white;
}

/* Typing indicator */
.chat-widget-typing {
    display: none;
    padding: 8px 20px;
    align-items: center;
    gap: 8px;
}

.chat-widget-typing.active {
    display: flex;
}

.typing-avatar {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    overflow: hidden;
}

.typing-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.typing-indicator {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D1D1D1;
    animation: typing 1s infinite;
}

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

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

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Input area */
.chat-widget-input {
    padding: 16px;
    background: white;
    border-top: 1px solid #EAEAEA;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.chat-widget-input textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    font-family: inherit;
}

.chat-widget-input textarea::placeholder {
    color: #999;
}

.chat-widget-send {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--theme-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-widget-send:hover {
    transform: scale(1.1);
}

.chat-widget-send svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

/* Minimized state for iframe mode */
.chat-widget-panel.minimized {
    height: 72px;
    cursor: pointer;
}

.chat-widget-panel.minimized .chat-widget-messages,
.chat-widget-panel.minimized .chat-widget-input,
.chat-widget-panel.minimized .chat-widget-typing {
    display: none;
}

/* Expand button for minimized iframe widget */
.chat-widget-expand {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background-color: var(--theme-color);
    color: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.chat-widget-expand:hover {
    transform: scale(1.05);
}

.chat-widget-expand svg {
    width: 28px;
    height: 28px;
} 

/* Rating Modal Styles */
.rating-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rating-modal.show {
    opacity: 1;
    visibility: visible;
}

.rating-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.rating-modal.show .rating-content {
    transform: scale(1);
}

.rating-content h3 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.rating-content p {
    color: #666;
    font-size: 14px;
    margin-bottom: 24px;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.star {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.star:hover,
.star.active {
    color: #ffd700;
    transform: scale(1.1);
}

.star.active {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rating-text {
    margin-bottom: 24px;
    min-height: 20px;
}

.rating-text p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.rating-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.skip-button,
.submit-button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.skip-button {
    background-color: #f5f5f5;
    color: #666;
}

.skip-button:hover {
    background-color: #e0e0e0;
}

.submit-button {
    background-color: var(--theme-color);
    color: white;
}

.submit-button:hover:not(:disabled) {
    background-color: #5a3de6;
    transform: translateY(-1px);
}

.submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Animation for rating submission */
.rating-submitted {
    animation: fadeOutScale 0.5s ease forwards;
}

@keyframes fadeOutScale {
    to {
        opacity: 0;
        transform: scale(0.8);
    }
} 