/* ==========================================================================
   ELITE POSITION SIZING LAB CSS
   Glassmorphism, Quant Charts, Responsive Grids
   ========================================================================== */

/* Layout & Globals */
.psz-container { margin-left: 20px; padding: 32px; min-height: 100vh; color: #ffffff; display: flex; flex-direction: column; gap: 24px; font-family: 'Inter', sans-serif; }

/* Utilities */
.hidden { display: none !important; }
.m-0 { margin: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.text-sm { font-size: 0.85rem; } .text-muted { color: rgba(255,255,255,0.6); } .w-full { width: 100%; }
.text-purple { color: #c084fc; } .text-cyan { color: #06b6d4; } .text-gold { color: #fbbf24; } .text-red { color: #ef5350; } .text-green { color: #22c55e; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseBtn { 0% { box-shadow: 0 0 0 0 rgba(168,85,247,0.6); } 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 strokeDraw { to { stroke-dashoffset: 0; } }
.fade-in { animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse-btn { animation: pulseBtn 2s infinite; }

/* Cards (Glassmorphism) */
.psz-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; padding: 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; }
.psz-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.05); border-color: rgba(192,132,252,0.3); box-shadow: 0 12px 40px rgba(0,0,0,0.4); cursor: pointer; }

/* Header Elements */
.psz-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 24px; }
.psz-header__title { font-size: 2.2rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: 1px; text-transform: uppercase; }
.psz-header__subtitle { color: #c084fc; margin: 0; font-size: 1rem; }
.psz-header__stats { display: flex; gap: 24px; }
.psz-stat-card { text-align: center; }
.psz-stat-val { display: block; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.psz-stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-transform: uppercase; }

/* Buttons & Inputs */
.psz-btn { padding: 10px 20px; border-radius: 12px; font-weight: 600; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.4s; border: none; text-transform: uppercase; font-family: inherit; }
.psz-btn--primary { background: linear-gradient(135deg, #a855f7, #7e22ce); color: white; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
.psz-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5); }
.psz-btn--secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.psz-btn--secondary:hover { background: rgba(255,255,255,0.1); border-color: #c084fc; color: #c084fc; }
.psz-btn--massive { padding: 16px; font-size: 1.1rem; border-radius: 16px; }
.psz-btn-icon { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.psz-btn-icon:hover { background: rgba(192,132,252,0.2); color: #c084fc; border-color: #c084fc; transform: rotate(180deg); }

.psz-input { width: 100%; max-width: 120px; 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; font-weight: 700; font-variant-numeric: tabular-nums; }
.psz-input:focus { border-color: #c084fc; box-shadow: 0 0 0 2px rgba(192,132,252,0.2); }
.psz-form-group { display: flex; align-items: center; gap: 12px; }
.psz-form-group label { font-size: 0.85rem; color: rgba(255,255,255,0.8); }

/* Control Strip */
.psz-control-strip { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.03); padding: 16px 24px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); flex-wrap: wrap; gap: 24px; }
.psz-edge-profile { display: flex; gap: 24px; }
.psz-edge-item { display: flex; flex-direction: column; }
.psz-edge-item span { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-transform: uppercase; }
.psz-edge-item strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.psz-constraints { display: flex; gap: 24px; align-items: center; }

/* Warnings */
.psz-warnings { display: flex; flex-direction: column; gap: 8px; }
.psz-warning-item { background: rgba(239,83,80,0.15); border-left: 4px solid #ef5350; padding: 12px 16px; border-radius: 8px; font-size: 0.85rem; color: #ffcdd2; display: flex; align-items: center; gap: 12px; }

/* Hero Recommendation */
.psz-hero { display: flex; justify-content: space-between; align-items: center; background: radial-gradient(circle at right, rgba(251,191,36,0.1) 0%, rgba(0,0,0,0) 70%); border-color: rgba(251,191,36,0.3); }
.psz-hero:hover { transform: none; cursor: default; border-color: rgba(251,191,36,0.5); }
.psz-hero-label { font-size: 0.85rem; font-weight: 800; letter-spacing: 1.5px; }
.psz-hero-title { font-size: 2.5rem; font-weight: 800; margin: 8px 0; }
.psz-hero-kpis { display: flex; gap: 32px; }
.psz-hero-kpis .kpi { display: flex; flex-direction: column; }
.psz-hero-kpis .lbl { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-transform: uppercase; }
.psz-hero-kpis .val { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.psz-hero-action { display: flex; flex-direction: column; align-items: center; width: 200px; }
.psz-score-ring { position: relative; width: 100px; height: 100px; }
.psz-score-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.psz-score-ring .bg { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 8; }
.psz-score-ring .fill { fill: none; stroke: #fbbf24; stroke-width: 8; stroke-dasharray: 283; stroke-dashoffset: 283; transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1); stroke-linecap: round; }
.psz-score-ring .score-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.5rem; font-weight: 800; color: #fbbf24; }

/* Grid & Cards */
.psz-section-title { font-size: 1.2rem; margin: 0 0 16px 0; text-transform: uppercase; letter-spacing: 1px; }
.psz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.psz-model-card { display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.psz-model-card .header { display: flex; justify-content: space-between; align-items: flex-start; }
.psz-model-card .title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.psz-badge { padding: 4px 8px; border-radius: 6px; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.badge-safe { background: rgba(34,197,94,0.2); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.badge-moderate { background: rgba(251,191,36,0.2); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.badge-aggressive { background: rgba(249,115,22,0.2); color: #fdba74; border: 1px solid rgba(249,115,22,0.3); }
.badge-danger { background: rgba(239,83,80,0.2); color: #ffcdd2; border: 1px solid rgba(239,83,80,0.3); }

.psz-model-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.psz-model-metrics .lbl { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.psz-model-metrics .val { font-size: 1.1rem; font-weight: 700; }
.psz-sparkline { width: 100%; height: 60px; margin-top: auto; }
.spark-path { fill: none; stroke: #c084fc; stroke-width: 2; }
.spark-fill { fill: rgba(168,85,247,0.1); }

/* Modals */
.psz-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.psz-modal__overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.psz-modal__content { position: relative; background: #0d0b12; border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; width: 90%; max-width: 700px; max-height: 90vh; overflow-y: auto; padding: 32px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: fadeInUp 0.3s ease-out; }
.psz-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; }
.psz-modal__close:hover { color: white; }

.psz-detail-header { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 16px; }
.psz-kpi-row { display: flex; justify-content: space-between; background: rgba(0,0,0,0.3); padding: 16px; border-radius: 12px; }
.kpi-box { display: flex; flex-direction: column; }
.kpi-box span { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-transform: uppercase; }
.kpi-box strong { font-size: 1.5rem; }

.psz-detail-chart-container { width: 100%; height: 250px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; position: relative; }
.psz-svg-chart { width: 100%; height: 100%; overflow: visible; padding: 10px; }
.chart-axis { stroke: rgba(255,255,255,0.1); stroke-width: 1; }
.chart-line { fill: none; stroke-width: 2; stroke-linecap: round; }
.psz-detail-explain { background: rgba(168,85,247,0.1); border-left: 3px solid #c084fc; padding: 16px; border-radius: 8px; }

/* Compare Table */
.psz-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.psz-table th { text-align: left; padding: 12px 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; }
.psz-table td { padding: 12px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); font-variant-numeric: tabular-nums; }
.psz-table tr:hover td { background: rgba(255,255,255,0.02); }

.psz-chart-legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: rgba(255,255,255,0.7); }
.legend-box { width: 12px; height: 12px; border-radius: 2px; }