/* ==========================================================================
   Apple Human Interface Guidelines & Fluid Motion
   Designed for esign24h.site
   ========================================================================== */

:root {
  /* Default Palette: Apple Ceramic Crystal Frost (Bright, Fresh & Luminous) */
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card-item: #ffffff;
  --bg-card-item-hover: #f8fafc;
  --bg-glass-hover: rgba(2, 132, 199, 0.05);
  --bg-glass-active: rgba(2, 132, 199, 0.1);

  /* Typography */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;

  /* Apple Accents */
  --apple-blue: #0284c7;
  --apple-blue-hover: #0369a1;
  --apple-blue-subtle: rgba(2, 132, 199, 0.1);

  --apple-emerald: #10b981;
  --apple-emerald-hover: #059669;
  --apple-emerald-subtle: rgba(16, 185, 129, 0.12);
  --apple-emerald-border: rgba(16, 185, 129, 0.35);

  --apple-amber: #f59e0b;
  --apple-amber-subtle: rgba(245, 158, 11, 0.15);

  --card-completed-bg: rgba(16, 185, 129, 0.08);

  /* Borders & Specular Crystal Highlights */
  --border-subtle: rgba(226, 232, 240, 0.85);
  --border-medium: rgba(203, 213, 225, 0.9);
  --border-specular: inset 0 1px 1.5px 0 rgba(255, 255, 255, 1);

  --shadow-card: 0 24px 60px -12px rgba(14, 165, 233, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.9), 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-item: 0 4px 14px rgba(0, 0, 0, 0.03), 0 0 0 1px rgba(226, 232, 240, 0.7);
  --shadow-item-hover: 0 12px 28px rgba(2, 132, 199, 0.12), 0 0 0 1px rgba(56, 189, 248, 0.45);
  --shadow-unlock: 0 10px 32px -4px rgba(16, 185, 129, 0.45);

  /* Physics & Transitions */
  --spring-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 160ms var(--spring-ease);
  --transition-normal: 280ms var(--spring-ease);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;
}

/* Dark Mode Alternative (Titanium Midnight) */
[data-theme="dark"] {
  --bg-primary: #090a0f;
  --bg-secondary: #0f1118;
  --bg-surface: rgba(16, 20, 29, 0.78);
  --bg-surface-elevated: #151924;
  --bg-card-item: rgba(22, 28, 40, 0.75);
  --bg-card-item-hover: rgba(30, 38, 56, 0.9);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);
  --bg-glass-active: rgba(255, 255, 255, 0.14);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-inverse: #090a0f;

  --apple-blue: #38bdf8;
  --apple-blue-hover: #0ea5e9;
  --apple-blue-subtle: rgba(56, 189, 248, 0.12);

  --apple-emerald: #10b981;
  --apple-emerald-hover: #059669;
  --apple-emerald-subtle: rgba(16, 185, 129, 0.14);
  --apple-emerald-border: rgba(16, 185, 129, 0.35);

  --apple-amber: #f59e0b;
  --apple-amber-subtle: rgba(245, 158, 11, 0.15);

  --card-completed-bg: rgba(16, 185, 129, 0.12);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-specular: inset 0 1px 0 0 rgba(255, 255, 255, 0.18);

  --shadow-card: 0 28px 65px -14px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-item: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-item-hover: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.15);
  --shadow-unlock: 0 8px 35px -4px rgba(16, 185, 129, 0.55);
}

/* ==========================================================================
   Base Resets
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Fullscreen Particle Confetti Canvas */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

/* Ambient Fluid Background - Optimized 60FPS Static Gradients (Zero GPU lag) */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.12) 0%, transparent 55%),
              radial-gradient(circle at 85% 100%, rgba(52, 211, 153, 0.10) 0%, transparent 50%),
              radial-gradient(circle at 15% 45%, rgba(192, 132, 252, 0.08) 0%, transparent 45%);
}

.glow-orb {
  display: none !important;
}

