/* 🚀 MANYOS UI/UX PRO MAX DESIGN SYSTEM */

/* 1. Global Theming Variables */
:root {
    --manyos-primary: #10b981; /* Eco Emerald Green */
    --manyos-primary-dark: #059669;
    --manyos-surface: #ffffff;
    --manyos-bg: #f8fafc; /* Soft Light Grey / Slate 50 */
    --manyos-text: #1e293b; /* Slate 800 */
    --manyos-text-muted: #64748b; /* Slate 500 */
    
    --manyos-gradient: linear-gradient(135deg, #34d399 0%, #10b981 100%); /* Fresh Eco Gradient */
    --manyos-shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.03);
    --manyos-shadow-premium: 0 10px 40px rgba(16, 185, 129, 0.12);
    
    --font-sans: 'Inter', sans-serif;
}

/* 🌙 Utility Classes for Shadow and Spacing */
.shadow-premium { box-shadow: var(--manyos-shadow-premium) !important; }
.shadow-indigo { box-shadow: 0 10px 30px rgba(79, 70, 229, 0.15) !important; }
.shadow-emerald { box-shadow: 0 10px 30px rgba(16, 185, 129, 0.15) !important; }
.shadow-amber { box-shadow: 0 10px 30px rgba(245, 158, 11, 0.15) !important; }
.hov-up { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.hov-up:hover { transform: translateY(-4px); }
.transition-all { transition: all 0.3s ease !important; }

[data-bs-theme="dark"] {
    --manyos-surface: #0f172a; /* Slate 900 */
    --manyos-bg: #020617; /* Slate 950 */
    --manyos-text: #f8fafc;
    --manyos-text-muted: #94a3b8;
    
    --manyos-primary: #10b981;
    --manyos-primary-dark: #34d399;
    --manyos-gradient: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    
    --manyos-shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
    --manyos-shadow-premium: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Force Bootstrap static background utilities to adapt to dark mode */
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white {
    background-color: var(--manyos-surface) !important;
    color: var(--manyos-text) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: var(--manyos-text) !important;
}

/* Force Card adaptive background in Dark Mode */
[data-bs-theme="dark"] .card {
    background-color: var(--manyos-surface);
    border-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .modal-content {
    background-color: var(--manyos-surface);
    border-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--manyos-text) !important;
}

body {
    font-family: var(--font-sans);
    background-color: var(--manyos-bg);
    color: var(--manyos-text);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 2. Glassmorphism Utilities */
.glass-panel {
    background: rgba(var(--bs-body-bg-rgb), 0.75) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--bs-body-color-rgb), 0.05);
}

.glass-border-top {
    border-top: 1px solid rgba(var(--bs-body-color-rgb), 0.08);
}

/* 3. Bottom Navbar (Mobile) */
.bottom-nav {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(var(--bs-body-bg-rgb), 0.9);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.05);
    z-index: 1040;
    padding-bottom: env(safe-area-inset-bottom); /* For iOS safe area */
}

[data-bs-theme="dark"] .bottom-nav {
    box-shadow: 0 -5px 25px rgba(0,0,0,0.4);
}

