

/* Brand icon classes */
[class^="brand-"], [class*=" brand-"] {
  font-family: 'brand' !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Chatbot Enhanced Styles */
.quiz-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Chatbot Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0779e4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(7, 121, 228, 0.4);
    transition: all 0.3s ease;
    font-size: 24px;
    border: none;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(7, 121, 228, 0.5);
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Chatbot Header */
.chatbot-header {
    background: #0779e4;
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

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

.chatbot-avatar {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.chatbot-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
}

.chatbot-actions {
    display: flex;
    gap: 10px;
}

.chatbot-actions button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    padding: 0 4px;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.chatbot-actions button:hover {
    opacity: 1;
}

/* Chatbot Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.message {
    margin-bottom: 16px;
    max-width: 85%;
    clear: both;
}

.message.bot-message {
    float: left;
}

.message.user-message {
    float: right;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.message.bot-message .message-content {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.user-message .message-content {
    background: #0779e4;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.user-message .message-content a {
    color: white;
    text-decoration: underline;
}

.message-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

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

/* HTML Content Styling */
.message-content.html-content {
    background: white;
    color: #1e293b;
}

.message-content.html-content h1,
.message-content.html-content h2,
.message-content.html-content h3 {
    margin: 10px 0 5px;
    color: #1e293b;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.message-content.html-content ul,
.message-content.html-content ol {
    margin: 5px 0;
    padding-left: 20px;
}

.message-content.html-content a {
    color: #0779e4;
    text-decoration: none;
    font-weight: 500;
}

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

.message-content.html-content .btn-start {
    display: inline-block;
    background: #0779e4;
    color: white !important;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    margin: 10px 0;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Typing Indicator */
.chatbot-typing {
    padding: 10px 20px;
    display: none;
    gap: 4px;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Suggestions Area */
.chatbot-suggestions {
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    background: white;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 80px;
    overflow-y: auto;
}

.suggestion-chip {
    background: #f1f5f9;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.suggestion-chip:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

/* Input Area */
.chatbot-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    transition: border-color 0.3s ease;
}

.chatbot-input:focus {
    border-color: #0779e4;
}

.chatbot-input::placeholder {
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #0779e4;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.chatbot-send:hover {
    transform: scale(1.1);
    background: #0663c0;
}

/* Dark Theme */
.quiz-chatbot-container.dark .chatbot-window {
    background: #1e293b;
}

.quiz-chatbot-container.dark .chatbot-messages {
    background: #0f172a;
}

.quiz-chatbot-container.dark .message.bot-message .message-content {
    background: #334155;
    color: #f1f5f9;
}

.quiz-chatbot-container.dark .message.user-message .message-content {
    background: #0779e4;
}

.quiz-chatbot-container.dark .chatbot-input-area {
    background: #1e293b;
    border-top-color: #334155;
}

.quiz-chatbot-container.dark .chatbot-input {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

.quiz-chatbot-container.dark .chatbot-input:focus {
    border-color: #0779e4;
}

.quiz-chatbot-container.dark .chatbot-input::placeholder {
    color: #94a3b8;
}

.quiz-chatbot-container.dark .suggestion-chip {
    background: #334155;
    color: #f1f5f9;
}

.quiz-chatbot-container.dark .suggestion-chip:hover {
    background: #475569;
}

/* Improved Responsive Design */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: 15px;
        left: 15px;
        margin: 0 auto;
    }
    
    .chatbot-toggle {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    
    .chatbot-suggestions {
        max-height: 70px;
    }
    
    .suggestion-chip {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 90px);
        bottom: 65px;
        right: 10px;
        left: 10px;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
    
    .chatbot-header {
        padding: 12px;
    }
    
    .chatbot-avatar {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .chatbot-info h3 {
        font-size: 14px;
    }
    
    .chatbot-messages {
        padding: 15px;
    }
    
    .message-content {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .chatbot-input {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .chatbot-send {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .chatbot-suggestions {
        max-height: 60px;
        padding: 8px 12px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .chatbot-window {
        height: calc(100vh - 80px);
        max-height: 400px;
    }
    
    .chatbot-messages {
        max-height: calc(100vh - 180px);
    }
}

/* Small height screens */
@media (max-height: 600px) {
    .chatbot-window {
        height: 450px;
    }
    
    .chatbot-messages {
        max-height: 300px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: slideIn 0.3s ease;
}

@media (max-width: 767.98px) {
    .quiz-chatbot-container {
            position: fixed;
    	bottom: 20px;
    	right: 10px !important; 
	left: 10px;
    	z-index: 9999;
    	font-family: 'brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    }
}