/* ==========================================================================
   ELITE CHALLENGE MODE CSS
   Glassmorphism, Gamification UI, Slide-overs
   ========================================================================== */

/* Layout & Globals */
.cmd-container { margin-left: 20px; padding: 32px; min-height: 100vh; color: #ffffff; font-family: 'Inter', sans-serif; position: relative; overflow-x: hidden; }
.cmd-content-wrapper { display: flex; flex-direction: column; gap: 24px; }
.cmd-layout-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Utilities */
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.hidden-mobile { display: flex; }
@media (max-width: 768px) { .hidden-mobile { display: none !important; } }
.m-0 { margin: 0; } .mx-auto { margin-left: auto; margin-right: auto; } .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-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.p-0 { padding: 0 !important; } .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); }
.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; } .text-right { text-align: right; }
.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-orange { color: #fb923c; } .text-white { color: #ffffff; }
.bg-purple { background: #c084fc; color: #000; } .bg-gold { background: #fbbf24; color: #000; } .bg-green { background: #22c55e; color: #000; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@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); } }

.fade-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse-btn { animation: pulseGlow 2s infinite; border-radius: 12px; }

/* Buttons & Inputs */
.cmd-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; }
.cmd-btn--primary { background: linear-gradient(135deg, #a855f7, #7e22ce); color: white; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
.cmd-btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5); }
.cmd-btn--secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.cmd-btn--secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: #c084fc; color: #c084fc; }
.cmd-btn--massive { padding: 16px 32px; font-size: 1.1rem; border-radius: 16px; }
.cmd-btn-icon { background: transparent; border: none; color: rgba(255,255,255,0.6); cursor: pointer; transition: 0.2s; font-size: 1.2rem; }
.cmd-btn-icon:hover { color: white; transform: scale(1.1); }
.cmd-btn-icon-small { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.cmd-btn-icon-small:hover { background: rgba(192,132,252,0.2); color: #c084fc; border-color: #c084fc; }
.border-red { border-color: rgba(239,83,80,0.4) !important; } .border-red:hover { background: rgba(239,83,80,0.1) !important; color: #ef5350 !important; border-color: #ef5350 !important; }

.cmd-input, .cmd-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; }
.cmd-input:focus, .cmd-select:focus { border-color: #c084fc; box-shadow: 0 0 0 2px rgba(192,132,252,0.2); }
.cmd-form-group { margin-bottom: 16px; }
.cmd-form-group label { display: block; margin-bottom: 8px; font-size: 0.85rem; color: rgba(255,255,255,0.8); font-weight: 600; }
.cmd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Progress */
.cmd-progress-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.cmd-progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s cubic-bezier(0.16,1,0.3,1); }
.cmd-xp-box { width: 250px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); padding: 12px 16px; border-radius: 12px; }

/* Header & Tabs */
.cmd-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 24px; }
.cmd-header__title { font-size: 2.2rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: 1px; text-transform: uppercase; }
.cmd-header__subtitle { color: #c084fc; margin: 0; font-size: 1rem; }
.cmd-header__actions { display: flex; gap: 16px; align-items: center; }

.cmd-nav-tabs { display: flex; gap: 8px; background: rgba(0,0,0,0.3); padding: 6px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); }
.cmd-tab-btn { background: transparent; border: none; color: rgba(255,255,255,0.5); padding: 8px 16px; border-radius: 12px; font-weight: 700; font-size: 0.8rem; cursor: pointer; transition: 0.3s; text-transform: uppercase; }
.cmd-tab-btn:hover { color: white; }
.cmd-tab-btn.active { background: rgba(255,255,255,0.1); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.cmd-tab-content { animation: fadeInUp 0.4s forwards; }

/* Featured Hero */
.cmd-featured-card { position: relative; border-radius: 24px; overflow: hidden; border: 1px solid rgba(192,132,252,0.3); box-shadow: 0 20px 50px rgba(168,85,247,0.15); display: flex; align-items: center; padding: 40px; min-height: 280px; }
.cmd-featured-bg { position: absolute; top:0; left:0; width:100%; height:100%; background: radial-gradient(circle at right, rgba(168,85,247,0.2), rgba(0,0,0,0.8)); z-index: 1; }
.cmd-featured-content { position: relative; z-index: 2; width: 100%; }

/* Filters */
.cmd-filters { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: rgba(255,255,255,0.03); padding: 12px 20px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); }
.cmd-search-box { position: relative; flex-grow: 1; min-width: 250px; }
.cmd-search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.4); }
.cmd-search-box input { width: 100%; padding: 10px 14px 10px 36px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px; outline: none; }
.cmd-filter-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.cmd-pill { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.6); padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; cursor: pointer; transition: 0.3s; white-space: nowrap; font-weight: 600; }
.cmd-pill:hover { color: white; background: rgba(255,255,255,0.05); }
.cmd-pill.active { background: rgba(192,132,252,0.2); color: #c084fc; border-color: rgba(192,132,252,0.4); }

/* Badges */
.cmd-badge { font-size: 0.65rem; padding: 4px 8px; border-radius: 6px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; display: inline-block; }
.diff-easy { background: rgba(34,197,94,0.2); color: #4ade80; border: 1px solid rgba(34,197,94,0.4); }
.diff-medium { background: rgba(251,191,36,0.2); color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); }
.diff-hard { background: rgba(249,115,22,0.2); color: #fb923c; border: 1px solid rgba(249,115,22,0.4); }
.diff-extreme { background: rgba(239,83,80,0.2); color: #ef5350; border: 1px solid rgba(239,83,80,0.4); }

/* Grid & Cards */
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.cmd-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 24px; cursor: pointer; transition: 0.3s; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.cmd-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.04); border-color: rgba(192,132,252,0.3); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.cmd-card.is-active { border-color: rgba(6,182,212,0.4); background: rgba(6,182,212,0.05); }

.c-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.c-title { font-size: 1.1rem; font-weight: 800; margin: 0 0 4px 0; line-height: 1.3; }
.c-desc { font-size: 0.85rem; color: rgba(255,255,255,0.5); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 16px; }
.c-stats { display: flex; gap: 12px; font-size: 0.8rem; color: rgba(255,255,255,0.7); font-weight: 600; margin-bottom: 16px; }
.c-status { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.05); color: #c084fc; display: flex; justify-content: space-between; align-items: center; }

/* My Challenges specific */
.c-ring-wrap { position: relative; width: 100%; aspect-ratio: 1; margin-bottom: 16px; display: flex; justify-content: center; }
.c-ring-wrap svg { width: 100px; height: 100px; transform: rotate(-90deg); }
.c-ring-wrap .bg { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 8; }
.c-ring-wrap .fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease-out; }
.c-ring-wrap .inner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.5rem; }

