/**
 * Fund Finder Styles
 * 
 * All classes prefixed with ff- to avoid conflicts with Salient theme
 */

/* ========================================
   CSS VARIABLES
======================================== */
:root {
  --ff-obsidian: #0a0a0b;
  --ff-charcoal: #141416;
  --ff-graphite: #1c1c1f;
  --ff-slate: #2a2a2f;
  --ff-pewter: #4a4a52;
  --ff-silver: #8a8a94;
  --ff-platinum: #c4c4cc;
  --ff-ivory: #f4f4f6;
  --ff-white: #ffffff;
  --ff-gold: #c9a962;
  --ff-gold-light: #e4d4a4;
  --ff-gold-dark: #a68b3d;
  --ff-success: #4ade80;
  --ff-error: #f87171;
  --ff-blue: #60a5fa;
  --ff-purple: #a78bfa;
  --ff-pink: #f472b6;
  --ff-orange: #fb923c;
  --ff-cyan: #22d3ee;
  
  --ff-font-display: 'Cormorant Garamond', Georgia, serif;
  --ff-font-body: 'DM Sans', -apple-system, sans-serif;
  
  --ff-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   FUND FINDER PAGE CONTAINER
======================================== */
.fund-finder-page {
  background: var(--ff-obsidian) !important;
  min-height: 100vh;
  padding-top: 40px;
  padding-bottom: 100px;
}

.fund-finder-page .row {
  max-width: 1400px;
  margin: 0 auto;
}

#fund-finder-app {
  font-family: var(--ff-font-body);
  color: var(--ff-platinum);
  line-height: 1.6;
}

/* ========================================
   PAGE HEADER
======================================== */
.ff-page-header {
  padding: 40px 0;
  position: relative;
}

.ff-page-title {
  font-family: var(--ff-font-display) !important;
  font-size: clamp(36px, 6vw, 56px) !important;
  font-weight: 400 !important;
  color: var(--ff-white) !important;
  margin-bottom: 12px !important;
  letter-spacing: -0.02em;
  line-height: 1.2 !important;
}

.ff-highlight {
  color: var(--ff-gold);
}

.ff-page-subtitle {
  font-size: 18px;
  color: var(--ff-silver);
  max-width: 600px;
  margin: 0;
}

/* ========================================
   SEARCH SECTION
======================================== */
.ff-search-section {
  padding: 0 0 40px;
}

.ff-search-container {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.ff-search-box {
  flex: 1;
  min-width: 300px;
  position: relative;
}

.ff-search-input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 14px;
  font-family: var(--ff-font-body);
  font-size: 16px;
  color: var(--ff-white);
  outline: none;
  transition: all 0.3s ease;
}

.ff-search-input::placeholder {
  color: var(--ff-pewter);
}

.ff-search-input:focus {
  border-color: var(--ff-gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.1);
}

.ff-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  stroke: var(--ff-pewter);
  stroke-width: 2;
  fill: none;
  pointer-events: none;
  transition: stroke 0.3s ease;
}

.ff-search-input:focus + .ff-search-icon {
  stroke: var(--ff-gold);
}

.ff-filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ff-platinum);
  cursor: pointer;
  transition: all 0.3s ease;
}

.ff-filter-toggle:hover {
  background: var(--ff-slate);
}

.ff-filter-toggle.active {
  background: rgba(201, 169, 98, 0.1);
  border-color: var(--ff-gold);
  color: var(--ff-gold);
}

.ff-filter-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.ff-filter-count {
  display: none;
  width: 20px;
  height: 20px;
  background: var(--ff-gold);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: var(--ff-obsidian);
  line-height: 20px;
  text-align: center;
}

.ff-filter-toggle.has-filters .ff-filter-count {
  display: block;
}

/* ========================================
   DISCOVER SECTION
======================================== */
.ff-discover-section {
  padding: 0 0 40px;
}

.ff-discover-header {
  margin-bottom: 20px;
}

.ff-discover-title {
  font-family: var(--ff-font-display) !important;
  font-size: 28px !important;
  font-weight: 500 !important;
  color: var(--ff-white) !important;
  margin-bottom: 4px !important;
}

.ff-discover-subtitle {
  font-size: 14px;
  color: var(--ff-silver);
  margin: 0;
}

.ff-discover-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.ff-discover-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(145deg, var(--ff-graphite) 0%, var(--ff-charcoal) 100%);
  border: 1px solid var(--ff-slate);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.4s var(--ff-ease-out-expo);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.ff-discover-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ff-gold), var(--ff-gold-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ff-ease-out-expo);
}

.ff-discover-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 169, 98, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.ff-discover-card:hover::before {
  transform: scaleX(1);
}

.ff-discover-card.active {
  border-color: var(--ff-gold);
  background: linear-gradient(145deg, rgba(201, 169, 98, 0.1) 0%, var(--ff-charcoal) 100%);
}

.ff-discover-card.active::before {
  transform: scaleX(1);
}

.ff-discover-card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(201, 169, 98, 0.15) 0%, rgba(201, 169, 98, 0.05) 100%);
  border: 1px solid rgba(201, 169, 98, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ff-discover-card-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--ff-gold);
  stroke-width: 1.5;
  fill: none;
}

.ff-discover-card-icon.ff-icon-consistent {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.15) 0%, rgba(74, 222, 128, 0.05) 100%);
  border-color: rgba(74, 222, 128, 0.2);
}

.ff-discover-card-icon.ff-icon-consistent svg {
  stroke: var(--ff-success);
}

.ff-discover-card-icon.ff-icon-veteran {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.15) 0%, rgba(96, 165, 250, 0.05) 100%);
  border-color: rgba(96, 165, 250, 0.2);
}

.ff-discover-card-icon.ff-icon-veteran svg {
  stroke: var(--ff-blue);
}

.ff-discover-card-icon.ff-icon-outperform {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.15) 0%, rgba(167, 139, 250, 0.05) 100%);
  border-color: rgba(167, 139, 250, 0.2);
}

.ff-discover-card-icon.ff-icon-outperform svg {
  stroke: var(--ff-purple);
}

.ff-discover-card-content {
  flex: 1;
  min-width: 0;
}

.ff-discover-card-title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--ff-white) !important;
  margin: 0 0 2px 0 !important;
}

.ff-discover-card-desc {
  font-size: 13px;
  color: var(--ff-silver);
  line-height: 1.4;
  margin: 0;
}

.ff-discover-card-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  background: var(--ff-slate);
  border-radius: 10px;
  flex-shrink: 0;
}

.ff-discover-card-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ff-gold);
  line-height: 1;
}

.ff-discover-card-stat-label {
  font-size: 10px;
  color: var(--ff-silver);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ff-discover-card-arrow {
  width: 20px;
  height: 20px;
  stroke: var(--ff-pewter);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.ff-discover-card:hover .ff-discover-card-arrow {
  stroke: var(--ff-gold);
  transform: translateX(4px);
}

/* Active Screen Indicator */
.ff-active-screen {
  margin-top: 20px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(201, 169, 98, 0.1) 0%, rgba(201, 169, 98, 0.05) 100%);
  border: 1px solid rgba(201, 169, 98, 0.2);
  border-radius: 12px;
}

.ff-active-screen-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ff-active-screen-label {
  font-size: 13px;
  color: var(--ff-silver);
}

.ff-active-screen-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ff-gold);
  flex: 1;
}

.ff-active-screen-clear {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--ff-slate);
  border: 1px solid var(--ff-pewter);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ff-platinum);
  cursor: pointer;
  transition: all 0.3s ease;
}

.ff-active-screen-clear:hover {
  background: var(--ff-pewter);
  border-color: var(--ff-silver);
}

.ff-active-screen-clear svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ========================================
   MAIN LAYOUT
======================================== */
.ff-main-content {
  display: flex;
  gap: 32px;
}

@media (max-width: 1024px) {
  .ff-main-content {
    flex-direction: column;
  }
}

/* ========================================
   FILTERS SIDEBAR
======================================== */
.ff-filters-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: none;
}

.ff-filters-sidebar.visible {
  display: block;
}

@media (max-width: 1024px) {
  .ff-filters-sidebar {
    width: 100%;
  }
}

.ff-filters-card {
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 16px;
  overflow: hidden;
  position: sticky;
  top: 120px;
}

.ff-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--ff-slate);
}

.ff-filters-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ff-white);
}

.ff-filters-clear {
  font-size: 13px;
  color: var(--ff-gold);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.ff-filters-clear:hover {
  opacity: 1;
}

.ff-filter-group {
  padding: 20px;
  border-bottom: 1px solid var(--ff-slate);
}

.ff-filter-group:last-child {
  border-bottom: none;
}

.ff-filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 16px;
}

.ff-filter-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ff-silver);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ff-filter-group-chevron {
  width: 16px;
  height: 16px;
  stroke: var(--ff-pewter);
  stroke-width: 2;
  fill: none;
  transition: transform 0.3s ease;
}

.ff-filter-group.collapsed .ff-filter-group-chevron {
  transform: rotate(-90deg);
}

.ff-filter-group.collapsed .ff-filter-options {
  display: none;
}

.ff-filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ff-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 0;
}

.ff-filter-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ff-pewter);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.ff-filter-option.selected .ff-filter-checkbox {
  background: var(--ff-gold);
  border-color: var(--ff-gold);
}

.ff-filter-checkbox svg {
  width: 12px;
  height: 12px;
  stroke: var(--ff-obsidian);
  stroke-width: 3;
  fill: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ff-filter-option.selected .ff-filter-checkbox svg {
  opacity: 1;
}

.ff-filter-label {
  font-size: 14px;
  color: var(--ff-platinum);
  flex: 1;
}

/* ========================================
   RESULTS SECTION
======================================== */
.ff-results-section {
  flex: 1;
  min-width: 0;
}

.ff-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.ff-results-count {
  font-size: 15px;
  color: var(--ff-silver);
}

.ff-results-count strong {
  color: var(--ff-white);
  font-weight: 600;
}

.ff-results-sort {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ff-sort-label {
  font-size: 14px;
  color: var(--ff-silver);
}

.ff-sort-select {
  padding: 10px 36px 10px 14px;
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 10px;
  font-family: var(--ff-font-body);
  font-size: 14px;
  color: var(--ff-white);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a94' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  outline: none;
  transition: border-color 0.3s ease;
}

.ff-sort-select:focus {
  border-color: var(--ff-gold);
}

.ff-view-toggle {
  display: flex;
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 10px;
  overflow: hidden;
}

.ff-view-btn {
  padding: 10px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ff-view-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--ff-pewter);
  stroke-width: 2;
  fill: none;
  display: block;
}

.ff-view-btn:hover svg {
  stroke: var(--ff-platinum);
}

.ff-view-btn.active {
  background: var(--ff-slate);
}

.ff-view-btn.active svg {
  stroke: var(--ff-gold);
}

/* ========================================
   FUNDS GRID
======================================== */
.ff-funds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

.ff-funds-grid.list-view {
  grid-template-columns: 1fr;
}

@media (max-width: 480px) {
  .ff-funds-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   FUND CARD
======================================== */
.ff-fund-card {
  background: linear-gradient(145deg, var(--ff-graphite) 0%, var(--ff-charcoal) 100%);
  border: 1px solid var(--ff-slate);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s var(--ff-ease-out-expo);
  position: relative;
  cursor: pointer;
}

.ff-fund-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 98, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.ff-fund-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 169, 98, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.ff-fund-card:hover::before {
  opacity: 1;
}

.ff-fund-card-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--ff-slate);
}

.ff-fund-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ff-fund-manager {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ff-fund-manager-logo {
  width: 36px;
  height: 36px;
  background: var(--ff-slate);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ff-gold);
}

.ff-fund-manager-info {
  display: flex;
  flex-direction: column;
}

.ff-fund-manager-name {
  font-size: 12px;
  color: var(--ff-silver);
}

.ff-fund-manager-people {
  font-size: 11px;
  color: var(--ff-pewter);
}

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

.ff-fund-badge {
  padding: 4px 10px;
  background: rgba(201, 169, 98, 0.1);
  border: 1px solid rgba(201, 169, 98, 0.2);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ff-gold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ff-fund-badge.ff-share-type {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.2);
  color: var(--ff-blue);
}

.ff-fund-name {
  font-family: var(--ff-font-display) !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  color: var(--ff-white) !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.3 !important;
}

.ff-fund-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ff-silver);
}

.ff-fund-meta-dot {
  width: 3px;
  height: 3px;
  background: var(--ff-pewter);
  border-radius: 50%;
}

.ff-fund-isin {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 11px;
  color: var(--ff-pewter);
  background: var(--ff-slate);
  padding: 2px 6px;
  border-radius: 4px;
}

.ff-fund-benchmark {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--ff-slate);
  border-radius: 8px;
  font-size: 11px;
  color: var(--ff-silver);
}

.ff-fund-benchmark-label {
  color: var(--ff-pewter);
  margin-right: 4px;
}

.ff-fund-card-body {
  padding: 16px 20px;
}

.ff-fund-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.ff-fund-stat {
  text-align: center;
  padding: 8px 4px;
  background: var(--ff-slate);
  border-radius: 8px;
}

.ff-fund-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--ff-white);
  margin-bottom: 2px;
}

.ff-fund-stat-value.positive {
  color: var(--ff-success);
}

.ff-fund-stat-value.negative {
  color: var(--ff-error);
}

.ff-fund-stat-value.gold {
  color: var(--ff-gold);
}

.ff-fund-stat-label {
  font-size: 10px;
  color: var(--ff-silver);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Sector bars */
.ff-fund-sectors {
  margin-bottom: 16px;
}

.ff-fund-sectors-title {
  font-size: 11px;
  color: var(--ff-pewter);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.ff-fund-sectors-bars {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--ff-slate);
}

.ff-sector-bar {
  height: 100%;
  transition: width 0.6s var(--ff-ease-out-expo);
}

.ff-fund-sectors-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ff-sector-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ff-silver);
}

.ff-sector-legend-color {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* Sector colors */
.ff-sector-financials { background: #f59e0b; }
.ff-sector-tech { background: #3b82f6; }
.ff-sector-consumer-disc { background: #ec4899; }
.ff-sector-consumer-staples { background: #8b5cf6; }
.ff-sector-industrials { background: #10b981; }
.ff-sector-healthcare { background: #ef4444; }
.ff-sector-comm { background: #06b6d4; }
.ff-sector-real-estate { background: #f97316; }
.ff-sector-other { background: #6b7280; }
.ff-sector-cash { background: #94a3b8; }

/* Card actions */
.ff-fund-card-actions {
  display: flex;
  gap: 10px;
}

.ff-fund-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ff-fund-action-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  fill: none;
}

.ff-fund-action-btn.ff-primary {
  background: linear-gradient(135deg, var(--ff-gold) 0%, var(--ff-gold-dark) 100%);
  border: none;
  color: var(--ff-obsidian);
}

.ff-fund-action-btn.ff-primary svg {
  stroke: var(--ff-obsidian);
}

.ff-fund-action-btn.ff-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(201, 169, 98, 0.3);
}

.ff-fund-action-btn.ff-secondary {
  background: var(--ff-slate);
  border: 1px solid var(--ff-pewter);
  color: var(--ff-platinum);
}

.ff-fund-action-btn.ff-secondary svg {
  stroke: var(--ff-platinum);
}

.ff-fund-action-btn.ff-secondary:hover {
  background: var(--ff-pewter);
  border-color: var(--ff-silver);
}

.ff-fund-action-btn.added {
  background: rgba(74, 222, 128, 0.1);
  border-color: var(--ff-success);
  color: var(--ff-success);
}

.ff-fund-action-btn.added svg {
  stroke: var(--ff-success);
}

/* ========================================
   DETAIL PANEL
======================================== */
.ff-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

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

.ff-detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 600px;
  height: 100%;
  background: var(--ff-charcoal);
  border-left: 1px solid var(--ff-slate);
  z-index: 10001;
  transform: translateX(100%);
  transition: transform 0.5s var(--ff-ease-out-expo);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ff-detail-panel.active {
  transform: translateX(0);
}

.ff-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--ff-slate);
  background: var(--ff-charcoal);
  position: sticky;
  top: 0;
  z-index: 10;
}

.ff-detail-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.ff-detail-close:hover {
  background: var(--ff-slate);
  border-color: var(--ff-pewter);
}

.ff-detail-close svg {
  width: 20px;
  height: 20px;
  stroke: var(--ff-platinum);
  fill: none;
}

.ff-detail-title-area {
  flex: 1;
}

.ff-detail-brand {
  font-size: 12px;
  color: var(--ff-gold);
  margin-bottom: 4px;
}

.ff-detail-title {
  font-family: var(--ff-font-display) !important;
  font-size: 24px !important;
  font-weight: 500 !important;
  color: var(--ff-white) !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.2 !important;
}

.ff-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ff-detail-meta-item {
  font-size: 12px;
  color: var(--ff-silver);
  background: var(--ff-slate);
  padding: 4px 10px;
  border-radius: 6px;
}

.ff-detail-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.ff-detail-section {
  margin-bottom: 32px;
}

.ff-detail-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ff-silver);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ff-detail-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ff-slate);
}

.ff-detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ff-detail-stat {
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.ff-detail-stat-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--ff-gold);
  margin-bottom: 4px;
}

.ff-detail-stat-label {
  font-size: 11px;
  color: var(--ff-silver);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ff-detail-objective {
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  color: var(--ff-platinum);
  line-height: 1.7;
}

.ff-detail-benchmark {
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 12px;
  padding: 16px;
}

.ff-detail-benchmark-name {
  font-size: 14px;
  color: var(--ff-white);
  margin-bottom: 4px;
}

.ff-detail-benchmark-label {
  font-size: 11px;
  color: var(--ff-pewter);
  text-transform: uppercase;
}

/* Performance table */
.ff-detail-perf-table {
  width: 100%;
  border-collapse: collapse;
}

.ff-detail-perf-table th,
.ff-detail-perf-table td {
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
}

.ff-detail-perf-table th {
  color: var(--ff-silver);
  font-weight: 500;
  border-bottom: 1px solid var(--ff-slate);
}

.ff-detail-perf-table td {
  color: var(--ff-white);
}

.ff-detail-perf-table td.positive {
  color: var(--ff-success);
}

.ff-detail-perf-table td.negative {
  color: var(--ff-error);
}

.ff-detail-perf-table tr.benchmark td {
  color: var(--ff-silver);
  font-size: 12px;
}

/* Allocation rows */
.ff-detail-allocation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ff-slate);
}

.ff-detail-allocation-row:last-child {
  border-bottom: none;
}

.ff-detail-allocation-info {
  flex: 1;
}

.ff-detail-allocation-label {
  font-size: 14px;
  color: var(--ff-white);
  margin-bottom: 6px;
}

.ff-detail-allocation-bar {
  height: 6px;
  background: var(--ff-slate);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.ff-detail-allocation-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ff-gold), var(--ff-gold-light));
  border-radius: 3px;
}

.ff-detail-allocation-index {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  background: var(--ff-white);
  border-radius: 1px;
}

.ff-detail-allocation-values {
  text-align: right;
  min-width: 80px;
}

.ff-detail-allocation-fund {
  font-size: 14px;
  font-weight: 600;
  color: var(--ff-gold);
}

.ff-detail-allocation-idx {
  font-size: 11px;
  color: var(--ff-silver);
}

/* Holdings */
.ff-detail-holding {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 10px;
  margin-bottom: 8px;
}

.ff-detail-holding:last-child {
  margin-bottom: 0;
}

.ff-detail-holding-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ff-slate);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ff-silver);
}

.ff-detail-holding-name {
  flex: 1;
  font-size: 14px;
  color: var(--ff-white);
}

.ff-detail-holding-pct {
  font-size: 14px;
  font-weight: 600;
  color: var(--ff-gold);
}

/* Detail actions */
.ff-detail-actions {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--ff-slate);
  background: var(--ff-charcoal);
}

.ff-detail-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ff-detail-action-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.ff-detail-action-btn.ff-primary {
  background: linear-gradient(135deg, var(--ff-gold) 0%, var(--ff-gold-dark) 100%);
  border: none;
  color: var(--ff-obsidian);
}

.ff-detail-action-btn.ff-primary svg {
  stroke: var(--ff-obsidian);
  fill: none;
}

.ff-detail-action-btn.ff-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201, 169, 98, 0.3);
}

.ff-detail-action-btn.ff-secondary {
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  color: var(--ff-platinum);
}

.ff-detail-action-btn.ff-secondary svg {
  stroke: var(--ff-platinum);
  fill: none;
}

.ff-detail-action-btn.ff-secondary:hover {
  background: var(--ff-slate);
}

/* ========================================
   COMPARISON BAR
======================================== */
.ff-comparison-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ff-charcoal);
  border-top: 1px solid var(--ff-slate);
  padding: 16px 24px;
  transform: translateY(100%);
  transition: transform 0.4s var(--ff-ease-out-expo);
  z-index: 9999;
}

.ff-comparison-bar.visible {
  transform: translateY(0);
}

.ff-comparison-bar-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.ff-comparison-funds {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  overflow-x: auto;
  padding: 4px 0;
}

.ff-comparison-fund {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--ff-graphite);
  border: 1px solid var(--ff-slate);
  border-radius: 10px;
  flex-shrink: 0;
}

.ff-comparison-fund-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ff-comparison-fund-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ff-platinum);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ff-comparison-fund-remove {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.ff-comparison-fund-remove:hover {
  opacity: 1;
}

.ff-comparison-fund-remove svg {
  width: 14px;
  height: 14px;
  stroke: var(--ff-silver);
  stroke-width: 2;
  fill: none;
}

.ff-comparison-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ff-comparison-count {
  font-size: 14px;
  color: var(--ff-silver);
}

.ff-comparison-count strong {
  color: var(--ff-gold);
}

.ff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: var(--ff-font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ff-ease-out-expo);
}

.ff-btn-primary {
  background: linear-gradient(135deg, var(--ff-gold) 0%, var(--ff-gold-dark) 100%);
  color: var(--ff-obsidian);
}

.ff-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201, 169, 98, 0.3);
}

.ff-btn-primary svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.ff-btn-ghost {
  background: transparent;
  color: var(--ff-silver);
  padding: 12px 16px;
}

.ff-btn-ghost:hover {
  color: var(--ff-white);
}

/* ========================================
   LOADING & EMPTY STATES
======================================== */
.ff-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  grid-column: 1 / -1;
}

.ff-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--ff-slate);
  border-top-color: var(--ff-gold);
  border-radius: 50%;
  animation: ff-spin 1s linear infinite;
}

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

.ff-loading-text {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ff-silver);
}

.ff-empty-state {
  text-align: center;
  padding: 80px 24px;
  grid-column: 1 / -1;
}

.ff-empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--ff-graphite);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ff-empty-state-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--ff-pewter);
  stroke-width: 1.5;
  fill: none;
}

.ff-empty-state-title {
  font-family: var(--ff-font-display) !important;
  font-size: 24px !important;
  color: var(--ff-white) !important;
  margin-bottom: 8px !important;
}

.ff-empty-state-desc {
  font-size: 15px;
  color: var(--ff-silver);
  margin-bottom: 24px;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes ff-fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.ff-fund-card {
  animation: ff-fadeInUp 0.5s var(--ff-ease-out-expo) forwards;
  opacity: 0;
}

.ff-fund-card:nth-child(1) { animation-delay: 0.05s; }
.ff-fund-card:nth-child(2) { animation-delay: 0.1s; }
.ff-fund-card:nth-child(3) { animation-delay: 0.15s; }
.ff-fund-card:nth-child(4) { animation-delay: 0.2s; }
.ff-fund-card:nth-child(5) { animation-delay: 0.25s; }
.ff-fund-card:nth-child(6) { animation-delay: 0.3s; }

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
  .ff-discover-cards {
    grid-template-columns: 1fr;
  }
  
  .ff-discover-card-stat {
    display: none;
  }
  
  .ff-fund-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .ff-detail-panel {
    max-width: 100%;
  }
}
