:root {
    /* ===== Core Design Tokens ===== */

    /* Premium Dark Palette */
    --p-950: #020617;
    --p-900: #0f172a;
    --p-800: #1e293b;
    --p-700: #334155;
    --p-600: #475569;
    --p-500: #64748b;

    /* Brand Colors */
    --brand: #1e40af;
    --brand-light: #3b82f6;
    --accent-blue: #2563eb;

    /* Slate Scale (used everywhere) */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Gray Scale (aliases — many components reference --gray-*) */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Primary Scale */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --purple-500: #8b5cf6;

    /* Semantic: Success */
    --success: #15803d;
    --success-50: #f0fdf4;
    --success-bg: #f0fdf4;
    --success-600: #16a34a;
    --success-700: #15803d;

    /* Semantic: Danger */
    --danger: #b91c1c;
    --danger-50: #fef2f2;
    --danger-bg: #fef2f2;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;

    /* Semantic: Warning */
    --warning: #b45309;
    --warning-bg: #fffbe6;

    /* Spacing */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-6: 1.5rem;
    --s-8: 2rem;
    --s-12: 3rem;

    /* Spacing Aliases (used by existing classes) */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Surfaces */
    --bg-surface: #f8fafc;
    --card-bg: #ffffff;
    --card-surface: #ffffff;
    --card-border: #e2e8f0;
    --border-subtle: #e2e8f0;

    /* Radii */
    --r-xs: 2px;
    --r-sm: 4px;
    --r-md: 6px;
    --r-lg: 8px;
    --r-xl: 12px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-subtle: 0 1px 3px 0 rgb(0 0 0 / 0.06);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Transitions */
    --anim-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --anim-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, system-ui, sans-serif;
    background-color: var(--bg-surface);
    color: var(--slate-900);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--s-6);
}

/* ===== Strategic Header ===== */
.header {
    background: var(--p-900);
    color: white;
    padding: var(--s-4) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--s-6);
}

.header-buttons {
    display: flex;
    gap: var(--s-2);
    margin-left: var(--s-4);
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: var(--slate-300);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.watchlist-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--p-900);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.logo-text h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--slate-400);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-top: 4px;
}

.header-stats {
    display: flex;
    gap: var(--s-8);
}

.stat-item {
    text-align: right;
}

.stat-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 800;
    color: white;
}

/* ===== Main Content ===== */
.main-content {
    padding: var(--spacing-xl) 0;
}

/* ===== Search Section ===== */
.search-section {
    margin-bottom: var(--spacing-lg);
}

.search-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
    animation: slideUp 0.5s ease-out;
}

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

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

.search-header {
    margin-bottom: var(--spacing-md);
}

.search-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-600);
    margin-bottom: var(--spacing-xs);
}

.search-header p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.6rem 2.8rem 0.6rem 2.8rem;
    font-size: 0.9rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    transition: all var(--transition-base);
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.clear-btn {
    position: absolute;
    right: var(--spacing-md);
    background: var(--gray-200);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-600);
    transition: all var(--transition-fast);
}

.clear-btn:hover {
    background: var(--gray-300);
    color: var(--gray-900);
}

/* ===== Search Results ===== */
.search-results {
    margin-top: var(--spacing-xl);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--gray-100);
}

.results-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.results-count {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 600;
    background: var(--primary-50);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

.results-list {
    display: grid;
    gap: var(--spacing-md);
    max-height: 400px;
    overflow-y: auto;
    padding-right: var(--spacing-sm);
}

/* Custom Scrollbar */
.results-list::-webkit-scrollbar {
    width: 8px;
}

.results-list::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

.results-list::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 10px;
    transition: background var(--transition-fast);
}

.results-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.result-item {
    padding: var(--spacing-md);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    background: white;
}

.result-item:hover {
    border-color: var(--primary-500);
    box-shadow: var(--shadow-subtle);
    transform: translateY(-1px);
}

.result-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.result-code {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-family: 'Courier New', monospace;
}

