/* ===================================
   AI Chat Widget Styles
   =================================== */

/* Chat Button - Floating in bottom right */
.chat-widget-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color, #2E256D);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(46, 37, 109, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s ease;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(46, 37, 109, 0.6);
    background: var(--primary-hover, #1f1849);
}

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

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    pointer-events: none;
}

.chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

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

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

.chat-header small {
    display: block;
    opacity: 0.9;
    font-size: 12px;
    margin-top: 4px;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Message Bubbles */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: messageSlideIn 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
    background: var(--primary-color, #2E256D);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai {
    align-self: flex-start;
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message.ai strong {
    color: var(--primary-color, #2E256D);
}

.message.error {
    align-self: center;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

/* Loading Indicator */
.chat-loading {
    align-self: flex-start;
    background: white;
    padding: 12px 20px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 6px;
    border: 1px solid #e0e0e0;
}

.chat-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color, #2E256D);
    animation: loading 1.4s infinite;
}

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

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

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

/* Chat Input Area */
.chat-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 16px 16px;
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--primary-color, #2E256D);
}

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

.chat-send {
    background: var(--primary-color, #2E256D);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-send:hover:not(:disabled) {
    transform: scale(1.1);
    background: var(--primary-hover, #1f1849);
}

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

.chat-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-window {
        width: calc(100% - 20px);
        height: calc(100% - 140px);
        right: 10px;
        bottom: 90px;
        border-radius: 12px;
    }
    
    .chat-widget-button {
        right: 20px;
        bottom: 20px;
    }
    
    .message {
        max-width: 85%;
    }
}

/* Welcome Message */
.welcome-message {
    background: #e8eaf6;
    border: 1px solid #c5cae9;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.welcome-message strong {
    color: var(--primary-color, #2E256D);
    display: block;
    margin-bottom: 8px;
}

/* Feedback System */
.message-feedback {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.feedback-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.feedback-btn {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

.feedback-btn svg {
    fill: currentColor;
}

.feedback-helpful:hover {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #4caf50;
}

.feedback-not-helpful:hover {
    background: #ffebee;
    border-color: #f44336;
    color: #f44336;
}

.feedback-btn:active {
    transform: scale(0.95);
}

/* Feedback Form */
.feedback-form {
    margin-top: 8px;
}

.feedback-detail {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
}

.feedback-thanks {
    color: #4caf50;
    font-weight: 500;
    margin: 0 0 8px 0;
    font-size: 14px;
}

.feedback-question {
    font-size: 13px;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 500;
}

.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.feedback-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: white;
    transition: all 0.2s ease;
}

.feedback-option:hover {
    border-color: var(--primary-color, #2E256D);
    background: #f5f5f5;
}

.feedback-option input[type="radio"] {
    margin: 0 8px 0 0;
    cursor: pointer;
}

.feedback-option span {
    font-size: 13px;
    color: #333;
}

.feedback-text {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    margin-bottom: 10px;
}

.feedback-text:focus {
    outline: none;
    border-color: var(--primary-color, #2E256D);
}

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

.feedback-submit,
.feedback-skip {
    flex: 1;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.feedback-submit {
    background: var(--primary-color, #2E256D);
    color: white;
}

.feedback-submit:hover {
    background: var(--primary-hover, #1f1849);
    transform: translateY(-1px);
}

.feedback-skip {
    background: transparent;
    color: #666;
    border: 1px solid #e0e0e0;
}

.feedback-skip:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.feedback-success {
    color: #4caf50;
    font-weight: 500;
    text-align: center;
    margin: 0;
    padding: 12px;
    background: #e8f5e9;
    border-radius: 6px;
    font-size: 13px;
}

.feedback-error {
    color: #f44336;
    font-weight: 500;
    text-align: center;
    margin: 0;
    padding: 12px;
    background: #ffebee;
    border-radius: 6px;
    font-size: 13px;
}


