/* ============================================
   Chatbot Widget Styles
   ============================================ */

.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

.chatbot-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 217, 255, 0.6);
}

.chatbot-icon svg {
    width: 28px;
    height: 28px;
    color: #000;
    stroke-width: 2.5;
}

.chatbot-pulse {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.6;
    animation: chatbotPulse 2s ease-in-out infinite;
}

@keyframes chatbotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 420px;
    min-width: 380px;
    max-width: 90vw;
    height: 600px;
    min-height: 500px;
    max-height: 80vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.chatbot-window.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.chatbot-header {
    background: var(--gradient-1);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.chatbot-header h3 {
    margin: 0;
    color: #000;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
}

.chatbot-minimize {
    background: transparent;
    border: none;
    color: #000;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.chatbot-minimize:hover {
    background: rgba(0, 0, 0, 0.1);
}

.chatbot-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-sizing: border-box;
}

.chatbot-message {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 80%;
    animation: messageSlide 0.3s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

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

.bot-message {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    color: var(--text-primary);
}

.user-message {
    background: var(--gradient-1);
    color: #000;
    align-self: flex-end;
    font-weight: 500;
}

.typing-indicator {
    opacity: 0.7;
    font-style: italic;
}

.typing-indicator p {
    animation: typingPulse 1.5s ease-in-out infinite;
}

@keyframes typingPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.chatbot-message p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Enhanced message formatting */
.chatbot-message .message-header {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem !important;
}

.chatbot-message .message-bullet {
    position: relative;
    padding-left: 1.5rem !important;
    margin-left: 0.5rem !important;
    margin-bottom: 0.4rem !important;
}

.chatbot-message .message-bullet::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.chatbot-message .message-numbered {
    padding-left: 1.5rem !important;
    margin-left: 0.5rem !important;
    margin-bottom: 0.4rem !important;
}

.chatbot-message .message-bold {
    font-weight: 600;
    margin-bottom: 0.4rem !important;
}

.chatbot-message .message-text {
    line-height: 1.7;
    margin-bottom: 0.5rem !important;
}

.bot-message .message-header {
    color: var(--primary-color);
}

.user-message .message-header {
    color: rgba(0, 0, 0, 0.8);
}

.chatbot-input-area {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    background: var(--bg-darker);
}

.chatbot-input-area input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.chatbot-input-area input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.chatbot-input-area button {
    background: var(--gradient-1);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.chatbot-input-area button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
}

.chatbot-form {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-darker);
}

.chatbot-form h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-family: 'Orbitron', sans-serif;
}

.chatbot-form form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chatbot-form input,
.chatbot-form textarea {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.chatbot-form input:focus,
.chatbot-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.chatbot-form textarea {
    resize: vertical;
    min-height: 80px;
}

.chatbot-form-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.chatbot-form-buttons button {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.chatbot-form-buttons .btn-primary {
    background: var(--gradient-1);
    color: #000;
    border: none;
}

.chatbot-form-buttons .btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.chatbot-form-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.2);
}

/* Scrollbar styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 16px;
        right: 16px;
    }

    .chatbot-icon {
        width: 56px;
        height: 56px;
    }

    .chatbot-icon svg {
        width: 26px;
        height: 26px;
    }

    .chatbot-window {
        width: calc(100vw - 32px);
        min-width: 320px;
        max-width: calc(100vw - 32px);
        right: 0;
        bottom: 76px;
        height: 550px;
        min-height: 450px;
        max-height: calc(100vh - 100px);
        box-sizing: border-box;
    }

    .chatbot-messages {
        min-height: 0;
        padding: 1.25rem;
        box-sizing: border-box;
    }

    .chatbot-header {
        padding: 1rem 1.25rem;
    }

    .chatbot-input-area {
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 12px;
        right: 12px;
    }

    .chatbot-icon {
        width: 52px;
        height: 52px;
    }

    .chatbot-icon svg {
        width: 24px;
        height: 24px;
    }

    .chatbot-window {
        width: calc(100vw - 24px);
        min-width: 280px;
        right: 0;
        bottom: 68px;
        height: 500px;
        min-height: 400px;
        max-height: calc(100vh - 90px);
        box-sizing: border-box;
    }

    .chatbot-messages {
        min-height: 0;
        padding: 1rem;
        box-sizing: border-box;
    }

    .chatbot-header {
        padding: 0.875rem 1rem;
    }

    .chatbot-header h3 {
        font-size: 1rem;
    }

    .chatbot-input-area {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .chatbot-input-area input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .chatbot-input-area button {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }
}

