@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --primary: #8B5CF6;
    --cyan: #06B6D4;
    --pink: #EC4899;
    --dark-bg: #0B0E14;
    --text-main: #F9FAFB;
    --text-muted: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.03);
    --nav-bg: rgba(11, 14, 20, 0.8);
}

.light-mode {
    --dark-bg: #F3F4F6;
    --text-main: #111827;
    --text-muted: #4B5563;
    /* Cards and glass components stay dark for premium feel */
    --card-bg: rgba(0, 0, 0, 0.8);
    --glass-bg: rgba(0, 0, 0, 0.6);
    --glass-border: rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--dark-bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
}

/* Glassmorphism Classes */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    color: white;
    /* Ensure text is always visible on dark glass boards */
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.3);
}

/* Gradients */
.text-gradient {
    background: linear-gradient(90deg, var(--cyan), var(--primary), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-purple {
    background: linear-gradient(135deg, var(--primary), var(--pink));
}

/* Guideline 32: Navbar Height */
nav {
    height: 80px;
    /* Desktop */
}

@media (max-width: 1023px) {
    nav {
        height: 64px;
        /* Mobile */
    }
}

nav.nav-scrolled {
    background: rgba(11, 14, 20, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Guideline 5: Consistent Button Height */
.btn-premium {
    height: 52px;
    padding: 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--pink));
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    transform: scale(1.02);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
}

.btn-outline:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(6, 182, 212, 0.05);
}

/* Guideline 14: Mobile Menu Left */
#mobile-menu,
#dashboard-drawer {
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.active,
#dashboard-drawer.active {
    transform: translateX(0);
}

#mobile-menu .flex-col,
#dashboard-mobile-menu .flex-col {
    gap: 1rem !important;
    /* Reduced to ~gap-4 for better fit */
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

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

/* Guideline 15: Scrollbar padding */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Custom Utilities for Guideline 8 & 24 */
.card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    flex-grow: 1;
}

.cta-container {
    margin-top: auto;
    width: 100%;
    text-align: center;
}

/* Theme Toggle Button Styles */
.theme-toggle {
    transition: all 0.3s ease;
}

.light-mode .theme-toggle {
    color: #374151;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .theme-toggle:hover {
    color: #FFFFFF;
    background: rgba(0, 0, 0, 0.1);
    border-color: #8B5CF6;
}

/* Ensure text visibility in both themes */
.light-mode {
    color: var(--text-main);
}

/* Select/Dropdown Compatibility */
select {
    color: white !important;
}

select option {
    background-color: #0b0e14 !important;
    color: white !important;
}

/* Section side padding consistency */
section {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    section {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1024px) {
    section {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media (min-width: 1280px) {
    section {
        padding-left: 6rem;
        padding-right: 6rem;
    }
}

/* Custom Scrollbar Styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* Hide Scrollbar Utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
/* --- LIGHT MODE TAILWIND OVERRIDES --- */
.light-mode .bg-dark { background-color: #F8FAFC !important; }
.light-mode .bg-dark\/50 { background-color: rgba(248, 250, 252, 0.5) !important; }
.light-mode .bg-dark\/80 { background-color: rgba(248, 250, 252, 0.8) !important; }
.light-mode .bg-dark\/90 { background-color: rgba(248, 250, 252, 0.9) !important; }
.light-mode .bg-dark\/95 { background-color: rgba(248, 250, 252, 0.95) !important; }

.light-mode .bg-white\/5 { background-color: rgba(15, 23, 42, 0.05) !important; }
.light-mode .bg-white\/10 { background-color: rgba(15, 23, 42, 0.08) !important; }
.light-mode .bg-white\/20 { background-color: rgba(15, 23, 42, 0.15) !important; }

.light-mode .text-white { color: #0f172a !important; }
.light-mode .text-white\/30 { color: rgba(15, 23, 42, 0.5) !important; }
.light-mode .text-white\/40 { color: rgba(15, 23, 42, 0.6) !important; }
.light-mode .text-white\/50 { color: rgba(15, 23, 42, 0.6) !important; }
.light-mode .text-white\/60 { color: rgba(15, 23, 42, 0.7) !important; }
.light-mode .text-white\/70 { color: rgba(15, 23, 42, 0.8) !important; }

/* Fix hero section text visibility in light mode */
.light-mode .hero-section .text-white\/70 {
    color: rgba(71, 85, 105, 0.9) !important;
}

/* More specific rule for hero paragraph */
.light-mode .hero-section p.text-white\/70 {
    color: rgba(71, 85, 105, 0.9) !important;
}

/* Fix button text in hero section for light mode */
.light-mode .hero-section .btn-premium {
    color: #ffffff !important;
}

/* Fix hero section gradient overlay in light mode */
.light-mode .hero-section .bg-gradient-to-t {
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.4), transparent) !important;
}

/* Fix featured categories text visibility in light mode */
.light-mode .bg-gradient-to-t.from-dark\/90 {
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.3), transparent) !important;
}

/* Ensure featured categories text is always visible */
.light-mode .bg-gradient-to-t h4 {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

/* Fix collections hero section text visibility in light mode */
.light-mode section[class*="bg-gradient-to-b"] .text-white\/50 {
    color: rgba(30, 41, 59, 0.95) !important;
}

/* Fix collections hero gradient overlay in light mode */
.light-mode .absolute.inset-0 .bg-gradient-to-t {
    background: linear-gradient(to top, rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.4)) !important;
}

/* Fix trending series text visibility in light mode */
.light-mode .bg-gradient-to-t.from-dark\/95 {
    background: linear-gradient(to top, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.3), transparent) !important;
}

