/* Ziqro AI Chatbot Styles */
#ziqro-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#ziqro-chatbot:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

#ziqro-chatbot-text {
    color: white !important;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    text-align: center;
}

#ziqro-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

#ziqro-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#ziqro-chat-title {
    font-weight: 600;
    font-size: 16px;
}

#ziqro-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ziqro-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
}

.ziqro-message {
    margin-bottom: 15px;
    display: flex;
}

.ziqro-message.user {
    justify-content: flex-end;
}

.ziqro-message-content {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
}

.ziqro-message.user .ziqro-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.ziqro-message.bot .ziqro-message-content {
    background: white;
    color: #333;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 5px;
    line-height: 1.5;
}

/* Enhanced message formatting */
.ziqro-message-content strong {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 5px;
    display: inline-block;
}

.ziqro-message-content .ziqro-bullet {
    color: #667eea;
    font-weight: bold;
    margin-right: 5px;
}

.ziqro-message-content .ziqro-section-break {
    height: 8px;
}

.ziqro-chat-link {
    color: #667eea !important;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    display: inline-block;
    margin: 2px 0;
    transition: all 0.2s ease;
}

.ziqro-chat-link:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

#ziqro-chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

#ziqro-chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    outline: none;
    font-family: inherit;
}

#ziqro-chat-input:focus {
    border-color: #667eea;
}

#ziqro-chat-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#ziqro-chat-send:hover {
    transform: scale(1.1);
}

#ziqro-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ziqro-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
}

.ziqro-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: ziqroTyping 1.4s infinite ease-in-out;
}

.ziqro-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ziqro-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.ziqro-typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes ziqroTyping {
    0%, 80%, 100% { 
        transform: scale(0); 
    } 
    40% { 
        transform: scale(1); 
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #ziqro-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 40px);
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
    
    #ziqro-chatbot {
        bottom: 15px;
        right: 15px;
    }
}

/* Desktop specific - ensure feedback buttons are visible */
@media (min-width: 769px) {
    .ziqro-message.bot .ziqro-feedback-container {
        display: flex !important;
        visibility: visible !important;
    }
    
    .ziqro-message.bot .ziqro-feedback-buttons {
        display: flex !important;
        visibility: visible !important;
    }
    
    .ziqro-message.bot .ziqro-feedback-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Force feedback visibility on all screen sizes */
.ziqro-message.bot .ziqro-feedback-container,
.ziqro-message.bot .ziqro-feedback-buttons,
.ziqro-message.bot .ziqro-feedback-btn,
.ziqro-message.bot .ziqro-feedback-text {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 9999 !important;
}

/* Welcome message */
.ziqro-welcome {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    border-radius: 10px;
}

/* Feedback buttons */
.ziqro-message.bot .ziqro-feedback-container {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 5px;
    border-top: 1px solid #e2e8f0;
    position: relative;
    z-index: 10;
}

.ziqro-message.bot .ziqro-feedback-buttons {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.ziqro-message.bot .ziqro-feedback-text {
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
    display: inline-block !important;
}

.ziqro-message.bot .ziqro-feedback-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 14px;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 11;
}

.ziqro-message.bot .ziqro-feedback-btn:hover {
    background-color: #f1f5f9;
    transform: scale(1.1);
}

.ziqro-message.bot .ziqro-feedback-btn.ziqro-helpful:hover {
    background-color: #ecfdf5;
}

.ziqro-message.bot .ziqro-feedback-btn.ziqro-not-helpful:hover {
    background-color: #fef2f2;
}

.ziqro-message.bot .ziqro-feedback-btn.selected {
    color: white;
}

.ziqro-message.bot .ziqro-feedback-btn.selected.ziqro-helpful {
    background-color: #10b981;
}

.ziqro-message.bot .ziqro-feedback-btn.selected.ziqro-not-helpful {
    background-color: #ef4444;
}

.ziqro-message.bot .ziqro-feedback-thank-you {
    color: #10b981;
    font-size: 11px;
    font-weight: 500;
    font-style: italic;
}

/* Detailed feedback form styles */
.ziqro-feedback-form {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
}

.ziqro-feedback-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.ziqro-feedback-option-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 80px;
}

.ziqro-feedback-option-btn:hover {
    background: #e2e8f0;
    color: #334155;
    border-color: #cbd5e1;
}

.ziqro-feedback-custom {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ziqro-feedback-textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    background: #fafafa;
}

.ziqro-feedback-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.ziqro-feedback-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.ziqro-feedback-submit-btn,
.ziqro-feedback-skip-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ziqro-feedback-submit-btn {
    background: #667eea;
    color: white;
}

.ziqro-feedback-submit-btn:hover {
    background: #5a67d8;
}

.ziqro-feedback-skip-btn {
    background: #f1f5f9;
    color: #64748b;
}

.ziqro-feedback-skip-btn:hover {
    background: #e2e8f0;
}

.ziqro-feedback-thanks {
    color: #10b981 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    font-style: italic !important;
}

/* Chat Footer - Copyright */
#ziqro-chat-footer {
    padding: 8px 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    margin-top: auto;
}

#ziqro-chat-copyright {
    display: inline-block;
    color: #475569;
}

#ziqro-chat-copyright strong {
    color: #667eea;
    font-weight: 600;
}

/* Ensure chat window uses flexbox properly when visible */
#ziqro-chat-window.ziqro-chat-open {
    display: flex;
    flex-direction: column;
}

#ziqro-chat-messages {
    flex: 1;
    overflow-y: auto;
}