/* ===== Popular Funds ===== */
.popular-funds {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-100);
}

.popular-funds h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fund-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fund-chip {
    padding: 0.35rem 0.85rem;
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.fund-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-500);
}

.fund-chip:active {
    transform: translateY(0);
}

/* ===== Fund Details Section ===== */
.fund-details-section {
    margin-bottom: var(--spacing-2xl);
    animation: slideUp 0.5s ease-out;
}

.fund-details-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-xl);
}

.fund-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--gray-100);
}

.fund-header-left {
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-start;
}

.fund-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-500), var(--purple-500));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.fund-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.fund-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.fund-meta-item {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.separator {
    color: var(--gray-300);
}

.close-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

/* ===== NAV Stats ===== */
.nav-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.nav-stat-card {
    padding: var(--spacing-lg);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-100);
    transition: all var(--transition-base);
}

.nav-stat-card.primary {
    background: linear-gradient(135deg, var(--primary-500), var(--purple-500));
    border: none;
    color: white;
}

.nav-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-stat-card.primary .nav-stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.nav-stat-value {
    font-size: 1.875rem;
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
}

.nav-stat-card:not(.primary) .nav-stat-value {
    color: var(--gray-900);
}

.nav-stat-date {
    font-size: 0.75rem;
    opacity: 0.7;
}

.nav-stat-card.primary .nav-stat-date {
    color: rgba(255, 255, 255, 0.8);
}

.nav-stat-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 700;
    margin-top: var(--spacing-xs);
}

.nav-stat-badge.positive {
    background: var(--success-50);
    color: var(--success-600);
}

.nav-stat-badge.negative {
    background: var(--danger-50);
    color: var(--danger-600);
}

/* ===== Chart Controls ===== */
.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.time-range-buttons {
    display: flex;
    gap: var(--spacing-sm);
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.time-range-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.time-range-btn:hover {
    color: var(--gray-900);
}

.time-range-btn.active {
    background: white;
    color: var(--primary-600);
    box-shadow: var(--shadow-sm);
}

/* ===== Chart Container ===== */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: var(--spacing-xl);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

/* ===== Additional Info ===== */
.additional-info {
    padding: var(--spacing-lg);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* ===== All Schemes Section ===== */
.all-schemes-section {
    animation: slideUp 0.5s ease-out 0.2s backwards;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--slate-900);
}

.primary-btn,
.secondary-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: inherit;
}

.primary-btn {
    background: var(--accent-blue);
    color: white;
    box-shadow: var(--shadow-sm);
}

.primary-btn:hover {
    background: #1d4ed8;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.secondary-btn {
    background: transparent;
    color: var(--slate-700);
    border: 1px solid var(--slate-300);
}

.secondary-btn:hover {
    background: var(--slate-50);
    border-color: var(--slate-400);
}

.schemes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.scheme-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--card-border);
}

.scheme-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-500);
}

.scheme-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.scheme-card-code {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-family: 'Courier New', monospace;
}

.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-xl);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--spacing-md);
}

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

.loading-spinner p {
    font-size: 1rem;
    font-weight: 600;
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    background: var(--gray-900);
    color: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    transform: translateY(150%);
    transition: transform var(--transition-base);
    z-index: 3000;
    max-width: 400px;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast.show {
    transform: translateY(0);
}

.toast.error {
    background: var(--danger-600);
}

.toast.success {
    background: var(--success-600);
}

/* ===== Market Insights Section ===== */
.market-insights-section {
    margin-bottom: var(--spacing-xl);
    animation: slideUp 0.5s ease-out 0.1s backwards;
}

.insights-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--gray-100);
}

.insights-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-900);
}

.refresh-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary-50);
    border-radius: var(--radius-sm);
    color: var(--primary-600);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    background: var(--primary-100);
    transform: rotate(180deg);
}

.market-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.summary-stat {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
}

.summary-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--gray-900);
}

/* ===== Trending Section ===== */
.trending-section {
    margin-bottom: var(--spacing-2xl);
    animation: slideUp 0.5s ease-out 0.15s backwards;
}

