/* ==========================================================================
   ELITE RULE COMPLIANCE CSS
   Glassmorphism, Audit Tables, SVG Visualizations
   ========================================================================== */

/* Layout & Globals */
.rc-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; overflow-x: hidden; }
.rc-layout { display: flex; gap: 24px; align-items: flex-start; }
.rc-main-view { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.rc-sidebar { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; gap: 24px; }

/* Utilities */
.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; } .mt-32 { margin-top: 32px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.px-16 { padding-left: 16px; padding-right: 16px; } .pt-8 { padding-top: 8px; } .pb-16 { padding-bottom: 16px; } .border-bottom { border-bottom: 1px solid rgba(255,255,255,0.1); }
.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; } .tabular-nums { font-variant-numeric: tabular-nums; }
.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; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulseDanger { 0% { box-shadow: 0 0 0 0 rgba(239,83,80,0.5); } 70% { box-shadow: 0 0 0 20px rgba(239,83,80,0); } 100% { box-shadow: 0 0 0 0 rgba(239,83,80,0); } }
@keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes flashRow { 0% { background: rgba(255,255,255,0.2); } 100% { background: transparent; } }

.fade-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse { animation: pulseDanger 2s infinite; border-radius: 8px; }
.pulse-btn { animation: pulseDanger 2s infinite; border-radius: 12px; } /* Override for primary if needed, default is primary color pulse in JS */
.flash { animation: flashRow 1s ease-out; }

/* Cards & Buttons */
.rc-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; }

