/* ==========================================================================
   ELITE MOBILE COMPANION CSS
   Glassmorphism, Pairing UI, Wellness Charts
   ========================================================================== */

/* Layout & Globals */
.mob-container { margin-left: 20px; padding: 32px; min-height: 100vh; color: #ffffff; font-family: 'Inter', sans-serif; position: relative; overflow-x: hidden; display: flex; flex-direction: column; }
.mob-layout { display: flex; gap: 24px; align-items: flex-start; flex-grow: 1; height: calc(100vh - 200px); }
.mob-main-view { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.mob-sidebar { width: 340px; flex-shrink: 0; height: 100%; overflow-y: auto; padding-right: 8px; }

/* Utilities */
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.hidden-mobile { display: flex; }
@media (max-width: 768px) { .hidden-mobile { display: none !important; } .mob-layout { flex-direction: column; height: auto; } .mob-sidebar { width: 100%; } }
.m-0 { margin: 0; } .mx-auto { margin-left: auto; margin-right: auto; } .p-0 { padding: 0 !important; } .p-8 { padding: 8px; } .p-16 { padding: 16px; } .p-24 { padding: 24px; }
.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; }
.pl-16 { padding-left: 16px; } .pb-16 { padding-bottom: 16px; }
.border-bottom { border-bottom: 1px solid rgba(255,255,255,0.1); } .border-top { border-top: 1px solid rgba(255,255,255,0.1); } .border-right { border-right: 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; } .align-start { align-items: flex-start; } .flex-end { display: flex; justify-content: flex-end; } .justify-center { justify-content: center; } .gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .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-cyan { background: #06b6d4; color: #000; } .bg-gold { background: #fbbf24; color: #000; } .bg-green { background: #22c55e; color: #000; } .bg-red { background: #ef5350; color: #fff; } .bg-dark { background: rgba(0,0,0,0.5); } .bg-transparent { background: transparent !important; }
.border-cyan { border: 1px solid rgba(6,182,212,0.4); } .border-green { border: 1px solid rgba(34,197,94,0.4); } .border-purple { border: 1px solid rgba(192,132,252,0.4); } .border-red { border: 1px solid rgba(239,83,80,0.4); } .border-gold { border: 1px solid rgba(251,191,36,0.4); }

/* 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); } }
@keyframes pulseDot { 0% { transform: scale(0.8); opacity: 0.5; } 50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 8px currentColor; } 100% { transform: scale(0.8); opacity: 0.5; } }
@keyframes radarPing { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(3); opacity: 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; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; animation: pulseDot 2s infinite ease-in-out; }

/* Cards & Buttons */
.mob-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; }

.mob-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; }
.mob-btn--primary { background: linear-gradient(135deg, #a855f7, #7e22ce); color: white; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
.mob-btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5); }
.mob-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.mob-btn--secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.mob-btn--secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: #c084fc; color: #c084fc; }
.mob-btn-icon { background: transparent; border: none; color: rgba(255,255,255,0.6); cursor: pointer; transition: 0.2s; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; }
.mob-btn-icon:hover { color: white; background: rgba(255,255,255,0.1); transform: scale(1.05); }
.mob-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; font-size: 0.9rem; flex-shrink: 0; }
.mob-btn-icon-small:hover { background: rgba(192,132,252,0.2); color: #c084fc; border-color: #c084fc; }
.mob-btn-text { background: transparent; border: none; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: 0.2s; padding: 0; }
.mob-btn-text:hover { filter: brightness(1.2); }

.mob-input, .mob-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; }
.mob-input:focus, .mob-select:focus { border-color: #c084fc; box-shadow: 0 0 0 2px rgba(192,132,252,0.2); }
.mob-form-group { margin-bottom: 16px; }
.mob-form-group label { display: block; margin-bottom: 8px; font-size: 0.85rem; color: rgba(255,255,255,0.8); font-weight: 600; }

/* Switch Toggle */
.mob-switch { position: relative; display: inline-block; width: 42px; height: 22px; flex-shrink: 0; }
.mob-switch input { opacity: 0; width: 0; height: 0; }
.mob-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; }
.mob-slider-toggle:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
.mob-switch input:checked + .mob-slider-toggle { background-color: #a855f7; }
.mob-switch input:checked + .mob-slider-toggle:before { transform: translateX(20px); }

.mob-feature-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; margin-bottom: 8px; transition: 0.2s; }
.mob-feature-row:hover { background: rgba(255,255,255,0.05); border-color: rgba(192,132,252,0.3); }

/* Header */
.mob-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 24px; flex-shrink: 0; }
.mob-header__title { font-size: 2.2rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: 1px; }
.mob-header__subtitle { color: #c084fc; margin: 0; font-size: 1rem; }
.mob-header__actions { display: flex; gap: 16px; align-items: center; }

.mob-status-badge { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #4ade80; padding: 6px 12px; border-radius: 16px; font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 1px; }

/* Install & Pairing */
.mob-install-grid { display: flex; gap: 16px; justify-content: center; }
.mob-install-card { width: 180px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); padding: 24px; border-radius: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; transition: 0.2s; }
.mob-install-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.05); border-color: #06b6d4; }
.mob-install-card i { font-size: 3.5rem; }

