:root {
  --primary: #3B82F6;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --accent-red: #EF4444;
  --accent-red-glow: rgba(239, 68, 68, 0.35);
  --accent-green: #10B981;
  --accent-green-glow: rgba(16, 185, 129, 0.35);
  --accent-amber: #F59E0B;
  --accent-purple: #8B5CF6;
  --bg-dark: #070B13;
  --surface-1: #0F172A;
  --surface-2: rgba(30, 41, 59, 0.7);
  --surface-glass: rgba(15, 23, 42, 0.65);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(59, 130, 246, 0.5);
  --text-main: #F8FAFC;
  --text-sub: #94A3B8;
  --text-muted: #64748B;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 9999px;
  --shadow-float: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --font-base: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-base);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 45%);
  overflow-x: hidden;
}

/* Device Shell */
.app-container {
  width: 100%;
  max-width: 440px;
  min-height: 92vh;
  background: var(--surface-1);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(20px);
  margin: 16px auto;
}

/* Dynamic Island / Top Notch emulation */
.notch-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  z-index: 10;
}

.island-capsule {
  width: 90px;
  height: 24px;
  background: #000;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.island-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

/* Header */
.app-header {
  padding: 8px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.badge-counter-position {
  font-size: 0.65rem;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Main Storage Ring Hero */
.storage-hero {
  padding: 16px 24px;
  text-align: center;
  position: relative;
}

.ring-wrapper {
  width: 170px;
  height: 170px;
  margin: 0 auto 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 14;
}

.ring-fill {
  fill: none;
  stroke: url(#cyan-blue-grad);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 140;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.ring-center-stat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.storage-subtext {
  font-size: 0.9rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.savings-highlight {
  color: #10B981;
  font-weight: 700;
}

/* Quick Action Scan Button */
.btn-super-scan {
  margin: 12px 24px;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 50%, #1D4ED8 100%);
  border: none;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px var(--primary-glow);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-super-scan:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(59, 130, 246, 0.5);
}

.btn-super-scan:active {
  transform: translateY(1px);
}

/* Feature Grid */
.features-grid {
  padding: 8px 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  flex: 1;
}

.feature-card {
  background: var(--surface-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.feature-card:hover {
  border-color: var(--border-focus);
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-3px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.icon-box.blue { background: rgba(59, 130, 246, 0.15); color: #60A5FA; }
.icon-box.red { background: rgba(239, 68, 68, 0.15); color: #F87171; }
.icon-box.amber { background: rgba(245, 158, 11, 0.15); color: #FBBF24; }
.icon-box.purple { background: rgba(139, 92, 246, 0.15); color: #A78BFA; }
.icon-box.green { background: rgba(16, 185, 129, 0.15); color: #34D399; }

.badge-tag {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
}

.badge-tag.alert {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.card-desc {
  font-size: 0.75rem;
  color: var(--text-sub);
}

/* Swipe Mode Overlay / Modal */
.view-panel {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-1);
  z-index: 50;
  flex-direction: column;
  padding: 24px;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-panel.active {
  display: flex;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.btn-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* Swipe Cards Deck */
.swipe-deck-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
}

.swipe-card {
  width: 100%;
  max-width: 320px;
  height: 420px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: absolute;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  background: var(--surface-2);
  border: 1px solid var(--border-glass);
  user-select: none;
  touch-action: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  display: flex;
  flex-direction: column;
}

.swipe-card img {
  width: 100%;
  height: 330px;
  object-fit: cover;
  pointer-events: none;
}

.swipe-card-info {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.swipe-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 16px 0 24px;
}

.btn-circle-action {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-circle-action.trash {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-circle-action.keep {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-circle-action:hover {
  transform: scale(1.12);
}

.btn-circle-action:active {
  transform: scale(0.92);
}

/* Bottom Tab Bar */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: 12px 0 20px;
  border-top: 1px solid var(--border-glass);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.nav-icon {
  font-size: 1.25rem;
}

/* Privacy Guarantee Banner */
.privacy-banner {
  margin: 0 24px 16px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: #34D399;
}

/* Category Filter Pills Bar */
.category-pills-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.category-pills-bar::-webkit-scrollbar {
  display: none;
}

.pill-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-glass);
  color: var(--text-sub);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pill-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Action Sub-header & Action Pills */
.review-action-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.review-action-bar::-webkit-scrollbar {
  display: none;
}

.btn-action-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-action-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-focus);
}

/* Media Review Grid */
.media-review-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  overflow-y: auto;
  padding-bottom: 70px;
}

.media-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  user-select: none;
  aspect-ratio: 1;
}

.media-card.selected {
  border-color: #EF4444;
}

.media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 40%, rgba(0,0,0,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  pointer-events: none;
}

.media-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.media-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  pointer-events: auto;
}

.media-card.selected .media-checkbox {
  background: #EF4444;
  border-color: #EF4444;
}

.media-card-bottom {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.media-card-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card-sub {
  font-size: 0.65rem;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
}

/* Review Batch Footer */
.review-batch-footer {
  position: absolute;
  bottom: 12px;
  left: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.btn-batch-purge {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-batch-purge:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Heavy Videos List Cards */
.video-item-card {
  background: var(--surface-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.video-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
}

.video-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-sub);
}

.video-savings-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: #34D399;
}

/* Secret Space / Vault */
.vault-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pin-dots-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid var(--border-glass);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pin-dot.filled {
  background: #A78BFA;
  border-color: #C4B5FD;
  box-shadow: 0 0 10px #A78BFA;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 240px;
}

.btn-key {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-key:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-focus);
}

.btn-key:active {
  transform: scale(0.92);
}

.btn-key.special {
  font-size: 1rem;
  color: var(--text-sub);
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.vault-item-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.vault-item-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vault-stealth-card {
  background: var(--surface-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

/* Lightbox Zoom Modal */
.zoom-modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.zoom-modal.active {
  display: flex;
}

.zoom-content {
  position: relative;
  max-width: 100%;
  max-height: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.zoom-content img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.zoom-close {
  position: absolute;
  top: -45px;
  right: 0;
}

.zoom-info-bar {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-sub);
  text-align: center;
}

/* Toast Notifications */
.toast-container {
  position: absolute;
  top: 60px;
  left: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 120;
  pointer-events: none;
}

.toast-message {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-focus);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: toastFadeIn 0.25s ease, toastFadeOut 0.25s ease 2.75s forwards;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

.search-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: var(--border-focus);
}
