/* Habit Tracker — Mobile Responsive & Bottom Nav Layout (css/layout.css) */

.app-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-4);
  background-color: var(--bg-app);
}

.phone-frame {
  width: 100%;
  max-width: 440px;
  min-height: 840px;
  height: 100%;
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 95px !important; /* Prevent content from hiding behind tab bar */
  -webkit-overflow-scrolling: touch;
}

/* Mobile & PWA Full Screen Responsive Adaptations */
@media screen and (max-width: 768px) {
  .app-wrapper {
    padding: 0 !important;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100dvh;
    width: 100vw;
  }

  .phone-frame {
    max-width: 100% !important;
    width: 100vw !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .tab-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 75px !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    background-color: var(--bg-card, #FFFFFF) !important;
    border-top: 1px solid var(--border-color, #E5E7EB) !important;
    z-index: 9999 !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
  }

  .fab-btn {
    position: fixed !important;
    bottom: calc(85px + env(safe-area-inset-bottom, 0px)) !important;
    right: 20px !important;
    z-index: 9998 !important;
  }
}