.mob-pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.mob-qr-box { width: 180px; height: 180px; background: #fff; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px; }
.mob-pair-code { font-family: monospace; font-size: 3rem; font-weight: 900; letter-spacing: 4px; line-height: 1; }
.mob-step-list { display: flex; flex-direction: column; gap: 16px; }
.mob-step-item { display: flex; gap: 12px; align-items: center; }
.mob-step-item .num { width: 28px; height: 28px; border-radius: 50%; background: #a855f7; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex-shrink: 0; }
.mob-step-item .txt { font-size: 0.9rem; color: rgba(255,255,255,0.9); }

.mob-radar-box { position: relative; padding: 12px 24px; background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.3); border-radius: 12px; display: flex; align-items: center; gap: 16px; }
.radar-dot { position: relative; width: 12px; height: 12px; background: #c084fc; border-radius: 50%; }
.radar-dot::after { content:''; position:absolute; top:-4px; left:-4px; width:20px; height:20px; border-radius:50%; background: #c084fc; animation: radarPing 1.5s infinite; }

/* Devices Grid */
.mob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.mob-device-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 20px; transition: 0.3s; position: relative; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; }
.mob-device-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); }

.d-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 16px; }
.d-logo { font-size: 2.2rem; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.d-name { font-size: 1.1rem; font-weight: 800; margin: 0 0 4px 0; color: #fff; }
.d-os { font-size: 0.8rem; color: rgba(255,255,255,0.5); }
.mob-status-chip { display: flex; align-items: center; gap: 6px; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #fff; background: rgba(255,255,255,0.1); padding: 4px 8px; border-radius: 6px; }
.st-live { background: rgba(34,197,94,0.2); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.st-idle { background: rgba(251,191,36,0.2); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }

.d-metrics { display: flex; justify-content: space-between; margin-bottom: 16px; }
.d-metric { display: flex; flex-direction: column; }
.d-metric .lbl { font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; margin-bottom: 4px; }
.d-metric .val { font-size: 1.1rem; font-weight: 700; tabular-nums: tabular-nums; }

.d-features { display: flex; gap: 8px; margin-bottom: 16px; }
.f-icon { width: 28px; height: 28px; border-radius: 6px; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; color: rgba(255,255,255,0.4); }
.f-icon.active { background: rgba(192,132,252,0.2); color: #c084fc; border: 1px solid rgba(192,132,252,0.4); }

.d-actions { display: flex; gap: 8px; margin-top: auto; }

/* Global Feed */
.mob-feed-list { flex-grow: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.mob-feed-list::-webkit-scrollbar { width: 4px; }
.mob-feed-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.feed-item { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); padding: 12px; border-radius: 8px; font-size: 0.8rem; display: flex; align-items: flex-start; gap: 12px; animation: popIn 0.2s ease-out forwards; }
.feed-item:hover { background: rgba(255,255,255,0.05); cursor: pointer; }
.feed-ico { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.fi-pho { background: rgba(192,132,252,0.2); color: #c084fc; }
.fi-voc { background: rgba(251,191,36,0.2); color: #fbbf24; }
.fi-mod { background: rgba(34,197,94,0.2); color: #4ade80; }
.fi-loc { background: rgba(6,182,212,0.2); color: #06b6d4; }
.feed-det { display: flex; flex-direction: column; gap: 4px; }
.feed-det .tit { font-weight: 700; color: #fff; }
.feed-det .sub { color: rgba(255,255,255,0.5); font-size: 0.7rem; }

/* Drawer Detail */
.mob-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; }
.mob-slide-panel { position: fixed; top: 0; right: 0; width: 100%; max-width: 600px; 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; }
.mob-slide-panel.open { transform: translateX(0); }
.mob-detail-bg { position: absolute; top:0; left:0; width:100%; height:100%; background: linear-gradient(to bottom, rgba(168,85,247,0.2), #0d0b12 60%); transition: background 0.3s; }
.mob-slide-body { padding: 24px; overflow-y: auto; flex-grow: 1; }

.mob-hero-icon { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #fff; }
.mob-action-row { display: flex; gap: 8px; flex-wrap: wrap; }

.mob-tabs { display: flex; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 12px; }
.mob-tab-mini { background: transparent; border: none; color: rgba(255,255,255,0.5); font-weight: 600; cursor: pointer; padding: 6px 12px; transition: 0.2s; text-transform: uppercase; font-size: 0.8rem; border-radius: 8px; }
.mob-tab-mini:hover { color: white; background: rgba(255,255,255,0.05); }
.mob-tab-mini.active { color: #c084fc; background: rgba(192,132,252,0.1); }
.mob-det-section { animation: fadeInUp 0.3s forwards; }

.mob-events-list { display: flex; flex-direction: column; gap: 8px; }

/* Wellness Chart */
.mob-chart-container { width: 100%; height: 200px; background: rgba(255,255,255,0.02); border-radius: 12px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); }
.chart-svg { width: 100%; height: 100%; padding: 10px; overflow: visible; }
.chart-axis { stroke: rgba(255,255,255,0.1); stroke-width: 1; }
.chart-line-sleep { fill: none; stroke: #c084fc; stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 4px 10px rgba(192,132,252,0.3)); }
.chart-line-wr { fill: none; stroke: #22c55e; stroke-width: 2; stroke-dasharray: 4; }
.l-box { width: 12px; height: 4px; border-radius: 2px; }

/* Modals */
.mob-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.mob-modal__overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.mob-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; padding: 32px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: popIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.mob-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; }
.mob-modal__close:hover { color: white; }