:root {
    /* Base colors */
    --background: #0f172a;
    --foreground: #f8fafc;
    --card: #1e293b;
    --card-foreground: #f8fafc;
    --popover: #1e293b;
    --popover-foreground: #f8fafc;
    --primary: #3b82f6;
    --primary-foreground: #f8fafc;
    --secondary: #334155;
    --secondary-foreground: #f8fafc;
    --muted: #334155;
    --muted-foreground: #94a3b8;
    --accent: #334155;
    --accent-foreground: #f8fafc;
    --destructive: #ef4444;
    --destructive-foreground: #f8fafc;
    --border: #334155;
    --input: #334155;
    --ring: #3b82f6;

    /* Radius */
    --radius: 0.5rem;
}

/* Base styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    padding-top: 80px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #60a5fa;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background: linear-gradient(to right, #2563eb, #7c3aed);
    color: var(--primary-foreground);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover {
    background-color: #475569;
}

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

.btn-outline:hover {
    background-color: var(--secondary);
}

/* Cards */
.card {
    background-color: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    background-color: var(--input);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Navigation */
.navbar {
    background-color: var(--background);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    height: 80px;
}

.mt-navbar {
    margin-top: 80px !important;
}

.pt-navbar {
    padding-top: 80px !important;
}

/* Large spacing for error pages to center content properly */
.mt-150 {
    margin-top: 150px !important;
}

.mb-150 {
    margin-bottom: 150px !important;
}


.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
}

.navbar-menu a {
    color: var(--foreground);
    font-weight: 500;
}

.navbar-menu a:hover {
    color: var(--primary);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile menu */
.mobile-menu-button-container {
    display: none;
}

.mobile-menu-button {
    background: none;
    border: none;
    color: var(--foreground);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-button:hover {
    color: var(--primary);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 1rem;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    width: 100%;
    position: absolute;
    top: 80px; /* below navbar */
    left: 0;
    right: 0;
    z-index: 99;
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}

.mobile-menu a {
    padding: 0.75rem 0;
    color: var(--foreground);
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    color: var(--foreground);
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.mobile-menu .menu-item[data-submenu] {
    justify-content: space-between;
    position: relative;
}

.mobile-menu .menu-item .left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-menu .menu-item[data-submenu] .chevron {
    transition: transform 0.3s ease;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: var(--foreground) !important;
    font-size: 0.8rem !important;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu .menu-item[data-submenu].active .chevron {
    transform: translateY(-50%) rotate(180deg);
}

.mobile-menu .submenu {
    display: none;
    padding-left: 1rem;
    background-color: var(--background);
}

.mobile-menu .submenu.show {
    display: block;
}

.mobile-menu .submenu a {
    padding: 0.5rem 0;
    color: var(--muted-foreground);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.mobile-menu .submenu a:last-child {
    border-bottom: none;
}

/* Mobile Language Switcher */
.mobile-language-switcher {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.mobile-language-switcher .language-switcher {
    width: 100%;
}

.mobile-language-switcher .language-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--background);
    border: 1px solid var(--border);
}

.mobile-language-switcher .language-menu {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    margin-top: 0.5rem;
    box-shadow: none;
    border: 1px solid var(--border);
    background: var(--background);
}

.mobile-language-switcher .language-option {
    padding: 0.75rem 1rem;
    border-radius: 0;
    margin: 0;
    border-bottom: 1px solid var(--border);
}

.mobile-language-switcher .language-option:last-child {
    border-bottom: none;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    min-width: 200px;
    background-color: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-content a {
    color: var(--foreground);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--secondary);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Hero section */
.hero {
    padding: 8rem 0 4rem;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    max-width: 36rem;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--muted-foreground);
    font-size: 1rem;
}

/* Project cards */
.project-card {
    background-color: transparent;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    border-color: rgba(148, 163, 184, 0.4);
}

.project-card-image {
    height: 420px;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.5);
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.project-card:hover .project-card-image img {
    transform: scale(1.05);
}

.project-card-content {
    padding: 1.5rem;
    background: transparent;
}

.project-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--foreground);
    line-height: 1.3;
}

.project-card-location {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin: 0;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Progress bar */
.progress {
    height: 0.5rem;
    background-color: var(--secondary);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    border-radius: 9999px;
}

/* Tabs */
.tabs {
    display: inline-flex;
    background-color: var(--secondary);
    border-radius: 9999px;
    padding: 0.25rem;
}

.tab {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: none;
    border: none;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background-color: var(--card);
    color: var(--foreground);
}

/* Grid system */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
    .grid-cols-md-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-md-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-cols-lg-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Footer */
.footer {
    background-color: var(--card);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--muted-foreground);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--foreground);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background-color: var(--secondary);
    color: var(--foreground);
    transition: all 0.2s;
}

.footer-social a:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
}

.footer-copyright {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: var(--muted-foreground);
    font-size: 1.125rem;
}

.dashboard-line {
    height: 1px;
    background-color: var(--border);
    margin: 2rem 0;
}

.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dashboard-section-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 1rem;
    font-weight: 500;
    color: var(--muted-foreground);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

/* Testimonials */
.testimonial-card {
    background-color: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.testimonial-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.testimonial-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.testimonial-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: #0f172a;
}

.testimonial-stars {
    color: #f59e0b;
}

.testimonial-text {
    color: #334155;
    font-style: italic;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
}

.cta-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
}

.cta-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 36rem;
    margin: 0 auto 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: white;
    color: #3b82f6;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.cta-button i {
    margin-left: 0.5rem;
}

.cta-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-3px);
}

/* Animations */
.animate-fadeIn {
    animation: fadeIn 1s ease-out;
}

