/* Chatbot Styles */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: min(400px, calc(100vw - 40px));
    height: min(600px, calc(100vh - 40px));
    max-width: 90vw;
    max-height: 90vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    z-index: 10000;
    font-family: 'arialbold', Arial, sans-serif;
    overflow: hidden;
    border: 3px solid #ffde00;
}

#chatbot-container.active {
    display: flex;
}

#chatbot-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ffde00;
}

#chatbot-title {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

#chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
}

#chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: #ffde00;
    border-radius: 10px;
}

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

.chat-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

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

.message-ai {
    align-items: flex-start;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.message-ai .message-bubble {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
    padding: 0 5px;
}

.message-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.report-btn {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: #ff6b6b;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
}

.report-btn:hover:not(.reported) {
    background: rgba(255, 0, 0, 0.3);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}

.report-btn:active:not(.reported) {
    transform: scale(0.95);
}

.report-btn.reported {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: 1px solid #38ef7d;
    color: #fff;
    cursor: default;
    animation: reportSuccess 0.5s ease;
}

@keyframes reportSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.report-btn svg {
    width: 12px;
    height: 12px;
}

#chatbot-input-container {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 2px solid #ffde00;
    display: flex;
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ffde00;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 14px;
    font-family: 'arialbold', Arial, sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

#chatbot-input:focus {
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 222, 0, 0.5);
}

#chatbot-send {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    color: #fff;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#chatbot-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: 3px solid #ffde00;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: all 0.3s ease;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

#chatbot-toggle svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

#chatbot-toggle.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.loading-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 8px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    #chatbot-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 40px);
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
        bottom: 20px;
        right: 20px;
        left: 20px;
        top: 20px;
    }
    
    #chatbot-toggle {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 700px) {
    #chatbot-container {
        width: min(500px, calc(100vw - 40px));
        height: min(calc(100vh - 40px), 500px);
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
    }
    
    #chatbot-header {
        padding: 10px 15px;
    }
    
    #chatbot-title {
        font-size: 16px;
    }
    
    #chatbot-messages {
        padding: 15px;
    }
    
    .message-bubble {
        max-width: 80%;
        padding: 10px 14px;
    }
    
    .message-text {
        font-size: 13px;
    }
}

/* Small screens in landscape */
@media (orientation: landscape) and (max-height: 500px) {
    #chatbot-container {
        height: calc(100vh - 20px);
        max-height: calc(100vh - 20px);
        bottom: 10px;
        top: 10px;
    }
    
    #chatbot-header {
        padding: 8px 12px;
    }
    
    #chatbot-title {
        font-size: 14px;
    }
    
    #chatbot-messages {
        padding: 10px;
    }
    
    .message-bubble {
        padding: 8px 12px;
    }
    
    .message-text {
        font-size: 12px;
    }
    
    #chatbot-input-container {
        padding: 10px;
    }
    
    #chatbot-input {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #chatbot-send {
        padding: 8px 15px;
        font-size: 12px;
    }
}