[data-theme="dark"] .glow-orb {
  opacity: 0.35;
}

[data-theme="dark"] .glow-top {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.38) 0%, rgba(30, 58, 138, 0.18) 45%, transparent 70%);
}

[data-theme="dark"] .glow-bottom {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.32) 0%, rgba(5, 150, 105, 0.14) 45%, transparent 70%);
}

/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.navbar-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform var(--transition-fast);
}

.brand-link:active {
  transform: scale(0.97);
}

.brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.06));
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.024em;
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apple-btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.apple-btn-icon:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.apple-btn-icon:active {
  transform: scale(0.94);
}

.apple-btn-icon svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }
[data-theme="light"] .theme-icon-light { display: block; }
[data-theme="light"] .theme-icon-dark { display: none; }

/* ==========================================================================
   Main Wrapper & Card
   ========================================================================== */

.main-wrapper {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 36px 16px 54px;
}

.unlock-card-container {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.apple-card {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 18px 45px -10px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 36px 32px 32px;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

/* Crystal Laser Border Beam (Rotating Orbiting Light Beam) */
.card-border-beam {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  padding: 1.5px;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: destination-out;
  z-index: 3;
}

.card-border-beam::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent 0 315deg, #0284c7 335deg, #38bdf8 348deg, #10b981 360deg);
  animation: rotateBeam 6s linear infinite;
}

@keyframes rotateBeam {
  100% { transform: rotate(360deg); }
}

/* Header Centered */
.card-header-centered {
  text-align: center;
  margin-bottom: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.apple-chip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #047857;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(56, 189, 248, 0.12) 100%);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .apple-chip-badge {
  background: rgba(52, 199, 89, 0.15);
  color: #4ade80;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.file-title {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* Hotline Support Badge */
.hotline-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(99, 102, 241, 0.06) 100%);
  border: 1px solid rgba(2, 132, 199, 0.22);
  color: var(--apple-blue);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.08);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.hotline-badge strong {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.hotline-badge svg {
  width: 15px;
  height: 15px;
  color: var(--apple-blue);
  animation: ringPhone 4s ease-in-out infinite;
}

@keyframes ringPhone {
  0%, 10%, 100% { transform: rotate(0); }
  2%, 6% { transform: rotate(-15deg); }
  4%, 8% { transform: rotate(15deg); }
}

.hotline-badge:hover {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15) 0%, rgba(99, 102, 241, 0.12) 100%);
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.2);
  transform: scale(1.02);
}

.modal-hotline-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.modal-hotline-note strong {
  color: var(--text-primary);
}

.modal-hotline-note svg {
  width: 14px;
  height: 14px;
  color: var(--apple-blue);
}

.modal-hotline-note:hover {
  color: var(--apple-blue);
}

.file-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ==========================================================================
   Apple Task Cards & Squircles (Professional Native Feel)
   ========================================================================== */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.apple-task-card {
  position: relative;
  background: var(--bg-card-item);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-item);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

/* Pointer Down Feedback (Zero-Latency Emil Kowalski Principle) */
.apple-task-card:hover {
  background: var(--bg-card-item-hover);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-item-hover);
}

#taskBtn_sub:hover {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 12px 28px -4px rgba(239, 68, 68, 0.14), 0 0 0 1px rgba(239, 68, 68, 0.25);
}

#taskBtn_like:hover {
  border-color: rgba(244, 63, 94, 0.35);
  box-shadow: 0 12px 28px -4px rgba(244, 63, 94, 0.14), 0 0 0 1px rgba(244, 63, 94, 0.25);
}

#taskBtn_comment:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 12px 28px -4px rgba(59, 130, 246, 0.14), 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.apple-task-card:active {
  transform: scale(0.982);
}

/* Energetic 8s Loading Bar with Moving Laser Stream */
.card-loading-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}

[data-theme="dark"] .card-loading-track {
  background: rgba(255, 255, 255, 0.08);
}
  z-index: 6;
  overflow: hidden;
}

