/**
 * NewsPageForYou AI Chatbot - Dark Theme
 * Dark colors matching NewsPageForYou.com dark theme
 */

/* Dark popup styling */
.dh-simple-popup[data-theme="dark"] {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 999997;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.dh-simple-popup[data-theme="dark"].show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dh-simple-popup[data-theme="dark"] .simple-popup-content {
    background: #32373c;
    border-radius: 12px;
    padding: 20px;
    width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid #4a4a4a;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dh-simple-popup[data-theme="dark"] .simple-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.dh-simple-popup[data-theme="dark"] .simple-close:hover {
    background: #4a4a4a;
    color: #ffffff;
}

.dh-simple-popup[data-theme="dark"] .simple-message {
    font-size: 15px;
    line-height: 1.5;
    color: #ffffff;
    margin-bottom: 16px;
    padding-right: 25px;
    font-weight: 400;
}

.dh-simple-popup[data-theme="dark"] .simple-reply-btn {
    background: #0693e3;
    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%;
}

.dh-simple-popup[data-theme="dark"] .simple-reply-btn:hover {
    background: #0576c2;
    transform: translateY(-1px);
}

/* Dark chatbot widget styling */
.dh-chatbot-widget[data-theme="dark"] {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dh-chatbot-widget[data-theme="dark"] .chatbot-toggle {
    background: #32373c;
    color: #ffffff;
    border: 1px solid #4a4a4a;
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.dh-chatbot-widget[data-theme="dark"] .chatbot-toggle:hover {
    background: #3c4247;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

.dh-chatbot-widget[data-theme="dark"] .toggle-icon {
    font-size: 18px;
}

.dh-chatbot-widget[data-theme="dark"] .toggle-text {
    font-size: 14px;
    font-weight: 500;
}

/* Dark chat interface */
.dh-chatbot-widget[data-theme="dark"] .chatbot-expanded {
    background: #1a1a1a;
    border-radius: 16px;
    width: 380px;
    height: 600px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    border: 1px solid #32373c;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.dh-chatbot-widget[data-theme="dark"].open .chatbot-expanded {
    display: flex;
}

.dh-chatbot-widget[data-theme="dark"].open .chatbot-minimized {
    display: none;
}

/* Dark header */
.dh-chatbot-widget[data-theme="dark"] .chatbot-header {
    background: #32373c;
    border-bottom: 1px solid #4a4a4a;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dh-chatbot-widget[data-theme="dark"] .header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dh-chatbot-widget[data-theme="dark"] .bot-avatar {
    width: 36px;
    height: 36px;
    background: #4a4a4a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #ffffff;
}

.dh-chatbot-widget[data-theme="dark"] .bot-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
}

.dh-chatbot-widget[data-theme="dark"] .bot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #cccccc;
}

.dh-chatbot-widget[data-theme="dark"] .status-indicator.online {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
}

.dh-chatbot-widget[data-theme="dark"] .header-actions {
    display: flex;
    gap: 8px;
}

.dh-chatbot-widget[data-theme="dark"] .btn-minimize,
.dh-chatbot-widget[data-theme="dark"] .btn-close {
    background: none;
    border: none;
    color: #cccccc;
    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;
}

.dh-chatbot-widget[data-theme="dark"] .btn-minimize:hover,
.dh-chatbot-widget[data-theme="dark"] .btn-close:hover {
    background: #4a4a4a;
    color: #ffffff;
}

/* Dark messages area */
.dh-chatbot-widget[data-theme="dark"] .chatbot-body {
    flex: 1;
    overflow: hidden;
    background: #2c2c2c;
}

.dh-chatbot-widget[data-theme="dark"] .messages-container {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.dh-chatbot-widget[data-theme="dark"] .message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
}

.dh-chatbot-widget[data-theme="dark"] .message-avatar {
    width: 28px;
    height: 28px;
    background: #4a4a4a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    color: #ffffff;
}

.dh-chatbot-widget[data-theme="dark"] .message-content {
    flex: 1;
}

.dh-chatbot-widget[data-theme="dark"] .message-text {
    background: #32373c;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #4a4a4a;
    font-size: 14px;
    line-height: 1.4;
    color: #ffffff;
    margin-bottom: 4px;
}

.dh-chatbot-widget[data-theme="dark"] .user-message {
    flex-direction: row-reverse;
}

.dh-chatbot-widget[data-theme="dark"] .user-message .message-avatar {
    background: #0693e3;
    color: white;
}

.dh-chatbot-widget[data-theme="dark"] .user-message .message-text {
    background: #0693e3;
    color: white;
    border-color: #0693e3;
}

.dh-chatbot-widget[data-theme="dark"] .message-time {
    font-size: 11px;
    color: #999999;
    margin-left: 16px;
}

.dh-chatbot-widget[data-theme="dark"] .user-message .message-time {
    margin-left: 0;
    margin-right: 16px;
    text-align: right;
}

/* Dark input area */
.dh-chatbot-widget[data-theme="dark"] .chatbot-input {
    background: #32373c;
    border-top: 1px solid #4a4a4a;
    padding: 16px 20px;
}

.dh-chatbot-widget[data-theme="dark"] .input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.dh-chatbot-widget[data-theme="dark"] #message-input {
    flex: 1;
    border: 1px solid #4a4a4a;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    outline: none;
    background: #2c2c2c;
    color: #ffffff;
    transition: all 0.2s ease;
    max-height: 100px;
}

.dh-chatbot-widget[data-theme="dark"] #message-input:focus {
    border-color: #0693e3;
    background: #32373c;
}