/* Hall of Fame Podium */
.cmd-podium-container { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 24px; padding: 40px; }
.cmd-podium { display: flex; align-items: flex-end; justify-content: center; gap: 16px; height: 250px; }
.pod-item { display: flex; flex-direction: column; align-items: center; width: 120px; }
.pod-avatar { width: 64px; height: 64px; border-radius: 50%; background: #333; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 8px; border: 2px solid; z-index: 2; position: relative; }
.pod-name { font-weight: 700; font-size: 0.9rem; text-align: center; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pod-bar { width: 100%; border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; justify-content: center; padding-top: 16px; font-size: 2rem; font-weight: 900; color: rgba(0,0,0,0.5); }
.pod-1 .pod-bar { height: 160px; background: linear-gradient(to bottom, #fbbf24, #b45309); }
.pod-1 .pod-avatar { border-color: #fbbf24; box-shadow: 0 0 20px rgba(251,191,36,0.5); }
.pod-1 .pod-avatar::before { content:'👑'; position:absolute; top:-20px; font-size:1.5rem; }
.pod-2 .pod-bar { height: 120px; background: linear-gradient(to bottom, #e5e7eb, #9ca3af); }
.pod-2 .pod-avatar { border-color: #e5e7eb; }
.pod-3 .pod-bar { height: 90px; background: linear-gradient(to bottom, #d97706, #78350f); }
.pod-3 .pod-avatar { border-color: #d97706; }

/* Table */
.cmd-table-wrap { overflow-x: auto; }
.cmd-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.cmd-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; }
.cmd-table td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); font-variant-numeric: tabular-nums; }
.cmd-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Slide Panel (Detail) */
.cmd-slide-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 999; transition: opacity 0.4s; }
.cmd-slide-panel { position: fixed; top: 0; right: 0; width: 100%; max-width: 550px; 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; }
.cmd-slide-panel.open { transform: translateX(0); }
.cmd-detail-bg { position: absolute; top:0; left:0; width:100%; height:100%; background: linear-gradient(to bottom, rgba(168,85,247,0.4), #0d0b12); }
.cmd-slide-body { padding: 24px; overflow-y: auto; flex-grow: 1; }

.cmd-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: rgba(0,0,0,0.3); padding: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
.cmd-stat-box { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cmd-stat-box .lbl { font-size: 0.65rem; color: rgba(255,255,255,0.5); text-transform: uppercase; margin-bottom: 4px; }
.cmd-stat-box .val { font-size: 1rem; font-weight: 700; tabular-nums: tabular-nums; }

.cmd-tabs { display: flex; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 12px; }
.cmd-tab-mini { background: transparent; border: none; color: rgba(255,255,255,0.5); font-weight: 600; cursor: pointer; padding: 4px 8px; transition: 0.2s; text-transform: uppercase; font-size: 0.75rem; }
.cmd-tab-mini:hover { color: white; }
.cmd-tab-mini.active { color: #c084fc; border-bottom: 2px solid #c084fc; }
.cmd-det-section { animation: fadeInUp 0.3s forwards; }

.cmd-rules-list { display: flex; flex-direction: column; gap: 12px; }
.cmd-rule-item { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); padding: 16px; border-radius: 12px; }
.r-type { font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,0.5); color: #c084fc; font-weight: 700; text-transform: uppercase; }

.cmd-sticky-cta { position: absolute; bottom: 0; left: 0; width: 100%; padding: 24px; background: linear-gradient(to top, #0d0b12 70%, transparent); display: flex; flex-direction: column; gap: 8px; }

/* Modals */
.cmd-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.cmd-modal__overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.cmd-modal__content { position: relative; background: #0d0b12; border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: popIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.cmd-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; }
.cmd-modal__close:hover { color: white; }

.cmd-checkin-list { display: flex; flex-direction: column; gap: 12px; }
.chk-item { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); padding: 16px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; }
.chk-item.auto-pass { border-left: 3px solid #22c55e; }
.chk-item.self-rep { border-left: 3px solid #fbbf24; }
.chk-actions { display: flex; gap: 8px; }
.chk-btn { 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.2s; display: flex; align-items: center; justify-content: center; }
.chk-btn:hover { transform: scale(1.1); }
.chk-btn.yes:hover, .chk-btn.yes.selected { background: rgba(34,197,94,0.2); border-color: #22c55e; color: #22c55e; }
.chk-btn.no:hover, .chk-btn.no.selected { background: rgba(239,83,80,0.2); border-color: #ef5350; color: #ef5350; }