.bottom-nav .nav-item {
    color: var(--manyos-text-muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 12px;
}

.bottom-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.bottom-nav .nav-item.active {
    color: var(--manyos-primary);
}

.bottom-nav .nav-item.active i {
    transform: scale(1.1);
    font-weight: bold;
}

/* 4. Wallet Card & Components */
.wallet-card {
    background: var(--manyos-gradient);
    border: none;
    box-shadow: var(--manyos-shadow-premium);
    position: relative;
    z-index: 1;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: -1;
}

.card-custom {
    background-color: var(--manyos-surface);
    border: 1px solid rgba(var(--bs-body-color-rgb), 0.05);
    border-radius: 20px;
    box-shadow: var(--manyos-shadow-soft);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.card-interactive:hover {
    transform: translateY(-4px);
    box-shadow: var(--manyos-shadow-premium);
    cursor: pointer;
}

/* 5. Gamification Progress */
.progress-custom {
    height: 14px;
    border-radius: 12px;
    background-color: rgba(var(--bs-body-color-rgb), 0.05);
    overflow: hidden;
    position: relative;
}

.progress-bar-custom {
    background: var(--manyos-gradient);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect for progress bar */
.progress-bar-custom::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.badge-level {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--manyos-surface);
    color: var(--manyos-primary);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .badge-level {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-premium:hover {
    opacity: 0.95;
    box-shadow: var(--manyos-shadow-premium);
    transform: translateY(-2px);
    color: white;
}

/* 💎 Custom Themed Buttons */
.btn-indigo-600 { background-color: #4f46e5; color: white !important; border: none; }
.btn-indigo-600:hover { background-color: #4338ca; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(79, 70, 229, 0.2); }

.btn-emerald-600 { background-color: #059669; color: white !important; border: none; }
.btn-emerald-600:hover { background-color: #047857; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(5, 150, 105, 0.2); }

.btn-amber-500 { background-color: #f59e0b; color: white !important; border: none; }
.btn-amber-500:hover { background-color: #d97706; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(245, 158, 11, 0.2); }

.btn-rose-600 { background-color: #e11d48; color: white !important; border: none; }
.btn-rose-600:hover { background-color: #be123c; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(225, 29, 72, 0.2); }

.topbar h5 {
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    color: var(--manyos-text);
}

/* 6. Admin Sidebar & Layout (Enhanced) */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --topbar-height: 72px;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--manyos-surface);
    height: 100vh;
    box-shadow: var(--manyos-shadow-soft);
    border-right: 1px solid rgba(var(--bs-body-color-rgb), 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1030;
    position: fixed;
    top: 0;
    left: 0;
    overflow-x: hidden;
}

.main-content {
    margin-left: var(--sidebar-width);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Collapsed State */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar .sidebar-brand-text,
.sidebar-collapsed .sidebar .nav-link span,
.sidebar-collapsed .sidebar .sidebar-heading {
    display: none !important;
}

.sidebar-collapsed .sidebar .nav-link {
    text-align: center;
    padding: 12px 0;
    margin: 4px 15px;
}

.sidebar-collapsed .sidebar .nav-link i {
    margin: 0 !important;
    font-size: 1.25rem;
}

.sidebar-collapsed .sidebar .sidebar-logo {
    margin: 0 auto !important;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0 !important;
    }
    .sidebar-mobile-open .sidebar {
        transform: translateX(0);
        width: var(--sidebar-width) !important;
    }
    .sidebar-mobile-open .sidebar-overlay {
        display: block;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1025;
}

.nav-link {
    color: var(--manyos-text-muted);
    padding: 12px 20px;
    border-radius: 12px;
    margin: 4px 12px;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    text-wrap: nowrap;
}

.nav-link i {
    font-size: 1.1rem;
    min-width: 24px;
}

.nav-link.active, .nav-link:hover {
    background-color: #eef2ff !important; /* bg-indigo-50 */
    color: #4f46e5 !important; /* text-indigo-600 */
}

.nav-link.active .nav-icon-wrapper i {
    color: #4f46e5 !important;
}

[data-bs-theme="dark"] .nav-link.active, [data-bs-theme="dark"] .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #818cf8 !important; /* Indigo 400 for Dark mode */
}

.sidebar-heading {
    padding: 24px 24px 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--manyos-text-muted);
    opacity: 0.6;
}

/* Table overrides for Premium feel */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--manyos-text);
}
.table > :not(caption) > * > * {
    padding: 1rem 1rem;
    border-bottom-color: rgba(var(--bs-body-color-rgb), 0.05);
}
.table thead th {
    font-weight: 600;
    color: var(--manyos-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* SweetAlert overrides */
div:where(.swal2-container) div:where(.swal2-popup) {
    border-radius: 24px;
    font-family: var(--font-sans);
    background: var(--manyos-surface);
    color: var(--manyos-text);
}
/* 7. Color Utility Classes (Tailwind-like) */
.fw-extra-bold { font-weight: 800; }
.tracking-widest { letter-spacing: 0.1em; }

/* 🛡️ Legibility Fixes for Badges & Small Text */
.badge {
    color: inherit; /* Override default white if text-class is present */
}

/* Base Color Utilities (Pro Max Saturated) */
.text-indigo-600 { color: #4f46e5 !important; }
.text-indigo-700 { color: #4338ca !important; }
.text-indigo-900 { color: #1e1b4b !important; }
.bg-indigo-50 { background-color: #eef2ff !important; }
.border-indigo-100 { border-color: #e0e7ff !important; }

.text-emerald-600 { color: #059669 !important; }
.text-emerald-700 { color: #047857 !important; }
.bg-emerald-50 { background-color: #ecfdf5 !important; }
.border-emerald-100 { border-color: #d1fae5 !important; }

.text-rose-600 { color: #e11d48 !important; }
.text-rose-700 { color: #be123c !important; }
.bg-rose-50 { background-color: #fff1f2 !important; }
.border-rose-100 { border-color: #ffe4e6 !important; }

.text-amber-600 { color: #d97706 !important; }
.text-amber-700 { color: #b45309 !important; }
.text-amber-900 { color: #451a03 !important; }
.bg-amber-50 { background-color: #fffbeb !important; }
.border-amber-100 { border-color: #fef3c7 !important; }

.text-slate-400 { color: #94a3b8 !important; }
.text-slate-500 { color: #64748b !important; }
.text-slate-600 { color: #475569 !important; }
.text-slate-700 { color: #334155 !important; }
.bg-slate-50 { background-color: #f8fafc !important; }
.border-slate-100 { border-color: #f1f5f9 !important; }

/* Semantic Mappings */
.bg-success-50 { background-color: #ecfdf5 !important; } .text-success-600 { color: #059669 !important; } .border-success-100 { border-color: #d1fae5 !important; }
.bg-danger-50 { background-color: #fff1f2 !important; } .text-danger-600 { color: #e11d48 !important; } .border-danger-100 { border-color: #ffe4e6 !important; }
.bg-warning-50 { background-color: #fffbeb !important; } .text-warning-600 { color: #d97706 !important; } .border-warning-100 { border-color: #fef3c7 !important; }
.bg-info-50 { background-color: #f0f9ff !important; } .text-info-600 { color: #0284c7 !important; } .border-info-100 { border-color: #e0f2fe !important; }
