/* Global Font */
body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.5s ease, color 0.5s ease, opacity 0.4s ease;
    /* Default hidden for page transition */
}

body.loaded {
    opacity: 1;
}

/* Light Theme Variables & Backgrounds */
:root {
    --text-main: #000000;
    --text-secondary: #637588;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f0;
}

.text-main {
    color: var(--text-main) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.dark {
    --text-main: #ffffff;
    --text-secondary: #9ca3af;
    --bg-card: #1a1a1a;
    --bg-card-hover: #262626;
}

.bg-background-light {
    background-color: #f8f5f6;
    color: var(--text-main);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

:root:not(.dark) ::-webkit-scrollbar-track {
    background: #e5e5e5;
}

:root:not(.dark) ::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 5px;
    border: 2px solid #e5e5e5;
}

:root:not(.dark) ::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.dark ::-webkit-scrollbar-track {
    background: #0d0d0d;
}

.dark ::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
    border: 2px solid #0d0d0d;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #4d4d4d;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Select Chevron for Watchlist */
.select-chevron {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    appearance: none;
}

:root:not(.dark) .select-chevron {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Animations & Effects */

/* 1. Floating Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* 2. Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeIn 0.8s ease-out forwards;
}

/* 2b. Pulse Glow (AI Chat) */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(230, 10, 21, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(230, 10, 21, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(230, 10, 21, 0);
    }
}

.animate-glow {
    animation: pulseGlow 2s infinite;
}

/* 3. Hover Glow & Scale */
.hover-glow {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px -10px rgba(230, 10, 21, 0.3);
    /* Primary color shadow */
}

/* 4. Button Ripple */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* 5. Mobile Menu Slide */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.mobile-menu-enter {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glassmorphism Utilities */
/* Glassmorphism Utilities - Enhanced */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.dark .glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-heavy {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.dark .glass-heavy {
    background: rgba(10, 10, 10, 0.3);
    /* More transparent for dark mode */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark .glass-card {
    background: rgba(40, 40, 40, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Glass Buttons & Inputs */
button,
select,
input {
    backdrop-filter: blur(10px);
}

.smooth-transition {
    transition: all 0.3s ease;
}

/* Rounded Bars Enhancement */
.rounded-bar {
    border-radius: 9999px;
    /* Pill shape */
}

/* Responsive Text Utility */
@media (max-width: 768px) {
    .text-responsive-h1 {
        font-size: 2.25rem;
    }

    .text-responsive-h2 {
        font-size: 1.5rem;
    }
}

/* Watchlist Animated Background */
@keyframes gradient-shift {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(10%, -10%) scale(1.1);
    }

    66% {
        transform: translate(-10%, 10%) scale(0.9);
    }
}

.animate-gradient-shift {
    animation: gradient-shift 20s ease-in-out infinite;
}

.watchlist-bg {
    background: radial-gradient(circle at 50% 50%, rgba(230, 10, 21, 0.1), transparent 70%);
}

/* AI Chat Specifics */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

.ai-popup-enter {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.glass-ai {
    background: rgba(15, 15, 15, 0.95);
    /* Almost solid for AI Chat */
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* Mobile adjustments for AI Chat */
@media (max-width: 640px) {
    #ai-chat-popup {
        width: 100% !important;
        height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        max-width: none !important;
        border-radius: 0 !important;
        background: #000000 !important;
        /* Solid black on mobile to prevent overlay issues */
        z-index: 100 !important;
    }
}

/* Typing Dots */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border-top-left-radius: 0;
    width: fit-content;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #e60a15;
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out both;
}

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

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

@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Chips */
.mood-chip {
    flex: 0 0 auto;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.mood-chip:hover {
    background: rgba(230, 10, 21, 0.15);
    border-color: rgba(230, 10, 21, 0.3);
    transform: translateY(-2px);
}

.mood-chip:active {
    transform: translateY(0);
}