.dh-chatbot-widget[data-theme="dark"] #message-input::placeholder {
    color: #999999;
}

.dh-chatbot-widget[data-theme="dark"] #send-button {
    background: #0693e3;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dh-chatbot-widget[data-theme="dark"] #send-button:hover:not(:disabled) {
    background: #0576c2;
    transform: scale(1.05);
}

.dh-chatbot-widget[data-theme="dark"] #send-button:disabled {
    background: #555555;
    cursor: not-allowed;
}

.dh-chatbot-widget[data-theme="dark"] .input-footer {
    text-align: center;
    margin-top: 8px;
}

.dh-chatbot-widget[data-theme="dark"] .powered-by {
    font-size: 11px;
    color: #999999;
}

.dh-chatbot-widget[data-theme="dark"] .powered-by a {
    color: #0693e3;
    text-decoration: none;
}

/* Dark typing indicator */
.dh-chatbot-widget[data-theme="dark"] .typing-indicator {
    padding: 20px;
    display: none;
}

.dh-chatbot-widget[data-theme="dark"] .typing-content {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dh-chatbot-widget[data-theme="dark"] .typing-avatar {
    width: 28px;
    height: 28px;
    background: #4a4a4a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #ffffff;
}

.dh-chatbot-widget[data-theme="dark"] .typing-bubble {
    background: #32373c;
    border: 1px solid #4a4a4a;
    border-radius: 12px;
    padding: 12px 16px;
}

.dh-chatbot-widget[data-theme="dark"] .typing-dots {
    display: flex;
    gap: 3px;
}

.dh-chatbot-widget[data-theme="dark"] .typing-dots span {
    width: 6px;
    height: 6px;
    background: #cccccc;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.dh-chatbot-widget[data-theme="dark"] .typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.dh-chatbot-widget[data-theme="dark"] .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-chatbot-widget[data-theme="dark"] .dh-simple-popup {
        right: 15px;
        bottom: 85px;
    }
    
    .dh-chatbot-widget[data-theme="dark"] .simple-popup-content {
        width: 280px;
        padding: 18px;
    }
    
    .dh-chatbot-widget[data-theme="dark"] .chatbot-expanded {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        right: 0;
        bottom: 0;
    }
    
    .dh-chatbot-widget[data-theme="dark"] {
        right: 15px;
        bottom: 15px;
    }
}