/* Chikara Chatbot Styles */

/* Chatbot Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
}

.chatbot-toggle-inner {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    position: relative;
    min-width: 180px;
    justify-content: center;
}

.chatbot-toggle i {
    font-size: 18px;
}

.chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
}

.notification-dot {
    display: block;
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Chatbot Modal */
.chatbot-modal {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    background: #ffffff;
}

.chatbot-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #2c3e50;
    border: none;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.chatbot-info h5 {
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
}

.chatbot-status {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
}

.chatbot-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-controls .btn {
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #dee2e6;
    color: #6c757d;
    background: white;
}

.chatbot-controls .btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* Chatbot Body */
.chatbot-body {
    padding: 0;
    height: 400px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
}

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Messages */
.message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
}

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

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

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

.user-message .message-avatar {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    margin-right: 0;
    margin-left: 12px;
}

.message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.user-message .message-content {
    align-items: flex-end;
}

.message-text {
    background: #f8f9fa;
    padding: 15px 18px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    border: 1px solid #e9ecef;
}

.user-message .message-text {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
}

.message-text p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.message-text p:last-child {
    margin-bottom: 0;
}

/* Message formatting styles */
.message-text strong {
    font-weight: 600;
    color: #2c3e50;
}

.user-message .message-text strong {
    color: white;
}

.message-text em {
    font-style: italic;
    color: #6c757d;
}

.user-message .message-text em {
    color: rgba(255, 255, 255, 0.8);
}

.message-text h1,
.message-text h2,
.message-text h3 {
    margin: 15px 0 10px 0;
    font-weight: 600;
    line-height: 1.3;
}

.message-text h1 {
    font-size: 18px;
    color: #2c3e50;
}

.message-text h2 {
    font-size: 16px;
    color: #2c3e50;
}

.message-text h3 {
    font-size: 14px;
    color: #2c3e50;
}

.user-message .message-text h1,
.user-message .message-text h2,
.user-message .message-text h3 {
    color: white;
}

.message-text code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #e74c3c;
}

.user-message .message-text code {
    background: rgba(255, 255, 255, 0.2);
    color: #ffeb3b;
}

.message-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 5px 0;
    list-style-type: disc;
}

.message-text a {
    color: #007bff;
    text-decoration: none;
}

.message-text a:hover {
    text-decoration: underline;
}

.user-message .message-text a {
    color: #87ceeb;
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6c757d;
    font-style: italic;
}

.loading-indicator i {
    color: #f39c12;
}

.message-time {
    font-size: 11px;
    color: #95a5a6;
    margin-top: 5px;
    padding: 0 5px;
}

.user-message .message-time {
    text-align: right;
}

/* Quick Options */
.quick-options {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.quick-options li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
    font-size: 14px;
}

.quick-options i {
    color: #f39c12;
    width: 16px;
}

/* Typing Indicator */
.chatbot-typing {
    padding: 0 20px 20px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 15px 18px;
    background: #f8f9fa;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

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

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator 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; }
}

/* Chatbot Footer */
.chatbot-footer {
    border: none;
    padding: 20px;
    background: #ffffff;
    border-top: 1px solid #dee2e6;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.quick-action-btn {
    background: #ffffff;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quick-action-btn:hover {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
}

.quick-action-btn i {
    font-size: 10px;
}

.chatbot-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input-group .form-control {
    border: 2px solid #dee2e6;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.chatbot-input-group .form-control:focus {
    border-color: #f39c12;
    box-shadow: 0 0 0 0.2rem rgba(243, 156, 18, 0.25);
    background: #ffffff;
}

#sendMessageBtn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#sendMessageBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

#sendMessageBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Minimized Chatbot */
.chatbot-minimized {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    animation: slideInUp 0.3s ease;
    border: 1px solid #dee2e6;
}

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

.minimized-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #dee2e6;
}

.minimized-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.minimized-info {
    flex: 1;
}

.minimized-title {
    font-weight: 600;
    color: #2c3e50;
    display: block;
    font-size: 14px;
}

.minimized-status {
    font-size: 12px;
    color: #28a745;
}

.minimized-controls {
    display: flex;
    gap: 5px;
}

.minimized-controls .btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
    }
    
    .chatbot-toggle-inner {
        padding: 12px 16px;
        min-width: 150px;
    }
    
    .chatbot-toggle-text {
        display: none;
    }
    
    .chatbot-modal .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .chatbot-body {
        height: 350px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-action-btn {
        justify-content: center;
    }
    
    .chatbot-minimized {
        right: 20px;
        bottom: 20px;
        min-width: 280px;
    }
}

@media (max-width: 480px) {
    .chatbot-toggle-inner {
        padding: 10px;
        min-width: auto;
        border-radius: 50%;
    }
    
    .chatbot-toggle-text {
        display: none;
    }
    
    .chatbot-minimized {
        min-width: 250px;
    }
}

/* Force light mode - override any dark mode preferences */
.chatbot-modal {
    background: #ffffff !important;
}

.chatbot-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    color: #2c3e50 !important;
    border-bottom: 1px solid #dee2e6 !important;
}

.chatbot-body {
    background: #ffffff !important;
}

.chatbot-messages {
    background: #ffffff !important;
}

.message-text {
    background: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #e9ecef !important;
}

.user-message .message-text {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    color: white !important;
    border: none !important;
}

.chatbot-footer {
    background: #ffffff !important;
    border-top: 1px solid #dee2e6 !important;
}

.quick-action-btn {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
}

.chatbot-input-group .form-control {
    background: #ffffff !important;
    border: 2px solid #dee2e6 !important;
    color: #495057 !important;
}

.chatbot-minimized {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
}

.minimized-header {
    border-bottom: 1px solid #dee2e6 !important;
}

.minimized-title {
    color: #2c3e50 !important;
}