.animate-slideUp {
    animation: slideUp 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Text gradient */
.text-gradient {
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Left Side Menu */
.side-left-menu {
    position: fixed;
    left: 0;
    top: 80px;
    transform: none;
    width: 240px;
    height: calc(100vh - 80px);
    background: var(--card);
    border-radius: 0 var(--radius) var(--radius) 0;
    z-index: 90;
    transition: background-color 0.3s ease;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Collapsed sidebar */
body.sidebar-collapsed .side-left-menu { width: 72px; }
body.sidebar-collapsed .side-left-menu .nav-text { display: none; }
body.sidebar-collapsed .sidebar-header .investor-tier,
body.sidebar-collapsed .sidebar-header .wallet-block { display: none; }
body.sidebar-collapsed .sidebar-header { padding: 44px 8px 8px 8px; text-align: center; }
/* ensure avatar sits below toggle when collapsed */
body.sidebar-collapsed .avatar-initials { margin-top: 4px; }
/* Improve collapsed icon-only navigation */
body.sidebar-collapsed .side-left-menu a { justify-content: center; padding: 12px 8px; }
body.sidebar-collapsed .side-left-menu i { min-width: 0; margin: 0; font-size: 1.2rem; }
body.sidebar-collapsed .menu-item .chevron { display: none; }
body.sidebar-collapsed .submenu { display: none !important; }
body.sidebar-collapsed .avatar-initials { width: 40px; height: 40px; font-size: 1rem; margin: 0 auto; }
body.sidebar-collapsed .sidebar-toggle { right: 8px; }

.side-left-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-left-menu li {
    width: 100%;
    margin-bottom: 5px;
}

.side-left-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--foreground);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
/* Better hit area and rounded pill on hover when expanded */
.side-left-menu a { border-radius: 12px; margin: 4px 8px; }
body.sidebar-collapsed .side-left-menu a { border-radius: 8px; margin: 4px 6px; }

.side-left-menu a:hover {
    background-color: var(--secondary);
    border-left: 3px solid var(--primary);
}

.side-left-menu a.active {
    background-color: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--primary);
}

.side-left-menu i, .side-left-menu .left-menu-img {
    font-size: 1.25rem;
    min-width: 30px;
    text-align: center;
    color: var(--primary);
}

.side-left-menu .nav-text {
    margin-left: 10px;
    white-space: nowrap;
    opacity: 1;
    transition: color 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.scrollbar {
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
}

.scrollbar::-webkit-scrollbar {
    width: 5px;
    display: none; /* Hide scrollbar by default */
}

.side-left-menu .scrollbar::-webkit-scrollbar { display: none; }

.scrollbar::-webkit-scrollbar-track {
    background: var(--card);
}

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

/* Sidebar section headers */
.menu-section {
    padding: 8px 15px;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.side-left-menu .menu-section { opacity: 0.9; }

/* Responsive */
@media (max-width: 768px) {
    .navbar-menu, .navbar-actions {
        display: none;
    }

    .mobile-menu-button-container {
        display: block;
    }

    .mobile-menu.show {
        display: flex;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
    }

    .side-left-menu { display: none; }

    .main-content { margin-left: 0 !important; }
}

/* Sidebar header (avatar, tier, wallet) */
.sidebar-header { padding: 18px 16px 10px 16px; border-bottom: 1px solid var(--border); }
.avatar-initials { width: 48px; height: 48px; border-radius: 9999px; background-color: var(--secondary); color: var(--foreground); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.25rem; }
.investor-tier { color: var(--muted-foreground); font-size: 0.95rem; margin-top: 10px; }
.wallet-block { margin-top: 16px; }
.wallet-title { font-weight: 600; }
.wallet-sub { color: var(--muted-foreground); font-size: 0.75rem; letter-spacing: 0.03em; }
.wallet-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.wallet-amount { font-size: 1.4rem; font-weight: 600; }
.btn-round { width: 30px; height: 30px; border-radius: 9999px; background-color: #22c55e; color: white; display: inline-flex; align-items: center; justify-content: center; border: none; }
.btn-round:hover { filter: brightness(1.05); }

/* Sidebar toggle button */
.sidebar-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background-color: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.sidebar-toggle:hover { background-color: #475569; }
/* when collapsed, keep toggle clear of avatar */
body.sidebar-collapsed .sidebar-toggle { top: 8px; right: 8px; }
/* horizontally center toggle in collapsed menu */
body.sidebar-collapsed .sidebar-toggle { left: 50%; right: auto; transform: translateX(-50%); }

/* Chevron for expandable groups (placeholder visuals) */
.menu-item { display: flex; align-items: center; justify-content: space-between; }
.menu-item .left { display: inline-flex; align-items: center; }
.menu-item .chevron { color: var(--muted-foreground); }

/* Content offset for sidebar */
.main-content { margin-left: 240px; transition: margin-left 0.2s ease; }
body.sidebar-collapsed .main-content { margin-left: 72px; }
/* footer offset to prevent overlay */
.footer { margin-left: 240px; transition: margin-left 0.2s ease; }
body.sidebar-collapsed .footer { margin-left: 72px; }
@media (max-width: 768px) {
    .footer { margin-left: 0; }
}

/* Submenu */
.submenu { display: none; padding: 8px 0 8px 46px; }
.submenu.show { display: block; }
.submenu a { padding: 10px 15px; border-left: none; color: var(--foreground); opacity: 0.95; }
.submenu a:hover { background-color: rgba(255,255,255,0.06); border-left: none; }

/* Chart container */
.chart-container {
    width: 100%;
    height: 300px;
}