.card-loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff3b30 0%, #f59e0b 25%, #38bdf8 50%, #10b981 75%, #ff3b30 100%);
  background-size: 200% 100%;
  border-radius: var(--radius-full);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.85);
  animation: energyStream 1.5s linear infinite;
  transition: width 0.1s linear;
}

@keyframes energyStream {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.apple-task-card.is-loading {
  cursor: wait;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 24px -2px rgba(56, 189, 248, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  animation: pulseCardLoading 1.6s ease-in-out infinite alternate;
}

@keyframes pulseCardLoading {
  0% { transform: scale(1); }
  100% { transform: scale(1.008); box-shadow: 0 0 28px -1px rgba(56, 189, 248, 0.5); }
}

/* Completed State with Spring Pop */
.apple-task-card.is-completed {
  background: var(--card-completed-bg);
  border-color: var(--apple-emerald-border);
  box-shadow: var(--shadow-item), 0 0 20px -5px rgba(16, 185, 129, 0.25);
  cursor: default;
  animation: completePop 0.4s var(--spring-bounce);
}

@keyframes completePop {
  0% { transform: scale(0.97); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.apple-task-card.is-completed .card-loading-bar {
  display: none;
}

/* Inner Layout */
.task-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 14px;
}

.task-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

/* Apple Squircle Icon Badges */
.squircle-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 3px 10px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.apple-task-card:hover .squircle-badge {
  transform: scale(1.05);
}

/* Official YouTube Red Gradient */
.badge-youtube {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
}

/* Apple Crimson / Like Gradient */
.badge-like {
  background: linear-gradient(135deg, #ff2d55 0%, #ff375f 100%);
}

/* Apple Indigo / Comment Gradient */
.badge-comment {
  background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
}

.svg-icon {
  width: 22px;
  height: 22px;
}

/* Typography */
.task-text-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.task-title {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.3;
}

.task-subtext {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Apple Action Pill Button */
.apple-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-glass-hover);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.apple-task-card:hover .apple-action-pill {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.apple-action-pill svg {
  width: 14px;
  height: 14px;
}

/* Countdown Badge Inside Action Pill */
.pill-countdown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--apple-amber-subtle);
  border: 1px solid rgba(255, 149, 0, 0.3);
  color: #d97706;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .pill-countdown {
  color: #fbbf24;
}

.pill-countdown svg {
  width: 13px;
  height: 13px;
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Completed Green Badge */
.pill-completed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  background: #34c759;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(52, 199, 89, 0.35);
  animation: springPop 0.35s var(--spring-bounce) forwards;
}

.pill-completed svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.8;
}

@keyframes springPop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Progress Section
   ========================================================================== */

.progress-section {
  margin-bottom: 22px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.progress-title {
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-fraction {
  color: var(--text-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.progress-bar-track {
  height: 7px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .progress-bar-track {
  background: rgba(255, 255, 255, 0.12);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #007aff 0%, #34c759 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--spring-ease);
}

/* ==========================================================================
   Apple Unlock Button
   ========================================================================== */

.unlock-action-area {
  display: flex;
  flex-direction: column;
}

.apple-unlock-btn {
  width: 100%;
  border: none;
  outline: none;
  border-radius: var(--radius-md);
  padding: 15px 22px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

/* Locked Disabled Style */
.apple-unlock-btn.is-locked {
  background: var(--bg-glass-active);
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-lock-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-lock-icon-wrap svg {
  width: 18px;
  height: 18px;
}

/* Active Unlocked Style with Radiant Shockwave Glow */
.apple-unlock-btn.is-unlocked {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  animation: shockwavePulse 2s infinite ease-in-out;
}

.apple-unlock-btn.is-unlocked:hover {
  background: linear-gradient(180deg, #34d399 0%, #047857 100%);
}

.apple-unlock-btn.is-unlocked:active {
  transform: scale(0.98);
}

@keyframes shockwavePulse {
  0% {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4), 0 0 0 0 rgba(16, 185, 129, 0.65);
  }
  50% {
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.8), 0 0 0 14px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4), 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Footer */
.footer-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.footer-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   Apple Sheet Modal
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--spring-ease);
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  transform: scale(0.94) translateY(15px);
  transition: transform 0.35s var(--spring-bounce);
}

.modal-backdrop.is-open .modal-container {
  transform: scale(1) translateY(0);
}

.modal-card {
  width: 100%;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-medium);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35), var(--border-specular);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.success-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.success-pill svg {
  width: 14px;
  height: 14px;
}

.modal-heading {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-top: 8px;
}

.modal-subheading {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.download-preview-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.preview-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.preview-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.preview-badge {
  font-size: 0.75rem;
  color: #16a34a;
  font-weight: 600;
}

.download-button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.final-direct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.final-direct-btn:hover {
  background: linear-gradient(180deg, #34d399 0%, #047857 100%);
}

.final-direct-btn:active {
  transform: scale(0.97);
}

.final-direct-btn svg {
  width: 18px;
  height: 18px;
}

.final-buy-btn {
  border: 1.5px solid rgba(0, 113, 227, 0.25);
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.08) 0%, rgba(0, 113, 227, 0.03) 100%);
  color: var(--apple-blue);
  font-weight: 700;
  font-size: 0.94rem;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.12);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.final-buy-btn:hover {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.35);
}

.final-buy-btn:active {
  transform: scale(0.97);
}

.final-buy-btn svg {
  width: 17px;
  height: 17px;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  background: var(--bg-primary);
}

.apple-btn-secondary {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.apple-btn-secondary:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

/* ==========================================================================
   Sonner Toast Notification
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 380px;
}

.sonner-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  box-shadow: 0 14px 35px -5px rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  animation: sonnerSlideUp 0.32s var(--spring-bounce) forwards;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sonner-toast.is-leaving {
  opacity: 0;
  transform: scale(0.9) translateY(10px);
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast-icon.success { color: #16a34a; }
.toast-icon.info { color: var(--apple-blue); }
.toast-icon.warning { color: var(--apple-amber); }

@keyframes sonnerSlideUp {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive Mobile Optimization (Phones & Small Tablets) */
@media (max-width: 600px) {
  .navbar-content {
    padding: 10px 16px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .main-wrapper {
    padding: 16px 12px max(32px, env(safe-area-inset-bottom));
  }

  .apple-card {
    padding: 24px 16px 22px;
    border-radius: var(--radius-lg);
    transform: none !important;
  }

  .card-header-centered {
    margin-bottom: 20px;
  }

  .file-title {
    font-size: 1.32rem;
    line-height: 1.3;
  }

  .hotline-badge {
    font-size: 0.78rem;
    padding: 5px 12px;
    width: 100%;
    justify-content: center;
  }

  .task-list {
    gap: 10px;
    margin-bottom: 20px;
  }

  .task-card-inner {
    padding: 12px 14px;
    gap: 10px;
  }

  .squircle-badge {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .task-title {
    font-size: 0.92rem;
  }

  .task-subtext {
    font-size: 0.74rem;
  }

  .apple-action-pill,
  .pill-countdown,
  .pill-completed {
    padding: 5px 11px;
    font-size: 0.78rem;
  }

  .apple-unlock-btn {
    padding: 14px 18px;
    font-size: 0.95rem;
  }

  .modal-container {
    max-width: 95%;
  }

  .modal-card {
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 18px 20px;
  }

  .modal-body {
    padding: 18px 20px;
  }
}

/* VIP Direct Link Button Under Unlock */
.vip-direct-link {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: var(--apple-blue);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.vip-direct-link:hover {
  background: rgba(2, 132, 199, 0.14);
  transform: translateY(-1px);
}

.vip-direct-link:active {
  transform: scale(0.98);
}
