/**
 * NewsPageForYou AI Chatbot - Lite Theme
 * Light, clean, minimalist design
 */

/* Light popup styling */
.dh-simple-popup {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 999997;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.dh-simple-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.simple-popup-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    width: 300px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.simple-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 14px;
    color: #999999;
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.simple-close:hover {
    background: #f5f5f5;
    color: #666666;
}

.simple-message {
    font-size: 15px;
    line-height: 1.5;
    color: #333333;
    margin-bottom: 16px;
    padding-right: 25px;
    font-weight: 400;
}

.simple-reply-btn {
    background: #007aff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.simple-reply-btn:hover {
    background: #0056cc;
    transform: translateY(-1px);
}

/* Light chatbot widget styling */
.dh-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: block !important;
    visibility: visible !important;
}

.chatbot-minimized {
    display: block;
}

.dh-chatbot-widget.minimized .chatbot-minimized {
    display: block !important;
}

.dh-chatbot-widget.minimized .chatbot-expanded {
    display: none !important;
}

.chatbot-toggle {
    background: #ffffff;
    color: #007aff;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    padding: 12px 20px;
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-toggle:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.toggle-icon {
    font-size: 18px;
}

.toggle-text {
    font-size: 14px;
    font-weight: 500;
}

/* Light chat interface */
.chatbot-expanded {
    background: #ffffff;
    border-radius: 16px;
    width: 380px;
    height: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.dh-chatbot-widget.open .chatbot-expanded {
    display: flex !important;
}

.dh-chatbot-widget.open .chatbot-minimized,
#dh-chatbot-widget.open .chatbot-minimized,
#dh-chatbot-widget.open #chatbot-minimized {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Light header */
.chatbot-header {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.bot-name {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 2px;
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666666;
}

.status-indicator.online {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
}

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

.btn-minimize,
.btn-close {
    background: none;
    border: none;
    color: #999999;
    cursor: pointer;
    font-size: 16px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-minimize:hover,
.btn-close:hover {
    background: #f5f5f5;
    color: #666666;
}

/* Light messages area */
.chatbot-body {
    flex: 1;
    overflow: hidden;
    background: #fafafa;
}

.messages-container {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
}

.message-avatar {
    width: 28px;
    height: 28px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-text {
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.4;
    color: #333333;
    margin-bottom: 4px;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: #007aff;
    color: white;
}

.user-message .message-text {
    background: #007aff;
    color: white;
    border-color: #007aff;
}

.message-time {
    font-size: 11px;
    color: #999999;
    margin-left: 16px;
}

.user-message .message-time {
    margin-left: 0;
    margin-right: 16px;
    text-align: right;
}

/* Light input area */
.chatbot-input {
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    padding: 16px 20px;
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    outline: none;
    background: #fafafa;
    transition: all 0.2s ease;
    max-height: 100px;
}

#message-input:focus {
    border-color: #007aff;
    background: #ffffff;
}

#send-button {
    background: #007aff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#send-button svg {
    transition: transform 0.2s ease;
    display: block;
    width: 20px;
    height: 20px;
    fill: white;
    color: white;
}

#send-button svg path {
    fill: white;
}

#send-button:disabled svg {
    fill: white;
    color: white;
    opacity: 1;
}

#send-button:disabled svg path {
    fill: white;
}

#send-button:hover:not(:disabled) {
    background: #0056cc;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

#send-button:hover:not(:disabled) svg {
    transform: translateY(-2px);
}

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

#send-button:disabled {
    background: #d0d0d0;
    cursor: not-allowed;
    opacity: 1;
}

.input-footer {
    text-align: center;
    margin-top: 8px;
}

.powered-by {
    font-size: 11px;
    color: #999999;
}

.powered-by a {
    color: #007aff;
    text-decoration: none;
}

/* Typing indicator */
.typing-indicator {
    padding: 20px;
    display: none;
}

.typing-content {
    display: flex;
    gap: 10px;
    align-items: center;
}

.typing-avatar {
    width: 28px;
    height: 28px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.typing-bubble {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 16px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #cccccc;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .dh-simple-popup {
        right: 15px;
        bottom: 85px;
    }
    
    .simple-popup-content {
        width: 280px;
        padding: 18px;
    }
    
    .chatbot-expanded {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        right: 0;
        bottom: 0;
    }
    
    .dh-chatbot-widget {
        right: 15px;
        bottom: 15px;
    }
}