/* Ensure trending series text is always visible */
.light-mode .absolute.inset-0 h3,
.light-mode .absolute.inset-0 p,
.light-mode .absolute.inset-0 span {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
}

/* Fix ecosystem section visibility in light mode */
.light-mode .grayscale.opacity-30 {
    opacity: 1 !important;
    filter: none !important;
    mix-blend-mode: normal !important;
}

.light-mode .grayscale.opacity-30:hover {
    opacity: 1 !important;
    filter: none !important;
    mix-blend-mode: normal !important;
}

/* Add dark background for ecosystem section in light mode */
.light-mode section[class*="bg-dark\/50"] .flex.flex-wrap {
    background: rgba(15, 23, 42, 0.1) !important;
    padding: 2rem !important;
    border-radius: 1rem !important;
}
.light-mode .text-white\/80 { color: rgba(15, 23, 42, 0.9) !important; }

.light-mode .hover\:text-white:hover { color: #8b5cf6 !important; }
.light-mode .hover\:bg-white\/10:hover { background-color: rgba(15, 23, 42, 0.1) !important; }
.light-mode .hover\:bg-white\/20:hover { background-color: rgba(15, 23, 42, 0.2) !important; }

.light-mode .border-white\/5 { border-color: rgba(15, 23, 42, 0.05) !important; }
.light-mode .border-white\/10 { border-color: rgba(15, 23, 42, 0.12) !important; }
.light-mode .border-white\/20 { border-color: rgba(15, 23, 42, 0.2) !important; }

.light-mode nav.nav-scrolled {
    background: rgba(248, 250, 252, 0.95) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1) !important;
}

.light-mode .glass {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: #0f172a !important;
}

.light-mode .glass-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    color: #0f172a !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

.light-mode .glass-card:hover {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.2) !important;
}

.light-mode #mobile-menu, .light-mode #dashboard-drawer {
    background-color: rgba(248, 250, 252, 0.95) !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

.light-mode input, .light-mode select, .light-mode textarea {
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.15) !important;
}

/* Fix text in specific elements */
.light-mode .opacity-30.group-hover\:opacity-100 span.text-2xl {
    color: #0f172a !important;
}


.light-mode .btn-outline { color: #0f172a !important; border-color: rgba(15, 23, 42, 0.2) !important; }
.light-mode .btn-outline:hover { color: #0f172a !important; border-color: var(--primary) !important; background: rgba(139, 92, 246, 0.05) !important; }
.light-mode .btn-primary { color: #ffffff !important; } /* Make sure primary maintains white text */


.light-mode .text-white\/10 { color: rgba(15, 23, 42, 0.2) !important; }
.light-mode .text-white\/20 { color: rgba(15, 23, 42, 0.4) !important; }


.light-mode .bg-dark\/30 { background-color: rgba(248, 250, 252, 0.3) !important; }
.light-mode .bg-dark\/40 { background-color: rgba(248, 250, 252, 0.4) !important; }
.light-mode .bg-dark\/60 { background-color: rgba(248, 250, 252, 0.6) !important; }