.rc-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; }
.rc-btn--primary { background: linear-gradient(135deg, #a855f7, #7e22ce); color: white; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
.rc-btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5); }
.rc-btn--secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.rc-btn--secondary:hover { background: rgba(255,255,255,0.1); border-color: #c084fc; color: #c084fc; }
.rc-btn-icon { background: transparent; border: none; color: rgba(255,255,255,0.6); cursor: pointer; transition: 0.2s; font-size: 1.2rem; }
.rc-btn-icon:hover { color: white; }
.rc-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; }
.rc-btn-icon-small:hover { background: rgba(192,132,252,0.2); color: #c084fc; border-color: #c084fc; }

.rc-input, .rc-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; }
.rc-input:focus, .rc-select:focus { border-color: #c084fc; box-shadow: 0 0 0 2px rgba(192,132,252,0.2); }
.rc-form-group { margin-bottom: 16px; }
.rc-form-group label { display: block; margin-bottom: 8px; font-size: 0.85rem; color: rgba(255,255,255,0.8); font-weight: 600; }
.rc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Switch Toggle */
.rc-switch { position: relative; display: inline-block; width: 42px; height: 22px; flex-shrink: 0; }
.rc-switch input { opacity: 0; width: 0; height: 0; }
.rc-slider-toggle { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 24px; }
.rc-slider-toggle:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
.rc-switch input:checked + .rc-slider-toggle { background-color: #a855f7; }
.rc-switch input:checked + .rc-slider-toggle:before { transform: translateX(20px); }

/* Banners */
.rc-critical { background: radial-gradient(circle at left, rgba(239,83,80,0.2) 0%, rgba(0,0,0,0.8) 100%); border: 2px solid #ef5350; border-radius: 16px; padding: 16px 24px; box-shadow: 0 0 40px rgba(239,83,80,0.3), inset 0 0 20px rgba(239,83,80,0.2); animation: slideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; position: relative; z-index: 100; margin-bottom: 8px; }
.rc-critical-header { display: flex; justify-content: space-between; align-items: center; }
.rc-critical-list { display: flex; flex-direction: column; gap: 8px; }
.rc-critical-item { background: rgba(0,0,0,0.3); padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; font-weight: 700; color: #ffcdd2; display: flex; align-items: center; gap: 12px; }

/* Header */
.rc-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 24px; }
.rc-header__title { font-size: 2.2rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: 1px; text-transform: uppercase; }
.rc-header__subtitle { color: #c084fc; margin: 0; font-size: 1rem; }
.rc-header__stats { display: flex; gap: 24px; }
.rc-stat-card { text-align: center; }
.rc-stat-val { display: block; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rc-stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-transform: uppercase; }

/* Challenge Tabs */
.rc-challenges { display: flex; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.rc-tab { background: transparent; border: 1px solid transparent; color: rgba(255,255,255,0.6); padding: 8px 16px; border-radius: 20px; font-weight: 600; cursor: pointer; transition: 0.3s; white-space: nowrap; }
.rc-tab:hover { color: white; background: rgba(255,255,255,0.05); }
.rc-tab.active { background: rgba(192,132,252,0.2); color: #c084fc; border-color: rgba(192,132,252,0.4); }

/* Table Matrix */
.rc-search-box { position: relative; width: 250px; }
.rc-search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.4); }
.rc-search-box input { width: 100%; padding: 8px 12px 8px 36px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px; outline: none; font-size: 0.85rem; }

.rc-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.rc-table th { text-align: left; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); text-transform: uppercase; font-size: 0.75rem; font-weight: 700; }
.rc-table td { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: background 0.2s; }
.rc-table tr:hover td { background: rgba(255,255,255,0.02); }
.td-icon { font-size: 1.2rem; text-align: center; }

/* Status Indicators */
.st-pass { color: #22c55e; }
.st-warn { color: #fbbf24; }
.st-fail { color: #ef5350; }
.rc-badge { font-size: 0.65rem; padding: 4px 8px; border-radius: 6px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.bg-warn { background: rgba(251,191,36,0.2); color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); }
.bg-soft { background: rgba(249,115,22,0.2); color: #f97316; border: 1px solid rgba(249,115,22,0.4); }
.bg-hard { background: rgba(239,83,80,0.2); color: #ef5350; border: 1px solid rgba(239,83,80,0.4); }
.bg-ok { background: rgba(34,197,94,0.2); color: #22c55e; border: 1px solid rgba(34,197,94,0.4); }

/* Sidebar */
.rc-history-list { display: flex; flex-direction: column; gap: 8px; }
.rc-hist-item { background: rgba(0,0,0,0.2); padding: 12px; border-radius: 8px; font-size: 0.8rem; border-left: 3px solid; display: flex; flex-direction: column; gap: 4px; }
.h-soft { border-left-color: #f97316; } .h-hard { border-left-color: #ef5350; } .h-warn { border-left-color: #fbbf24; }

/* Slide Panel */
.rc-slide-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 999; transition: opacity 0.4s; }
.rc-slide-panel { position: fixed; top: 0; right: 0; width: 450px; height: 100vh; background: #0d0b12; border-left: 1px solid rgba(255,255,255,0.1); z-index: 1000; box-shadow: -10px 0 30px rgba(0,0,0,0.5); transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; }
.rc-slide-panel.open { transform: translateX(0); }
.rc-slide-header { padding: 32px 24px; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: flex-start; }
.rc-slide-body { padding: 24px; overflow-y: auto; flex-grow: 1; }

.rc-status-box { padding: 20px; border-radius: 12px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); }
.rc-status-badge { font-weight: 800; font-size: 1.2rem; }

.rc-viz-container { width: 100%; height: 200px; background: rgba(255,255,255,0.02); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); position: relative; overflow: hidden; }
.viz-svg { width: 100%; height: 100%; padding: 10px; overflow: visible; }
.v-bar { fill: #c084fc; opacity: 0.7; transition: 0.3s; }
.v-bar:hover { opacity: 1; }
.v-bar-danger { fill: #ef5350; }
.v-line-limit { stroke: #ef5350; stroke-width: 2; stroke-dasharray: 4; }

.rc-edu-box { background: rgba(251,191,36,0.1); border-left: 3px solid #fbbf24; padding: 16px; border-radius: 8px; color: rgba(255,255,255,0.9); }

/* Pre-Trade Validator */
.rc-pretrade-results { background: rgba(0,0,0,0.2); padding: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
.pt-verdict { font-size: 1.1rem; font-weight: 800; text-align: center; padding: 12px; border-radius: 8px; }
.pt-v-pass { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.pt-v-warn { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.pt-v-fail { background: rgba(239,83,80,0.15); color: #ef5350; border: 1px solid rgba(239,83,80,0.3); animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

.pt-checks-list { display: flex; flex-direction: column; gap: 8px; }
.pt-check-item { font-size: 0.85rem; display: flex; align-items: flex-start; gap: 8px; }

/* Modals */
.rc-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.rc-modal__overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.rc-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; padding: 32px; }
.rc-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; }
.rc-modal__close:hover { color: white; }