/* XrayMac Android Storage Studio - Core Mobile Stylesheet */
:root {
  --bg-main: #070709;
  --bg-card: rgba(18, 18, 24, 0.85);
  --bg-card-hover: rgba(28, 28, 38, 0.95);
  --border-card: rgba(255, 255, 255, 0.10);
  --accent: #E11D48;
  --accent-rgb: 225, 29, 72;
  --accent-gradient: linear-gradient(135deg, #E11D48 0%, #BE123C 100%);
  --accent-text: #FB7185;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body.theme-obsidian {
  --accent: #E11D48;
  --accent-rgb: 225, 29, 72;
  --accent-gradient: linear-gradient(135deg, #E11D48 0%, #BE123C 100%);
  --accent-text: #FB7185;
}

body.theme-forest {
  --accent: #10B981;
  --accent-rgb: 16, 185, 129;
  --accent-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
  --accent-text: #34D399;
}

body.theme-ocean {
  --accent: #06B6D4;
  --accent-rgb: 6, 182, 212;
  --accent-gradient: linear-gradient(135deg, #06B6D4 0%, #0284C7 100%);
  --accent-text: #38BDF8;
}

body.theme-aurora {
  --accent: #8B5CF6;
  --accent-rgb: 139, 92, 246;
  --accent-gradient: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  --accent-text: #A78BFA;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* Header App Icon Lock (prevents natural image dimensions from blowing out layout) */
.app-header-logo {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 10px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  display: block;
}

/* Base Utility Classes */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }
.block { display: block; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; min-height: 0; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-around { justify-content: space-around; }

.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-1\.5 > * + * { margin-left: 0.375rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-2\.5 > * + * { margin-left: 0.625rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-1\.5 > * + * { margin-top: 0.375rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
.w-8 { width: 2rem; max-width: 2rem; }
.h-8 { height: 2rem; max-height: 2rem; }
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.h-2 { height: 0.5rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.cursor-pointer { cursor: pointer; }

/* Spacing */
.p-0\.5 { padding: 0.125rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.pt-2 { padding-top: 0.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pr-2 { padding-right: 0.5rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }

.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-2\.5 { margin-top: 0.625rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-auto { margin-top: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-2\.5 { margin-bottom: 0.625rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mx-3 { margin-left: 0.75rem; margin-right: 0.75rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }

/* Border Radius */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Borders */
.border { border-width: 1px; border-style: solid; border-color: rgba(255, 255, 255, 0.1); }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgba(255, 255, 255, 0.08); }
.border-t { border-top-width: 1px; border-top-style: solid; border-top-color: rgba(255, 255, 255, 0.08); }
.border-white\/5 { border-color: rgba(255, 255, 255, 0.05); }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.10); }
.border-white\/15 { border-color: rgba(255, 255, 255, 0.15); }
.border-white\/\[0\.06\] { border-color: rgba(255, 255, 255, 0.06); }
.border-white\/\[0\.08\] { border-color: rgba(255, 255, 255, 0.08); }
.border-white\/\[0\.10\] { border-color: rgba(255, 255, 255, 0.10); }
.border-white\/\[0\.12\] { border-color: rgba(255, 255, 255, 0.12); }
.border-amber-500\/30 { border-color: rgba(245, 158, 11, 0.30); }
.border-rose-500\/40 { border-color: rgba(244, 63, 94, 0.40); }
.border-emerald-500\/30 { border-color: rgba(16, 185, 129, 0.30); }
.border-emerald-500\/40 { border-color: rgba(16, 185, 129, 0.40); }
.border-cyan-500\/40 { border-color: rgba(6, 182, 212, 0.40); }
.border-purple-500\/40 { border-color: rgba(168, 85, 247, 0.40); }

/* Backgrounds */
.bg-\[\#0a0a0e\] { background-color: #0a0a0e; }
.bg-\[\#0b0b10\] { background-color: #0b0b10; }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.10); }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.20); }
.bg-white\/\[0\.03\] { background-color: rgba(255, 255, 255, 0.03); }
.bg-white\/\[0\.04\] { background-color: rgba(255, 255, 255, 0.04); }
.bg-white\/\[0\.05\] { background-color: rgba(255, 255, 255, 0.05); }
.bg-white\/\[0\.06\] { background-color: rgba(255, 255, 255, 0.06); }
.bg-white\/\[0\.08\] { background-color: rgba(255, 255, 255, 0.08); }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.50); }
.bg-neutral-700 { background-color: #404040; }
.bg-neutral-800 { background-color: #262626; }
.bg-rose-500 { background-color: #f43f5e; }
.bg-rose-500\/10 { background-color: rgba(244, 63, 94, 0.10); }
.bg-rose-500\/20 { background-color: rgba(244, 63, 94, 0.20); }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.10); }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.20); }
.bg-cyan-500\/10 { background-color: rgba(6, 182, 212, 0.10); }
.bg-purple-500\/10 { background-color: rgba(168, 85, 247, 0.10); }
.bg-amber-500 { background-color: #f59e0b; }
.bg-amber-500\/15 { background-color: rgba(245, 158, 11, 0.15); }

/* Gradients */
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops, #10b981, #f43f5e)); }
.from-emerald-500 { --tw-gradient-from: #10b981; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(16, 185, 129, 0)); }
.to-rose-500 { --tw-gradient-to: #f43f5e; }
.to-teal-600 { --tw-gradient-to: #0d9488; }

/* Typography */
.font-mono { font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-white { color: #FFFFFF; }
.text-black { color: #000000; }
.text-rose-400 { color: #FB7185; }
.text-rose-500 { color: #F43F5E; }
.text-emerald-400 { color: #34D399; }
.text-emerald-500 { color: #10B981; }
.text-cyan-400 { color: #22D3EE; }
.text-amber-200 { color: #FDE68A; }
.text-amber-400 { color: #FBBF24; }
.text-purple-400 { color: #C084FC; }
.text-neutral-300 { color: #CBD5E1; }
.text-neutral-400 { color: #94A3B8; }
.text-neutral-500 { color: #64748B; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-\[9px\] { font-size: 9px; line-height: 12px; }
.text-\[10px\] { font-size: 10px; line-height: 14px; }
.text-\[11px\] { font-size: 11px; line-height: 15px; }

.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-tight { letter-spacing: -0.025em; }

/* Panels & Glassmorphism */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
}

.glass-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}

/* Shadows */
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6); }
.shadow-rose-500\/30 { box-shadow: 0 10px 25px -5px rgba(244, 63, 94, 0.30); }
.shadow-emerald-500\/25 { box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.25); }

/* Transitions & Animations */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

/* Interactive States */
.active\:scale-95:active { transform: scale(0.95); }
.hover\:bg-white\/20:hover { background-color: rgba(255, 255, 255, 0.20); }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:border-rose-500:focus { border-color: #f43f5e; }

button, a, .touch-target {
  touch-action: manipulation;
  cursor: pointer;
  outline: none;
  transition: transform 0.12s ease, opacity 0.12s ease, background-color 0.12s ease;
}

button:active, a:active, .touch-target:active {
  transform: scale(0.96);
  opacity: 0.85;
}

/* Visualizer Switcher Toggle */
.mode-toggle-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mode-toggle-btn.active {
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--accent-text);
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.25);
}

/* Generous Mobile Touch Targets */
.btn-touch-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #E2E8F0;
  font-size: 16px;
}

.btn-pill-back {
  height: 38px;
  padding: 0 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Treemap Node Styles */
.treemap-node {
  position: absolute;
  overflow: hidden;
  border-radius: 8px;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease, filter 0.15s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.treemap-node:active {
  transform: scale(0.97);
  filter: brightness(1.2);
}

.treemap-node-label {
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.treemap-node-size {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-family: ui-monospace, monospace;
  pointer-events: none;
  margin-top: 2px;
}

/* Bottom Navigation */
.bottom-nav {
  height: 68px;
  min-height: 68px;
  background: rgba(10, 10, 14, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: var(--safe-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: #64748B;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: none;
  padding: 0;
}

.nav-item.active {
  color: var(--accent-text);
}

.nav-item .nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.6));
}

/* Toast */
.bottom-20 { bottom: 5rem; }
.left-1\/2 { left: 50%; }
.-translate-x-1\/2 { transform: translateX(-50%); }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }
