/* VARIABLES (Matched to Rankings) */
:root {
    --color-primary: #1e3a5f;
    --color-accent: #d4af37;
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --bg-dark: #0f1419;
    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
    --text-light: #ffffff;
    --border-color: #e2e8f0;
    --radius-lg: 12px;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --navbar-height: 76px;
    accent-color: var(--color-accent);
}

/* COMPACT FILTER BAR (PORTED FROM RANKINGS) */
.filter-bar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.25rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    white-space: nowrap;
}

.form-select-custom,
.form-control-custom {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #f1f5f9;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    color: var(--text-primary);
}

.form-select-custom:hover,
.form-control-custom:hover {
    background-color: #e2e8f0;
}

.form-select-custom:focus,
.form-control-custom:focus {
    outline: 2px solid var(--color-primary);
    border-color: transparent;
    background-color: #fff;
}

/* SELECTION CHIPS BAR */
.selection-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    min-height: 45px;
    padding: 0.5rem;
    background: rgba(30, 58, 95, 0.03);
    border-radius: 12px;
    align-items: center;
}

.fund-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
    max-width: 250px;
}

.fund-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-color: var(--color-accent);
}

.remove-btn {
    color: var(--color-danger);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.6;
}

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

/* SEARCH DROPDOWN */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 320px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    z-index: 1100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
    display: none;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f8fafc;
}

/* METRICS */
.metric-card-modern {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s;
    text-align: center;
}

.metric-card-modern:hover {
    transform: translateY(-2px);
}

.metric-val-modern {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
    display: inline-block;
    transition: font-size 0.1s ease;
}

/* Heatmap Icon Grid */
.heatmap-icon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    width: 18px;
    height: 18px;
}

.heatmap-icon-grid .square {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.bench-chip {
    padding: 4px 10px;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 6px;
}

.metric-label-modern {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

/* CARD CUSTOM */
.card-custom {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header-custom {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.9rem;
}

/* UTILS */
.stale-badge {
    font-size: 0.6rem;
    background: var(--color-danger);
    color: white;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: bold;
}

.fund-chip.stale-fund {
    background: #fffafa;
    border-color: #fecaca;
}

body {
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    background-color: #f8fafc;
}

.btn-build {
    background: var(--color-accent);
    border: none;
    color: white;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.6rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    transition: all 0.3s;
}

.btn-build:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
    background: #c5a02d;
    color: white;
}

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

.btn-build:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
}
