/* ─────────────────────────────────────────────────────────────────
   mobile_app.css - Premium Mobile Dashboard UI
   ───────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* Hide desktop-only elements */
  .desktop-only {
    display: none !important;
  }

  /* Bottom Navigation Bar */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
  }

  .nav-item img {
    width: 22px;
    height: 22px;
    opacity: 0.6;
    transition: all 0.2s ease;
  }

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

  .nav-item.active img {
    opacity: 1;
    filter: none;
  }

  /* Floating Action Button (FAB) */
  .fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    border: none;
    cursor: pointer;
    z-index: 999;
    transition: all 0.2s ease;
  }

  .fab:active {
    transform: scale(0.9);
  }

  /* Hero Section Restacking */
  .hero-card {
    padding: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    min-height: auto !important;
    gap: 20px !important;
  }

  .hero-card-bg,
  .hero-card-fog,
  .hero-card-particles {
    border-radius: inherit;
  }

  .hero-card-content {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  .hero-card-copy {
    max-width: 100% !important;
  }

  .hero-card-image {
    position: relative !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    margin-top: 20px !important;
    opacity: 1 !important;
    border-radius: 12px !important;
    order: 3;
  }

  .hero-card-title {
    font-size: 1.6rem !important;
    max-width: 100% !important;
    margin-bottom: 8px !important;
  }

  .hero-card-text {
    font-size: 0.95rem !important;
    max-width: 100% !important;
  }

  .hero-card-action {
    width: 100% !important;
    margin-top: 10px !important;
    justify-content: center !important;
    order: 2;
  }

  /* Horizontal Filter Tabs */
  .view-tabs {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    gap: 8px !important;
    padding-bottom: 15px !important;
    margin-bottom: 10px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .view-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 80px !important;
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
  }

  /* Spacing Reset */
  .views-container {
    padding: 16px !important;
    padding-bottom: 120px !important; /* Extra space to clear Bottom Nav and FAB */
  }

  section, .tab-content > div, .stats-grid, #todaysPlanSection, #growthActionSection, .analytics-grid, .accounts-grid {
    margin-bottom: 24px !important;
  }

  .analytics-highlight-grid,
  .analytics-metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Performance Overview specific sizing */
  .analytics-card .metric-value {
    font-size: 1.2rem !important;
  }

  /* Card Widths */
  .card, .stat-card, .insight-card {
    width: 100% !important;
    margin-bottom: 16px !important;
  }

  /* Adjust Topbar for Mobile */
  .topbar {
    padding: 0 16px !important;
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    background: white !important;
  }
}

@media (min-width: 769px) {
  .mobile-bottom-nav, .fab {
    display: none !important;
  }
}
