/* Animations and Visual Enhancements */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(14, 165, 233, 0.6);
    }
}

/* Hero section animations */
.hero-animate {
    animation: fadeInUp 0.8s ease-out;
}

.hero-animate-delay-1 {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-animate-delay-2 {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-animate-delay-3 {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* Button hover animations */
.btn-float:hover {
    animation: float 2s ease-in-out infinite;
}

.btn-glow:hover {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Card animations */
.card-entrance {
    animation: fadeInScale 0.6s ease-out;
}

/* Stagger animation for grid items */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* Loading animation for buttons */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff33;
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced focus states for accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Enhanced mobile touch interactions */
@media (max-width: 768px) {
    button, .btn {
        min-height: 44px; /* Minimum touch target size */
        touch-action: manipulation; /* Disable double-tap zoom */
    }
    
    /* Improved mobile spacing */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Sets the default font for the entire website */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc; /* slate-50 */
}

/* Base styles for the trust badges on listing cards */
.trust-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Specific color styles for the "Student" badge */
.student-badge {
    background-color: #e0f2fe; /* sky-100 */
    color: #0c4a6e; /* sky-900 */
}

/* Specific color styles for the "Professional" badge */
.pro-badge {
    background-color: #d1fae5; /* emerald-100 */
    color: #065f46; /* emerald-900 */
}

/* Styles for page transitions */
.page {
    display: none;
    animation: fadeIn 0.5s;
}
.page.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Styles for modals (pop-ups) */
.modal {
    display: none;
    animation: fadeIn 0.3s;
}
.modal.active {
    display: flex;
}

/* Styles for the login/signup tabs */
.tab-link {
    cursor: pointer;
    font-weight: 500;
    color: #64748b; /* slate-500 */
    transition: color 0.2s ease-in-out;
    text-decoration: none;
}
.tab-link:hover {
    color: #0f172a; /* slate-900 */
}
.tab-link.active {
    color: #0284c7; /* sky-600 */
    font-weight: 700;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Styles for the chatbot widget */
#chatbot-container {
    font-family: 'Inter', sans-serif;
}

#chatbot-popup {
    max-height: 500px;
    min-height: 400px;
}

#chatbot-content {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

#chatbot-content::-webkit-scrollbar {
    width: 6px;
}

#chatbot-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#chatbot-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#chatbot-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Chatbot button animation */
#chatbot-toggle {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

#chatbot-toggle:hover {
    animation: none;
    transform: scale(1.1);
}

/* Chat popup animations */
#chatbot-popup.scale-100 {
    transform: scale(1);
    opacity: 1;
}

#chatbot-popup.scale-0 {
    transform: scale(0);
    opacity: 0;
}

/* Styles for the loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0284c7;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design for chatbot */
@media (max-width: 640px) {
    #chatbot-popup {
        width: 300px;
        height: 350px;
    }
    
    #chatbot-container {
        bottom: 1rem;
        left: 1rem;
    }
}

/* Styles for the WhatsApp chat widget (keeping existing for backward compatibility) */
#whatsapp-chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    background: white;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 50;
}
#whatsapp-chat-widget.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}