/* =========================================
   1. THEME ENGINE (Light & Dark Mode)
   ========================================= */
:root {
    /* --- CORE BRAND COLORS --- */
    --primary-color: #4F46E5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --accent-color: #F43F5E; /* Rose 500 */
    /* --- LIGHT MODE DEFAULTS (Clean & Professional) --- */
    --bg-body: #F3F4F6;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --bg-input: #f9fafb;
    --text-main: #111827; /* Almost Black */
    --text-muted: #6B7280; /* Gray 500 */
    --border-color: rgba(0,0,0,0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    /* Hero Gradient (Light Mode) */
    --hero-gradient: linear-gradient(135deg, #4F46E5 0%, #F43F5E 100%);
}

/* --- DARK MODE OVERRIDES (The "Indigo Purplish" Theme) --- */
[data-theme="dark"] {
    /* The "Mind Blowing" Gradient 
       Fixed attachment keeps the gradient smooth while scrolling 
    */
    --bg-body: linear-gradient(135deg, #020617 0%, #1e1b4b 50%, #2e1065 100%);
    /* Glassy Cards (Dark) - Semi-transparent dark blue/black */
    --bg-card: rgba(15, 23, 42, 0.65);
    /* Navbar Glass */
    --bg-glass: rgba(15, 23, 42, 0.85);
    /* Inputs - Darker than cards to create depth */
    --bg-input: rgba(2, 6, 23, 0.5);
    /* Text - Bright White/Off-White for readability */
    --text-main: #f8fafc;
    --text-muted: #cbd5e1; /* Lighter gray for dark mode */
    /* Borders - Subtle Purple Glow */
    --border-color: rgba(129, 140, 248, 0.15);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

body {
    background: var(--bg-body);
    background-attachment: fixed; /* Ensures gradient doesn't scroll with content */
    background-size: cover;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    transition: color 0.3s ease; /* We remove bg transition because gradients can't transition smoothly */
}

/* =========================================
   2. BOOTSTRAP OVERRIDES (Global Visibility Fixes)
   ========================================= */

/* Fix: Force "text-dark" to be White in Dark Mode */
.text-dark, .text-body {
    color: var(--text-main) !important;
}

/* Fix: Make muted text lighter in Dark Mode so it's visible */
.text-muted {
    color: var(--text-muted) !important;
}

/* Fix: Card Backgrounds & Borders */
.card, .list-group-item {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px); /* The Glass Effect */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

/* Fix: Inputs (Search bars, text areas, selects) */
.form-control, .form-select, .input-group-text {
    background-color: var(--bg-input) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

    /* Fix: Placeholder text color */
    .form-control::placeholder {
        color: var(--text-muted);
        opacity: 0.6;
    }

/* Fix: Dropdown Menus */
.dropdown-menu {
    background-color: var(--bg-glass); /* Solid dark color for legibility */
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-hover);
}

[data-theme="dark"] .dropdown-menu {
    background-color: #1e1b4b; /* Deep Indigo for dropdowns */
}

.dropdown-item {
    color: var(--text-main);
}

    .dropdown-item:hover {
        background-color: var(--primary-color);
        color: white;
    }

.dropdown-divider {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .card-title, .card-desc {
    color: var(--text-main);
}

/* =========================================
   3. NAVBAR SPECIFICS
   ========================================= */

/* Ensure Navbar text is visible */
.navbar-light .navbar-nav .nav-link,
.navbar-light .navbar-brand {
    color: var(--text-main) !important;
}

/* Invert Hamburger Menu Icon in Dark Mode */
.navbar-light .navbar-toggler-icon {
    filter: invert(0);
}

[data-theme="dark"] .navbar-light .navbar-toggler-icon {
    filter: invert(1);
}

/* Glass Navbar */
.glass-nav {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

/* =========================================
   4. CUSTOM COMPONENT STYLES
   ========================================= */

/* Feature Cards (Dashboard) */
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-align: center;
    backdrop-filter: blur(10px);
}

    .dashboard-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-hover);
        border-color: var(--primary-color);
        /* Add a subtle glow on hover in dark mode */
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.15);
    }

/* Icon Bubbles */
.icon-bubble {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    transition: transform 0.3s ease;
}

/* Bubble Colors (Keep these bright) */
.bubble-market {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.bubble-community {
    background: rgba(79, 70, 229, 0.1);
    color: #6366f1;
}

.bubble-team {
    background: rgba(244, 63, 94, 0.1);
    color: #F43F5E;
}

.bubble-ai {
    background: rgba(14, 165, 233, 0.1);
    color: #0EA5E9;
}

/* Utilities */
.hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .hover-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-hover) !important;
    }

.rounded-4 {
    border-radius: 1rem !important;
}

.bg-light {
    background-color: var(--bg-input) !important;
}

/* Modal Fixes for Dark Mode */
.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.text-gradient {
    background: linear-gradient(135deg, #4F46E5 0%, #F43F5E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Animated Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.4;
    animation: float 10s infinite ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--primary-color);
}

.blob-2 {
    bottom: 10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: var(--accent-color);
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(20px, 40px) scale(1.1);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

.hover-up:hover {
    transform: translateY(-4px);
    transition: transform 0.2s;
}

/* --- Navbar Animations & Mobile Polish --- */

/* Slide Animation for Dropdowns */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide {
    animation: slideDown 0.2s ease forwards;
}

/* Offcanvas (Mobile Menu) Styling */
.offcanvas {
    background-color: var(--bg-card); /* Matches theme card color */
    color: var(--text-main);
}

.offcanvas-header {
    border-bottom-color: var(--border-color) !important;
}

/* Close Button Color Fix for Dark Mode */
.btn-close {
    filter: none;
    color: var(--text-main);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dropdown Tweaks */
.dropdown-menu {
    min-width: 240px;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    font-weight: 500;
}

.hover-bg-danger-soft:hover {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

/* Navbar Brand Icon */
.navbar-brand:hover div {
    background-color: var(--primary-color) !important;
    color: white !important;
    transition: all 0.3s ease;
}
/* Fix Invisible Drawer in Dark Mode */
.offcanvas {
    background-color: var(--bg-card) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -5px 0 25px rgba(0,0,0,0.2);
}

    /* Ensure text inside offcanvas is visible */
    .offcanvas .nav-link,
    .offcanvas .offcanvas-title,
    .offcanvas .btn-close {
        color: var(--text-main) !important;
    }

/* Make sure the desktop menu still works horizontally */
@media (min-width: 992px) {
    .offcanvas {
        position: static;
        z-index: auto;
        height: auto;
        width: auto;
        visibility: visible !important;
        background-color: transparent !important;
        border: 0 !important;
        transform: none !important;
        box-shadow: none;
        backdrop-filter: none;
    }

    .offcanvas-header {
        display: none;
    }

    .offcanvas-body {
        padding: 0;
        overflow: visible;
    }
}

/* Tab Pill Active Styles */
.nav-pills .nav-link {
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

    .nav-pills .nav-link.active {
        background-color: var(--primary-color) !important;
        color: white !important;
        box-shadow: 0 8px 15px rgba(79, 70, 229, 0.3) !important;
        border-color: var(--primary-color);
    }

.empty-state {
    text-align: center;
    padding: 5rem 1rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 2rem;
    backdrop-filter: blur(10px);
}

    .empty-state i {
        font-size: 5rem;
        display: block;
        margin-bottom: 1.5rem;
    }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Dark Mode Hover Tweak */
[data-theme="dark"] .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Profile specific tweaks */
[data-theme="dark"] .border-white {
    border-color: var(--border-color) !important;
}

.hover-up:hover {
    transform: translateY(-2px);
    transition: transform 0.2s;
}
/* Specific styling for the floating inputs in Dark Mode */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--primary-color) !important;
    opacity: 1;
}

[data-theme="dark"] .border-color {
    border-color: var(--border-color) !important;
}

.hover-up:transition {
    transition: transform 0.2s ease-in-out;
}

.hover-up:hover {
    transform: scale(1.1);
}

@media (min-width: 1400px) {
    ._col-xl-4 {
        flex: 0 0 auto;
        width: 33.33333333%;
    }
}

@media (min-width: 994px ) and ( max-width: 1400px) {
    ._col-md-6 {
        flex: 0 0 auto;
        width: 50%;
    }
}