/* ==========================================================================
   ELITE CHALLENGE TRACKER CSS
   Glassmorphism, SVG Rings, Timeline Progress
   ========================================================================== */

/* Layout & Globals */
.chl-container { margin-left: 20px; padding: 32px; min-height: 100vh; color: #ffffff; font-family: 'Inter', sans-serif; display: flex; flex-direction: column; gap: 24px; position: relative; }
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.m-0 { margin: 0; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; } .pt-16 { padding-top: 16px; } .pb-16 { padding-bottom: 16px; } .border-top { border-top: 1px solid rgba(255,255,255,0.1); } .border-bottom { border-bottom: 1px solid rgba(255,255,255,0.1); }
.text-xs { font-size: 0.75rem; } .text-sm { font-size: 0.85rem; } .text-muted { color: rgba(255,255,255,0.6); } .w-full { width: 100%; } .text-center { text-align: center; }
.uppercase { text-transform: uppercase; } .letter-spacing { letter-spacing: 1px; } .font-bold { font-weight: 700; }
.flex-between { display: flex; justify-content: space-between; align-items: center; } .flex-align-center { display: flex; align-items: center; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; }

/* Palette */
.text-purple { color: #c084fc; } .text-cyan { color: #06b6d4; } .text-gold { color: #fbbf24; } .text-red { color: #ef5350; } .text-green { color: #22c55e; } .text-white { color: #ffffff; } .text-orange { color: #f97316; }
.bg-red { background: #ef5350; } .bg-green { background: #22c55e; } .bg-orange { background: #f97316; } .bg-purple { background: #c084fc; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(168,85,247,0.4); } 70% { box-shadow: 0 0 0 15px rgba(168,85,247,0); } 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0); } }
@keyframes drawRing { to { stroke-dashoffset: var(--target-offset, 0); } }
.fade-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse-btn { animation: pulseGlow 2s infinite; }

/* Cards & Buttons */
.chl-card { background: rgba(255,255,255,0.03); backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(255,255,255,0.08); border-radius: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05); transition: all 0.4s; }
.chl-btn { padding: 10px 20px; border-radius: 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.3s; border: none; text-transform: uppercase; font-family: inherit; }
.chl-btn--primary { background: linear-gradient(135deg, #a855f7, #7e22ce); color: white; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
.chl-btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5); }
.chl-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }
.chl-btn--secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.chl-btn--secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: #c084fc; color: #c084fc; }
.chl-btn--secondary:disabled { opacity: 0.3; cursor: not-allowed; }
.chl-btn-icon-small { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.chl-btn-icon-small:hover { background: rgba(192,132,252,0.2); color: #c084fc; border-color: #c084fc; }

/* Inputs */
.chl-input, .chl-select { width: 100%; padding: 10px 14px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px; transition: 0.3s; font-family: inherit; font-size: 0.85rem; outline: none; }
.chl-input:focus, .chl-select:focus { border-color: #c084fc; box-shadow: 0 0 0 2px rgba(192,132,252,0.2); }
.chl-form-group { margin-bottom: 16px; }
.chl-form-group label { display: block; margin-bottom: 8px; font-size: 0.85rem; color: rgba(255,255,255,0.8); font-weight: 600; }
.chl-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Header Elements */
.chl-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 24px; }
.chl-header__title { font-size: 2.2rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: 1px; }
.chl-header__subtitle { color: #c084fc; margin: 0; font-size: 1rem; }
.chl-header__stats { display: flex; gap: 24px; }
.chl-stat-card { text-align: center; }
.chl-stat-val { display: block; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.chl-stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-transform: uppercase; }

/* Filters */
.chl-filters { display: flex; gap: 12px; }
.chl-pill { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.6); padding: 6px 16px; border-radius: 20px; font-weight: 600; cursor: pointer; transition: 0.3s; font-size: 0.85rem; }
.chl-pill:hover { color: white; background: rgba(255,255,255,0.05); }
.chl-pill.active { background: rgba(192,132,252,0.2); color: #c084fc; border-color: rgba(192,132,252,0.4); }

/* Main Grid & Cards */
.chl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 24px; }
.chl-c-card { display: flex; flex-direction: column; padding: 24px; cursor: pointer; position: relative; overflow: hidden; }
.chl-c-card:hover { transform: translateY(-4px); border-color: rgba(192,132,252,0.4); box-shadow: 0 12px 40px rgba(0,0,0,0.4); background: rgba(255,255,255,0.05); }
.c-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.c-firm { display: flex; align-items: center; gap: 12px; }
.c-logo { width: 40px; height: 40px; background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02)); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; border: 1px solid rgba(255,255,255,0.1); }
.c-title { font-size: 1.1rem; font-weight: 800; margin: 0; }
.c-size { font-size: 0.85rem; color: rgba(255,255,255,0.6); }

/* Status Badges */
.chl-status-badge { padding: 4px 10px; border-radius: 8px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.badge-active { background: rgba(6,182,212,0.2); color: #06b6d4; border: 1px solid rgba(6,182,212,0.3); }
.badge-funded { background: rgba(251,191,36,0.2); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.badge-passed { background: rgba(34,197,94,0.2); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.badge-failed { background: rgba(239,83,80,0.2); color: #ef5350; border: 1px solid rgba(239,83,80,0.3); }

/* Progress Ring */
.c-ring-wrapper { position: relative; width: 140px; height: 140px; margin: 0 auto 24px auto; }
.c-ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.c-ring-bg { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 8; }
.c-ring-fill { fill: none; stroke: url(#grad-ring); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 251.2; stroke-dashoffset: 251.2; transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1); }
.c-ring-inner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.c-ring-pct { font-size: 1.8rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.1; }
.c-ring-tgt { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

/* Mini Progress Bars */
.c-metrics { display: flex; flex-direction: column; gap: 12px; }
.c-metric-row { display: flex; flex-direction: column; gap: 4px; }
.c-m-labels { display: flex; justify-content: space-between; font-size: 0.75rem; }
.c-m-lbl { color: rgba(255,255,255,0.6); text-transform: uppercase; }
.c-m-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.chl-progress-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.chl-progress-fill { height: 100%; border-radius: 3px; transition: width 1s cubic-bezier(0.16,1,0.3,1); }

/* Modals */
.chl-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.chl-modal__overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.chl-modal__content { position: relative; background: #0d0b12; border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: fadeInUp 0.3s ease-out; }
.chl-modal__close { position: absolute; top: 24px; right: 24px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.5rem; cursor: pointer; transition: 0.3s; z-index: 10; }
.chl-modal__close:hover { color: white; }

/* Detail Modal Overrides */
.chl-detail-content { width: 95%; max-width: 1200px; height: 90vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chl-detail-hero { padding: 32px; background: radial-gradient(circle at top right, rgba(168,85,247,0.15), transparent 40%); border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0; }
.chl-hero-icon { font-size: 2rem; width: 64px; height: 64px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.chl-hero-stats { display: flex; gap: 40px; }
.hero-stat-box { display: flex; flex-direction: column; }
.hero-stat-box .lbl { font-size: 0.85rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.hero-stat-box .val { font-size: 2.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }

.chl-detail-split { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; padding: 0 32px 32px 32px; overflow-y: auto; flex-grow: 1; }
.chl-chart-container { width: 100%; height: 250px; position: relative; background: rgba(255,255,255,0.02); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
.chart-svg { width: 100%; height: 100%; overflow: visible; padding: 10px; }
.chart-axis { stroke: rgba(255,255,255,0.1); stroke-width: 1; }
.chart-line-eq { fill: none; stroke: #c084fc; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 10px rgba(192,132,252,0.3)); }
.chart-line-tgt { stroke: #22c55e; stroke-width: 1.5; stroke-dasharray: 4; }
.chart-line-dd { stroke: #ef5350; stroke-width: 1.5; stroke-dasharray: 4; }

.chl-table-wrap { overflow-x: auto; }
.chl-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.chl-table th { text-align: left; padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); text-transform: uppercase; font-size: 0.75rem; }
.chl-table td { padding: 12px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); font-variant-numeric: tabular-nums; }
.risk-card { border-left: 4px solid; }
.risk-card:nth-child(1) { border-left-color: #ef5350; }
.risk-card:nth-child(2) { border-left-color: #f97316; }

/* Timeline Stepper */
.chl-timeline { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 32px; }
.tl-step { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.4); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.tl-step.passed { color: #22c55e; }
.tl-step.active { color: #c084fc; text-shadow: 0 0 10px rgba(192,132,252,0.5); }
.tl-line { flex-grow: 1; max-width: 100px; height: 2px; background: rgba(255,255,255,0.1); }
.tl-line.passed { background: #22c55e; }

.chl-pace-card { margin: 0 32px; background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.3); padding: 16px; border-radius: 12px; }
.chl-badge { font-size: 0.7rem; font-weight: 800; padding: 4px 8px; border-radius: 6px; letter-spacing: 1px; background: rgba(255,255,255,0.1); }
.b-ontrack { background: #22c55e; color: #000; }
.b-behind { background: #f97316; color: #fff; }
.b-danger { background: #ef5350; color: #fff; }

/* Wizard */
.chl-wizard-content { width: 90%; max-width: 800px; padding: 32px; display: flex; flex-direction: column; }
.chl-wizard-progress { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; }
.chl-wizard-progress .fill { height: 100%; background: #c084fc; border-radius: 3px; transition: 0.3s; }
.chl-wizard-body { padding: 24px 0; min-height: 350px; }

.chl-firm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.firm-card { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); padding: 16px; border-radius: 12px; cursor: pointer; transition: 0.2s; text-align: center; }
.firm-card:hover, .firm-card.selected { border-color: #c084fc; background: rgba(192,132,252,0.1); transform: translateY(-2px); }
.firm-card .f-ico { font-size: 2rem; margin-bottom: 8px; }
.firm-card .f-name { font-weight: 700; font-size: 1rem; }

.chl-size-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.chl-size-btn { flex: 1; min-width: 80px; padding: 12px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.chl-size-btn:hover, .chl-size-btn.active { background: #c084fc; color: #000; border-color: #c084fc; }

.chl-rules-verification { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; background: rgba(0,0,0,0.2); padding: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }

/* SVG Gradient Defs container */
.svg-defs-hidden { width: 0; height: 0; position: absolute; }