/**
 * EDU VENTURE Chatbot Styles
 * Professional, modern chatbot interface that matches the website design
 */

/* Chatbot Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #1e40af 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    transition: all 0.3s ease;
    z-index: 1050;
    color: white;
    font-size: 24px;
    user-select: none;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
    background: linear-gradient(135deg, #1e40af 0%, var(--bs-primary) 100%);
}

.chatbot-toggle.active {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    transform: rotate(180deg);
}

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

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ffc107;
    color: #000;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #1e40af 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
}

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

.chatbot-title h6 {
    font-weight: 600;
    margin: 0;
    font-size: 14px;
}

.chatbot-title small {
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-controls {
    display: flex;
    gap: 4px;
}

.chatbot-controls .btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.chatbot-controls .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* Message Styles */
.chatbot-message {
    display: flex;
    gap: 10px;
    max-width: 100%;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message-avatar.bot {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #1e40af 100%);
    color: white;
}

.message-avatar.user {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    margin-bottom: 4px;
}

.chatbot-message.user .message-text {
    background: var(--bs-primary);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.chatbot-message.bot .message-text {
    border-radius: 16px 16px 16px 4px;
    border-left: 3px solid var(--bs-primary);
}

.message-time {
    font-size: 11px;
    color: #6c757d;
    text-align: right;
    margin-top: 2px;
}

.chatbot-message.bot .message-time {
    text-align: left;
}

.message-text .emoji {
    font-size: 16px;
    margin: 0 2px;
}

/* Typing Indicator */
.chatbot-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 12px;
    margin: 0 20px 8px;
    font-size: 12px;
    color: var(--bs-primary);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--bs-primary);
    border-radius: 50%;
    animation: typing-dot 1.4s infinite both;
}

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

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

@keyframes typing-dot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Container */
.chatbot-input-container {
    padding: 16px 20px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chatbot-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.chatbot-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    background: var(--bs-primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    background: #0d6efd;
    transform: scale(1.05);
}

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

/* Suggestion Buttons */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suggestion-btn {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.2);
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: var(--bs-primary);
    color: white;
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        max-width: 380px;
        height: 450px;
        bottom: 80px;
    }
    
    .chatbot-toggle {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        right: 10px;
        height: 400px;
        bottom: 75px;
    }
    
    .chatbot-toggle {
        bottom: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .chatbot-messages {
        padding: 15px;
        gap: 12px;
    }
    
    .chatbot-input-container {
        padding: 12px 15px 15px;
    }
}

/* Animation for smooth appearance */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message {
    animation: slideInUp 0.3s ease-out;
}

/* Custom scrollbar for better UX */
.chatbot-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Focus states for accessibility */
.chatbot-toggle:focus,
.chatbot-send-btn:focus,
.suggestion-btn:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .chatbot-container {
        border: 2px solid #000;
    }
    
    .message-text {
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .chatbot-toggle,
    .chatbot-container,
    .chatbot-send-btn,
    .suggestion-btn,
    .message-text {
        transition: none;
    }
    
    .typing-dots span {
        animation: none;
    }
    
    .chatbot-badge {
        animation: none;
    }
    
    .chatbot-message {
        animation: none;
    }
}