.trending-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: var(--spacing-lg);
}

.trending-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.trending-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--slate-300);
    transform: translateY(-3px);
}

.trending-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
    gap: var(--spacing-xs);
}

.trending-rank {
    width: 24px;
    height: 24px;
    background: var(--primary-600);
    color: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.trending-rank.gold {
    background: #ca8a04;
}

.trending-rank.silver {
    background: #4b5563;
}

.trending-rank.bronze {
    background: #92400e;
}

.trending-info {
    flex: 1;
}

.trending-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    line-height: 1.25;
}

.trending-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.trending-logo {
    width: 43px;
    height: 43px;
    object-fit: contain;
    background: white;
    padding: 2px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--slate-200);
}

.trending-score {
    text-align: right;
    background: var(--slate-50);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--slate-200);
}

.trending-value {
    font-size: 1.05rem;
    font-weight: 800;
}

.trending-value.positive {
    color: var(--success-600);
}

.trending-value.negative {
    color: var(--danger-600);
}

.trending-label {
    font-size: 0.725rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.trending-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--slate-100);
    margin-top: auto;
    background: var(--slate-50);
    margin-left: calc(var(--spacing-lg) * -1);
    margin-right: calc(var(--spacing-lg) * -1);
    margin-bottom: calc(var(--spacing-lg) * -1);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.trending-stat-item {
    text-align: center;
}

.trending-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.125rem;
}

.trending-stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
}

.trending-rating {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--success-50);
    color: var(--success-700);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.trending-sentiment {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 1.125rem;
}

.trending-sentiment.bullish {
    background: var(--success-50);
    color: var(--success-700);
}

.trending-sentiment.bearish {
    background: var(--danger-50);
    color: var(--danger-700);
}

.trending-sentiment.neutral {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* ===== Invest Button Styles ===== */
.invest-btn {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
    min-width: 100px;
}

.invest-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
}

.invest-btn:active {
    transform: translateY(0);
}

/* ===== Investment Modal Styles ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.invest-modal {
    background: white;
    width: 95%;
    max-width: 850px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .invest-modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #111827;
}

.modal-body {
    padding: 24px;
}

.inv-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.inv-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.inv-tab.active {
    color: #4F46E5;
    border-bottom-color: #4F46E5;
}

.amount-input-group {
    position: relative;
    margin-bottom: 16px;
}

.currency-symbol {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #6b7280;
}

.amount-input {
    width: 100%;
    padding: 12px 16px 12px 32px;
    font-size: 1.25rem;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
}

.amount-input:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.quick-amounts {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.quick-pill {
    padding: 6px 12px;
    background: #eef2ff;
    color: #4F46E5;
    border: 1px solid #e0e7ff;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.quick-pill:hover {
    background: #e0e7ff;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-outline {
    border: 1px solid #4F46E5;
    color: #4F46E5;
    background: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-outline:hover {
    background: #eef2ff;
}

.btn-primary {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25);
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary:hover {
    box-shadow: 0 8px 12px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

/* Fund Details Modal Tabs */
.fund-tabs-container {
    background: #ffffff;
    padding: 4px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.fund-tab {
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #6b7280;
    transition: all 0.2s ease;
    text-align: center;
    flex: 1;
}

.fund-tab:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.fund-tab.active {
    background-color: #4f46e5;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2), 0 2px 4px -1px rgba(79, 70, 229, 0.1);
}

/* ===== Partners Section ===== */
.partners-section {
    padding: var(--spacing-2xl) 0;
    text-align: center;
    background: #f1f5f9;
    border-radius: var(--radius-lg);
    margin-top: var(--spacing-2xl);
    border: none;
}

.partners-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--slate-900);
    margin-bottom: var(--spacing-xs);
}

.partners-header p {
    font-size: 1rem;
    color: var(--slate-500);
    margin-bottom: var(--spacing-2xl);
}

