:root {
    --bg-main: #f3f4f6;
    --bg-card: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-color: #f3f4f6;
    --shadow-color: rgba(0, 0, 0, 0.05);
}

.dark {
    --bg-main: #0b0e14;
    --bg-card: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --border-color: #30363d;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --accent-purple: #a855f7;
}

.dark .text-purple-600 {
    color: var(--accent-purple) !important;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s ease;
}

.dark body {
    background-image: radial-gradient(circle at top right, #1a1033, #0b0e14);
}

/* Base Overrides for Premium Dark Mode */
.dark .bg-white {
    background-color: var(--bg-card) !important;
}

.dark .bg-gray-50 {
    background-color: #0d1117 !important;
}

.dark .bg-gray-100 {
    background-color: #21262d !important;
}

.dark .bg-gray-50\/30 {
    background-color: rgba(13, 17, 23, 0.8) !important;
}

.dark .bg-purple-50 {
    background-color: rgba(168, 85, 247, 0.1) !important;
}

.dark .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

.dark .bg-pink-50 {
    background-color: rgba(236, 72, 153, 0.1) !important;
}

.dark .bg-yellow-400\/90 {
    background-color: rgba(234, 179, 8, 0.2) !important;
    color: #fbbf24 !important;
    box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.3) !important;
}

.dark .text-gray-800,
.dark .text-gray-900 {
    color: var(--text-primary) !important;
}

.dark .text-gray-700,
.dark .text-gray-600 {
    color: #c9d1d9 !important;
}

.dark .text-gray-500,
.dark .text-gray-400 {
    color: #6e7681 !important;
}

.dark .border-purple-50,
.dark .border-purple-100,
.dark .border-blue-50,
.dark .border-blue-100,
.dark .border-pink-50,
.dark .border-pink-100,
.dark .border-yellow-50,
.dark .border-yellow-100,
.dark .border-green-50,
.dark .border-green-100 {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.dark .ring-white\/50 {
    --tw-ring-color: rgba(255, 255, 255, 0.2) !important;
}

.dark .shadow-xl,
.dark .shadow-2xl {
    box-shadow: 0 10px 50px -12px var(--shadow-color) !important;
}

/* Chat & Special Containers */
.dark #global-chat-container,
.dark #chat-container {
    background-color: #0d1117 !important;
}

.dark .chat-scroll::-webkit-scrollbar-thumb {
    background: #30363d;
}

.dark .chat-scroll::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

.dark input,
.dark select,
.dark textarea {
    background-color: #0d1117 !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.dark input::placeholder {
    color: #484f58 !important;
}

.dark .theme-toggle-btn {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.dark .theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.dark .shadow-sm {
    box-shadow: 0 1px 2px 0 var(--shadow-color) !important;
}

/* Glassmorphism for specific elements in dark mode */
.dark .backdrop-blur-md,
.dark .backdrop-blur-sm {
    background-color: rgba(22, 27, 34, 0.7) !important;
    box-shadow: inset 0 0 0 1px var(--border-color) !important;
}

.dark .chat-message {
    border-radius: 1.25rem;
}

/* Fix for the chat suggestion button */
.dark .bg-purple-50 {
    background-color: rgba(168, 85, 247, 0.05) !important;
    color: var(--accent-purple) !important;
    border-color: rgba(168, 85, 247, 0.2) !important;
}

.dark .bg-purple-50:hover {
    background-color: rgba(168, 85, 247, 0.1) !important;
}

/* Header buttons refinement */
.dark .bg-white\/20 {
    background-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

.dark .bg-white\/20:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Search bar refinement */
.dark #searchInput {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--border-color) !important;
}

.dark #searchInput:focus {
    border-color: var(--accent-purple) !important;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2) !important;
}

/* Admin Panel refinement */
.dark .bg-gradient-to-r.from-gray-900 {
    background: linear-gradient(to right, #0d1117, #161b22, #0d1117) !important;
    box-shadow: inset 0 -1px 0 0 var(--border-color) !important;
}

/* Theme Toggle Button Styles */
.theme-toggle-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    transition: background-color 0.3s;
}

.sun-moon-container {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .sun-moon-container {
    transform: rotate(180deg);
}

.sun-icon,
.moon-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s, transform 0.6s;
}

.moon-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-180deg);
}

.dark .sun-icon {
    opacity: 0;
}

/* Shadow/Glow overrides for Dark Mode */
.dark .shadow-purple-200,
.dark .shadow-purple-200\/50,
.dark .shadow-purple-100,
.dark .shadow-purple-50 {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.8), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
}

.dark .shadow-blue-200,
.dark .shadow-blue-100,
.dark .shadow-blue-50 {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

.dark .shadow-pink-200,
.dark .shadow-pink-50,
.dark .shadow-pink-100 {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

.dark .shadow-yellow-100,
.dark .shadow-yellow-400\/20,
.dark .shadow-yellow-500\/5 {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

.dark .shadow-purple-500\/5 {
    box-shadow: 0 10px 15px -3px rgba(168, 85, 247, 0.1) !important;
}

.dark .shadow-blue-500\/5 {
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1) !important;
}

.dark .shadow-pink-500\/5 {
    box-shadow: 0 10px 15px -3px rgba(236, 72, 153, 0.1) !important;
}

.dark .shadow-green-500\/5 {
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.1) !important;
}

.dark .moon-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.app-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
}

img[src="icon.png"] {
    border-radius: 20%;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

.chat-message {
    animation: slideIn 0.3s ease-out;
    word-break: break-word;
    overflow-wrap: break-word;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom scrollbar for chat */
.chat-scroll::-webkit-scrollbar {
    width: 6px;
}

.chat-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.chat-scroll::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.chat-scroll::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Splash Screen Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        visibility: hidden;
    }
}

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

.fade-out {
    animation: fadeOut 0.8s ease-in forwards;
}

.splash-bg {
    background-image: url('splash-bg.png');
    filter: blur(4px);
    transform: scale(1.1);
}