/* AI Counselor Chatbot Styles */

/* Floating Button Animation */
#ai-chatbot-button button {
    position: relative;
    overflow: hidden;
}

#ai-chatbot-button button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#ai-chatbot-button button:hover::before {
    width: 100px;
    height: 100px;
}

/* Pulse Animation */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(147, 51, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0);
    }
}

#ai-chatbot-button button {
    animation: pulse-glow 2s infinite;
}

/* Chat Window */
#ai-chatbot-window {
    transition: all 0.3s ease-in-out;
    transform-origin: bottom right;
}

#ai-chatbot-window.hidden {
    transform: scale(0);
    opacity: 0;
}

#ai-chatbot-window:not(.hidden) {
    transform: scale(1);
    opacity: 1;
}

/* Messages */
#chatbot-messages {
    background: linear-gradient(to bottom, #f9fafb, #ffffff);
}

#chatbot-messages > div {
    animation: slideInUp 0.3s ease-out;
}

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

/* User messages */
.bg-gradient-to-r.from-purple-600.to-blue-600 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Bot messages */
#chatbot-messages .bg-gray-100 {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Quick replies */
#quick-replies button {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

#quick-replies button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

#quick-replies button:hover::before {
    width: 100%;
    height: 100%;
}

/* Input field */
#chatbot-input {
    transition: all 0.3s ease;
}

#chatbot-input:focus {
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Send button */
#ai-chatbot-window button:has(.fa-paper-plane) {
    position: relative;
    overflow: hidden;
}

#ai-chatbot-window button:has(.fa-paper-plane)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

#ai-chatbot-window button:has(.fa-paper-plane):hover::after {
    width: 100%;
    height: 100%;
}

/* Typing indicator */
.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #9333ea;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing-bounce 1.4s infinite;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #ai-chatbot-button {
        bottom: 1rem;
        right: 1rem;
    }
    
    #ai-chatbot-window {
        width: calc(100vw - 2rem) !important;
        max-width: 400px;
        right: 1rem !important;
        bottom: 5rem !important;
        left: 1rem;
        margin: 0 auto;
    }
    
    #chatbot-messages {
        max-height: 50vh;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #ai-chatbot-window {
        background: #1f2937;
        color: #f9fafb;
    }
    
    #chatbot-messages {
        background: linear-gradient(to bottom, #1f2937, #111827);
    }
    
    #chatbot-input {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    #quick-replies button {
        background: #374151;
        color: #f9fafb;
    }
    
    #chatbot-messages .bg-gray-100 {
        background: #374151;
        color: #f9fafb;
    }
}

/* Smooth scroll */
#chatbot-messages {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
#chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

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

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

/* Notification badge */
#ai-chatbot-button .animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Voice input button */
button:has(.fa-microphone) {
    position: relative;
}

button:has(.fa-microphone).recording {
    background: #ef4444 !important;
    color: white !important;
    animation: recording-pulse 1.5s infinite;
}

@keyframes recording-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* File attachment */
button:has(.fa-paperclip) {
    transition: all 0.3s ease;
}

button:has(.fa-paperclip):hover {
    transform: rotate(45deg);
}