.partners-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 1300px;
    margin: 0 auto var(--spacing-2xl);
    padding: 0 var(--spacing-xl);
}

.partner-item {
    width: 80px;
    height: 80px;
    background: white;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.partner-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-blue);
}

.partner-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.partners-cta {
    margin-top: var(--spacing-lg);
}

.view-partners-btn {
    padding: 0.6rem 2rem;
    background: #1e4ed8;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}

.view-partners-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===== Performance Comparison Table ===== */
.performance-section {
    margin-bottom: var(--spacing-2xl);
    animation: slideUp 0.5s ease-out 0.2s backwards;
}

.performance-table-container {
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    box-shadow: var(--shadow-md);
}

.performance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
    min-width: 1100px;
}

.performance-table th {
    background: #f8fafc;
    padding: var(--spacing-md) var(--spacing-lg);
    font-weight: 700;
    color: var(--slate-700);
    border-bottom: 2px solid var(--slate-200);
    white-space: nowrap;
}

.performance-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--slate-100);
    vertical-align: middle;
}

.performance-table tr:hover {
    background: #f1f5f9;
}

.sticky-col {
    position: sticky;
    left: 0;
    background: white;
    z-index: 10;
    border-right: 2px solid var(--slate-100);
    min-width: 300px;
}

.performance-table th.sticky-col {
    background: #f8fafc;
}

.performance-table tr:hover .sticky-col {
    background: #f1f5f9;
}

.fund-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fund-cell img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: white;
    padding: 3px;
    border-radius: 4px;
    border: 1px solid var(--slate-200);
}

.fund-title-group {
    display: flex;
    flex-direction: column;
}

.fund-name-label {
    font-weight: 800;
    color: var(--slate-900);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.return-val {
    font-weight: 700;
}

.return-val.positive {
    color: #16a34a;
}

.return-val.negative {
    color: #dc2626;
}

.aum-val {
    font-weight: 600;
    color: var(--slate-600);
}

.age-val {
    color: var(--slate-500);
}

.table-invest-btn {
    padding: 6px 16px;
    border: 1px solid var(--primary-600);
    color: var(--primary-600);
    background: white;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.table-invest-btn:hover {
    background: var(--primary-600);
    color: white;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--p-900);
    color: var(--slate-400);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
    margin-top: var(--spacing-2xl);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-xl);
}

.footer-brand h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    font-size: 0.85rem;
    color: var(--slate-500);
    max-width: 320px;
    line-height: 1.6;
}

.footer-links h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-300);
    margin-bottom: 0.75rem;
}

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

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

.footer-links a {
    color: var(--slate-500);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--slate-600);
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: var(--slate-600);
    max-width: 600px;
    line-height: 1.5;
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 50;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .header-stats {
        width: 100%;
        justify-content: space-between;
    }

    .search-header h2 {
        font-size: 1.5rem;
    }

    .fund-name {
        font-size: 1.25rem;
    }

    .nav-stats {
        grid-template-columns: 1fr;
    }

    .chart-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .time-range-buttons {
        width: 100%;
        overflow-x: auto;
    }

    .chart-container {
        height: 300px;
    }

    .schemes-list {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .footer-content {
        flex-direction: column;
    }

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

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Modal Responsive Overrides */
@media (max-width: 1024px) {
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

@media (max-width: 768px) {
    #tab-overview-content>div {
        grid-template-columns: 1fr !important;
    }

    .modal-body {
        padding: 16px !important;
    }

    #tab-overview-content>div>div:first-child>div:first-child {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .fund-tabs-container {
        font-size: 0.8rem;
        gap: 4px;
    }

    .fund-tab {
        padding: 8px 12px;
    }

    #simulated-return-box>div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    #simulated-return-box>div>div:last-child {
        text-align: left !important;
    }
}

@media (max-width: 480px) {
    #tab-overview-content>div>div:first-child>div:first-child {
        grid-template-columns: 1fr !important;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-header p {
        font-size: 0.8rem;
    }
}

