/* FPSHub Chatbot Styles */

#fpshub-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Chatbot Bubble Button */
.chatbot-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #01d535 0%, #00b82c 100%);
    border: none;
    color: #000000;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(1, 213, 53, 0.4);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(1, 213, 53, 0.6);
}

.chatbot-bubble:active {
    transform: scale(0.95);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #181818;
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: #181818;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    border: 1px solid #2a2a2a;
}

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

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #01d535 0%, #00b82c 100%);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #000000;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
}

.chatbot-title {
    font-weight: 600;
    font-size: 16px;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000000;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

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

/* Message */
.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

.bot-message {
    align-self: flex-start;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #01d535 0%, #00b82c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    font-size: 16px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: #2a2a2a;
    color: #ffffff;
}

.message-content {
    flex: 1;
    max-width: 75%;
}

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

.message-bubble {
    background: #2a2a2a;
    padding: 12px 16px;
    border-radius: 12px;
    color: #ffffff;
    word-wrap: break-word;
    line-height: 1.6;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #01d535 0%, #00b82c 100%);
    color: #000000;
    font-weight: 500;
}

/* Formatted content in message bubbles */
.message-bubble p {
    margin: 0 0 8px 0;
}

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

.message-bubble strong {
    font-weight: 700;
    color: #01d535;
}

.user-message .message-bubble strong {
    color: #000000;
    font-weight: 700;
}

.message-bubble em {
    font-style: italic;
    opacity: 0.9;
}

.message-bubble code {
    background: rgba(1, 213, 53, 0.1);
    color: #01d535;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid rgba(1, 213, 53, 0.2);
}

.user-message .message-bubble code {
    background: rgba(0, 0, 0, 0.2);
    color: #000000;
    border-color: rgba(0, 0, 0, 0.3);
}

.message-bubble pre {
    background: #1a1a1a;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    border-left: 3px solid #01d535;
}

.message-bubble pre code {
    background: none;
    border: none;
    padding: 0;
    color: #01d535;
    display: block;
}

.message-bubble ul,
.message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble ul {
    list-style-type: none;
}

.message-bubble ul li {
    position: relative;
    margin: 4px 0;
    padding-left: 8px;
}

.message-bubble ul li:before {
    content: "▸";
    color: #01d535;
    font-weight: bold;
    position: absolute;
    left: -12px;
}

.user-message .message-bubble ul li:before {
    color: #000000;
}

.message-bubble ol {
    list-style-type: decimal;
    list-style-position: outside;
}

.message-bubble ol li {
    margin: 4px 0;
    padding-left: 4px;
}

.message-bubble ol li::marker {
    color: #01d535;
    font-weight: bold;
}

.user-message .message-bubble ol li::marker {
    color: #000000;
}

.message-bubble a {
    color: #01d535;
    text-decoration: underline;
    font-weight: 500;
}

.message-bubble a:hover {
    color: #00b82c;
}

.user-message .message-bubble a {
    color: #000000;
    font-weight: 600;
}

.user-message .message-bubble a:hover {
    opacity: 0.8;
}

.message-time {
    font-size: 11px;
    color: #b0b0b0;
    margin-top: 4px;
    padding: 0 4px;
}

/* Typing Indicator */
.typing-indicator {
    margin-top: -8px;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
    padding: 12px 16px;
    background: #2a2a2a;
    border-radius: 12px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #01d535;
    animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Message Counter */
.chatbot-counter {
    padding: 8px 16px;
    background: rgba(1, 213, 53, 0.1);
    color: #01d535;
    font-size: 12px;
    text-align: center;
    border-top: 1px solid rgba(1, 213, 53, 0.2);
}

.chatbot-counter i {
    margin-right: 6px;
}

/* Input Area */
.chatbot-input {
    padding: 12px 16px;
    background: #181818;
    border-top: 1px solid #2a2a2a;
}

.chatbot-input .input-group {
    display: flex;
    gap: 8px;
}

.chatbot-input .form-control {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: white;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
}

.chatbot-input .form-control:focus {
    background: #2a2a2a;
    border-color: #01d535;
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(1, 213, 53, 0.25);
}

.chatbot-input .form-control::placeholder {
    color: #b0b0b0;
}

.chatbot-input .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
.chatbot-footer {
    padding: 8px 16px;
    background: #181818;
    text-align: center;
    font-size: 11px;
    border-top: 1px solid #2a2a2a;
}

.chatbot-footer a {
    text-decoration: none;
}

.chatbot-footer a:hover {
    text-decoration: underline;
}

/* Close button styling for green header */
.chatbot-header .btn-close {
    filter: brightness(0);
    opacity: 0.6;
}

.chatbot-header .btn-close:hover {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        bottom: 20px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }

    .chatbot-bubble {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Warning/Error Messages */
.message-warning {
    background: rgba(255, 193, 7, 0.2) !important;
    border-left: 3px solid #ffc107;
}

.message-error {
    background: rgba(220, 53, 69, 0.2) !important;
    border-left: 3px solid #dc3545;
}
