body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow: hidden; /* Prevent body scroll, main content will scroll */
    background-color: #0d0d1a; /* Base dark background */
}

/* Galaxy background effect */
.galaxy-background {
    background-image:
        radial-gradient(at 20% 80%, rgba(20,20,30,0.5) 0%, transparent 50%),
        radial-gradient(at 80% 20%, rgba(30,30,50,0.5) 0%, transparent 50%),
        radial-gradient(at 50% 50%, rgba(0,0,0,0.8) 0%, transparent 70%);
    background-blend-mode: overlay;
    background-size: cover;
    background-position: center;
}

/* Define keyframes for the floating animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}
.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Modal entry/exit animation classes (for opacity and transform) */
.modal-overlay-enter { opacity: 0; }
.modal-overlay-enter-active { opacity: 1; transition: opacity 300ms ease-out; }
.modal-overlay-exit-active { opacity: 0; transition: opacity 300ms ease-out; }

.modal-content-enter { opacity: 0; transform: translateY(-20px) scale(0.95); }
.modal-content-enter-active { opacity: 1; transform: translateY(0) scale(1); transition: opacity 300ms ease-out, transform 300ms ease-out; }
.modal-content-exit-active { opacity: 0; transform: translateY(-20px) scale(0.95); transition: opacity 300ms ease-out, transform 300ms ease-out; }

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #2d3748; /* gray-800 */
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #4a5568; /* gray-600 */
    border-radius: 10px;
    transition: background 0.3s ease;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #647087; /* gray-500 */
}

/* Custom track and thumb styles for range input */
.range-slider::-webkit-slider-runnable-track {
    background: var(--slider-track-bg);
    border-radius: 5px;
    height: 8px;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--slider-thumb-bg);
    margin-top: -6px; /* Adjust thumb vertical position */
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: background 0.3s ease;
}
.range-slider::-moz-range-track {
    background: var(--slider-track-bg);
    border-radius: 5px;
    height: 8px;
}
.range-slider::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--slider-thumb-bg);
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: background 0.3s ease;
}

/* Custom checkbox styling */
.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--checkbox-border);
    background-color: var(--checkbox-bg);
    cursor: pointer;
    position: relative;
    display: inline-block;
    transition: all 0.2s ease-in-out;
}

.custom-checkbox:checked {
    background-color: var(--checkbox-checked-bg);
    border-color: var(--checkbox-checked-bg);
}

.custom-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    background: white; /* Checkmark color */
    border-radius: 2px;
    transform: scale(1);
    opacity: 1;
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.custom-checkbox:not(:checked)::after {
    transform: scale(0);
    opacity: 0;
}

.custom-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Main content minimized/maximized states */
.main-content-minimized {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, height 0.3s ease-out;
}
.main-content-maximized {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    min-height: 100vh;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, height 0.3s ease-out;
    display: flex;
    justify-content: center;
    padding-bottom: 10%;
}

/* Ensure chatMessages is scrollable and styled */
#chatMessages {
    max-height: 75vh;
    overflow-y: auto;
    width: 98vw;
    max-width: 80rem;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    margin-left: 0;
    margin-right: 0;
    z-index: 10;
    /* The rest is already set by Tailwind classes and inline styles */
}

/* Custom scrollbar for dark mode */
#chatMessages::-webkit-scrollbar {
    width: 8px;
}
#chatMessages::-webkit-scrollbar-track {
    background: #23263a;
    border-radius: 10px;
}
#chatMessages::-webkit-scrollbar-thumb {
    background: #3b3f5c;
    border-radius: 10px;
    transition: background 0.3s;
}
#chatMessages::-webkit-scrollbar-thumb:hover {
    background: #647087;
}

/* For Firefox */
#chatMessages {
    scrollbar-width: thin;
    scrollbar-color: #3b3f5c #23263a;
}