/* ===== Watchlist Section ===== */
.watchlist-section {
    margin-bottom: var(--spacing-xl);
    animation: slideUp 0.5s ease-out;
}

.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.watchlist-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.watchlist-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-500);
}

.watchlist-card-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: white;
    padding: 3px;
    border: 1px solid var(--slate-200);
    flex-shrink: 0;
}

.watchlist-card-info {
    flex: 1;
    min-width: 0;
}

.watchlist-card-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watchlist-card-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.watchlist-card-nav {
    text-align: right;
    flex-shrink: 0;
}

.watchlist-card-nav-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
}

.watchlist-card-return {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 2px;
}

.watchlist-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-400);
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.watchlist-card:hover .watchlist-remove-btn {
    opacity: 1;
}

.watchlist-remove-btn:hover {
    background: var(--danger-50);
    color: var(--danger-600);
}

.watchlist-empty {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    color: var(--gray-400);
}

.watchlist-empty p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-top: var(--spacing-md);
}

.watchlist-empty span {
    font-size: 0.85rem;
    color: var(--gray-400);
}

/* ===== Modal Heart Button ===== */
.watchlist-heart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: white;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.watchlist-heart-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.watchlist-heart-btn.active {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.watchlist-heart-btn.active svg path {
    fill: #ef4444;
}

/* ===== Dark Mode Theme ===== */
body.dark {
    --bg-surface: #0f172a;
    --card-bg: #1e293b;
    --card-surface: #1e293b;
    --card-border: #334155;
    --border-subtle: #334155;

    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-900: #f1f5f9;
    --gray-800: #e2e8f0;
    --gray-700: #cbd5e1;
    --gray-600: #94a3b8;
    --gray-500: #64748b;
    --gray-400: #475569;
    --gray-300: #334155;

    --slate-50: #1e293b;
    --slate-100: #334155;
    --slate-200: #475569;
    --slate-900: #f1f5f9;

    color: #e2e8f0;
}

body.dark .header {
    background: #020617;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.dark .search-card,
body.dark .insights-card,
body.dark .scheme-card,
body.dark .trending-card,
body.dark .watchlist-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark .search-input {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark .search-input:focus {
    border-color: var(--primary-500);
    background: #1e293b;
}

body.dark .result-item {
    background: #1e293b;
    border-color: #334155;
}

body.dark .result-item:hover {
    border-color: var(--primary-500);
}

body.dark .search-header h2 {
    color: #818cf8;
}

body.dark .partners-section {
    background: #1e293b;
}

body.dark .partner-item {
    background: #334155;
}

body.dark .performance-table-container {
    background: #1e293b;
    border-color: #334155;
}

body.dark .performance-table th {
    background: #0f172a;
    color: #94a3b8;
}

body.dark .performance-table td {
    border-bottom-color: #334155;
}

body.dark .performance-table tr:hover {
    background: #334155;
}

body.dark .sticky-col {
    background: #1e293b;
    border-right-color: #475569;
}

body.dark .performance-table th.sticky-col {
    background: #0f172a;
}

body.dark .performance-table tr:hover .sticky-col {
    background: #334155;
}

body.dark .site-footer {
    background: #020617;
}

body.dark .trending-stats {
    background: #0f172a;
}

body.dark .summary-stat {
    background: #0f172a;
    border-color: #334155;
}

body.dark .watchlist-heart-btn {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

body.dark .watchlist-remove-btn {
    background: #334155;
    color: #94a3b8;
}

body.dark .fund-chip {
    background: #4338ca;
}

body.dark .clear-btn {
    background: #475569;
    color: #94a3b8;
}

/* Smooth transition when toggling dark mode */
body,
.header,
.search-card,
.insights-card,
.scheme-card,
.trending-card,
.watchlist-card,
.search-input,
.result-item,
.partners-section,
.partner-item,
.performance-table-container,
.site-footer,
.trending-stats,
.summary-stat {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ===== Responsive for new header ===== */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: var(--s-2);
    }

    .header-buttons {
        margin-left: 0;
    }

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