/* ===== CHATBOT WIDGET ===== */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }
}

.chatbot-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--gradient-1);
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: var(--shadow-neon);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0;
}

.chatbot-toggle:hover::before {
    opacity: 1;
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(360deg);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.8);
}

.chatbot-toggle i {
    transition: transform 0.3s ease;
}

.chatbot-toggle:hover i {
    transform: scale(1.1);
}

.chatbot-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 243, 255, 0.3);
    border: 1px solid rgba(0, 243, 255, 0.2);
    display: none;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

@media (max-width: 480px) {
    .chatbot-container {
        width: 320px;
        right: -10px;
    }
}

.chatbot-container.active {
    display: flex;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chatbot-header {
    background: var(--gradient-1);
    padding: 1rem 1.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.chatbot-title i {
    font-size: 1.3rem;
    animation: pulse 2s infinite;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px #00ff00;
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 20px #00ff00;
    }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.3rem;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chatbot-messages {
    height: 350px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-charcoal);
    scroll-behavior: smooth;
}

/* Custom scrollbar for messages */
.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

.message {
    display: flex;
    animation: messagePop 0.3s ease;
}

@keyframes messagePop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.message.bot .message-content {
    background: var(--bg-card);
    color: var(--text-light);
    border-bottom-left-radius: 5px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.message.user .message-content {
    background: var(--gradient-1);
    color: white;
    border-bottom-right-radius: 5px;
}

.message-timestamp {
    display: block;
    font-size: 0.6rem;
    margin-top: 0.3rem;
    opacity: 0.7;
}

.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border-top: 1px solid rgba(0, 243, 255, 0.1);
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
}

.suggestion-chip {
    padding: 0.5rem 1.2rem;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--primary);
    border-radius: 50px;
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.suggestion-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--gradient-1);
    transition: all 0.3s ease;
    z-index: -1;
}

.suggestion-chip:hover::before {
    width: 100%;
}

.suggestion-chip:hover {
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
    border-color: transparent;
}

.chatbot-input {
    display: flex;
    padding: 1rem;
    background: var(--bg-card);
}

.chatbot-input input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: none;
    background: var(--bg-charcoal);
    color: var(--text-light);
    border-radius: 50px 0 0 50px;
    outline: none;
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-right: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.chatbot-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.chatbot-input input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.chatbot-input button {
    width: 55px;
    background: var(--gradient-1);
    border: none;
    color: white;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-input button:hover {
    background: var(--gradient-1);
    transform: scale(1.05);
    box-shadow: var(--shadow-neon);
}

.chatbot-input button i {
    transition: transform 0.3s ease;
}

.chatbot-input button:hover i {
    transform: translateX(3px);
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    width: fit-content;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 480px) {
    .chatbot-messages {
        height: 300px;
    }
    
    .message-content {
        font-size: 0.9rem;
    }
    
    .suggestion-chip {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
    
    .chatbot-input input {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    .chatbot-toggle:hover {
        transform: scale(1);
    }
    
    .suggestion-chip:hover {
        transform: none;
    }
    
    .chatbot-input button:hover {
        transform: none;
    }
}