/* Sidebar styles */
.sidebar {
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1), min-width 0.3s cubic-bezier(0.4,0,0.2,1), padding 0.3s;
    width: 18rem; /* 72 (lg:w-72) */
    min-width: 6rem;
}
.sidebar.collapsed {
    width: 4.5rem !important; /* 18 (w-18) */
    min-width: 4.5rem !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
}
.sidebar.collapsed .sidebar-label-text {
    display: none !important;
}
.sidebar .sidebar-label-text {
    display: inline !important;
}
.sidebar.collapsed .sidebar-logo {
    margin-bottom: 0.5rem !important;
    padding: 0.5rem !important;
    transition: all 0.3s;
}
.sidebar.collapsed .sidebar-divider {
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    transition: all 0.3s;
}

/* Gemini Sidebar Style */
.sidebar-gemini {
    background: linear-gradient(to bottom, #2a1857 0%, #1e293b 100%);
    border-right: 2px solid #7c3aed;
    box-shadow: 0 8px 32px 0 rgba(60,0,120,0.25);
    color: #e0e7ff;
    font-family: 'Inter', sans-serif;
}
.sidebar-gemini .sidebar-label-text {
    font-size: 0.95rem !important;
    color: #c4b5fd !important;
}
.sidebar-gemini .sidebar-label {
    font-size: 0.95rem !important;
}
.sidebar-gemini .bg-accent {
    background-color: #7c3aed !important;
}
.sidebar-gemini .hover\:bg-accent:hover {
    background-color: #a78bfa !important;
}
.sidebar-gemini .focus\:ring-accent:focus {
    box-shadow: 0 0 0 3px #a78bfa !important;
}
.sidebar-gemini .sidebar-divider {
    background: linear-gradient(to right, #7c3aed, #6366f1, #1e293b);
    opacity: 0.7;
}
.sidebar-gemini .sidebar-toggle-expanded {
    background-color: #312e81 !important;
}
.sidebar-gemini .sidebar-label svg {
    color: #a78bfa !important;
}
.sidebar-gemini .sidebar-label:hover {
    background-color: #312e81 !important;
}
.sidebar-gemini .sidebar-label.active {
    background-color: #7c3aed !important;
    color: #fff !important;
}
.sidebar-gemini .sidebar-label-text {
    color: #c4b5fd !important;
}

/* Optional: Sidebar custom shadow and gradient (if not using Tailwind for this) */
/*
#sidebar {
    background: linear-gradient(to bottom, #1a202c 0%, #0d0d1a 100%);
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.35);
    border-right: 2px solid #1e3a8a;
}
*/

/* Starfield background animation */
.stars-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.stars-bg canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    position: absolute;
    top: 0; left: 0;
    z-index: 0;
}
.stars-bg.paused {
    display: none !important;
}

/* Chat bubbles (Gemini style) */
.chat-bubble {
    display: inline-block;
    max-width: 80%;
    padding: 0.75rem 1.1rem;
    border-radius: 1.25rem;
    margin-bottom: 0.25rem;
    word-break: break-word;
    font-size: 1rem;
    position: relative;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
    transition: background 0.2s;
    /* Center bubbles in their flex wrapper */
    margin-left: 0;
    margin-right: 0;
}
.chat-bubble-user {
    background: linear-gradient(90deg, #7c3aed 60%, #312e81 100%);
    color: #fff;
    border-bottom-right-radius: 0.3rem;
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}
.chat-bubble-ai {
    background: linear-gradient(90deg, #23263a 60%, #1e293b 100%);
    color: #e0e7ff;
    border-bottom-left-radius: 0.3rem;
    margin-right: auto;
    margin-left: 0;
    text-align: left;
}

/* Center the chat bubble wrapper flex container */
.chat-bubble-wrapper {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
}
.chat-bubble-wrapper.user {
    justify-content: flex-end;
}
.chat-bubble-wrapper.ai {
    justify-content: flex-start;
}

/* Chat fade-out effect at the bottom */
#chatMessages {
    mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
    /* The fade will hide the bottom part as it approaches the search bar */
    /* You may adjust 90% to 85% for a stronger fade */
}

