/* Blue Shift - Layout & Navigation */

/* ===== App Shell ===== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: var(--max-width-desktop);
  margin: 0 auto;
  position: relative;
}

/* ===== Top Header ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  padding-top: calc(var(--safe-area-top) + var(--space-3));
  min-height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(var(--glass-blur-heavy));
  -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
  border-bottom: 1px solid var(--nav-border);
}
.app-header-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}
.app-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.app-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  color: var(--accent);
}
.app-logo svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ===== Main Content Area ===== */
.app-content {
  flex: 1;
  padding: var(--space-4);
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + var(--space-4));
  overflow-y: auto;
}

/* ===== Bottom Navigation (mobile) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background: var(--nav-bg);
  backdrop-filter: blur(var(--glass-blur-heavy));
  -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
  border-top: 1px solid var(--nav-border);
  max-width: var(--max-width-desktop);
  margin: 0 auto;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-1) var(--space-2);
  min-width: 3.5rem;
  min-height: 2.75rem;
  color: var(--nav-item);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg {
  width: 1.375rem;
  height: 1.375rem;
  transition: all var(--transition-fast);
}
.nav-item.active {
  color: var(--nav-item-active);
}
.nav-item.active svg {
  filter: drop-shadow(0 0 4px var(--accent));
}
.nav-item:active {
  transform: scale(0.92);
}

/* Bouton central + */
.nav-item-add {
  position: relative;
  bottom: 6px;
}
.nav-item-add .nav-add-btn {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.4);
  transition: all var(--transition-fast);
}
.nav-item-add .nav-add-btn:active {
  transform: scale(0.9);
}
.nav-item-add .nav-add-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ===== Desktop sidebar (> 1024px) ===== */
@media (min-width: 1024px) {
  .app {
    flex-direction: row;
  }
  .bottom-nav {
    position: sticky;
    top: 0;
    bottom: auto;
    left: 0;
    flex-direction: column;
    width: 5rem;
    height: 100vh;
    height: 100dvh;
    border-top: none;
    border-right: 1px solid var(--nav-border);
    padding: var(--space-6) var(--space-2);
    gap: var(--space-2);
    justify-content: flex-start;
  }
  .nav-item-add {
    bottom: 0;
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
  }
  .app-content {
    padding-bottom: var(--space-4);
    flex: 1;
    min-width: 0;
  }
}

/* ===== Page transitions ===== */
.view {
  display: none;
  animation: fadeIn 200ms ease;
}
.view.active {
  display: block;
}
.view-enter {
  animation: fadeInUp 250ms ease;
}

/* ===== Grid layouts ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .grid-2-tablet { grid-template-columns: 1fr 1fr; }
  .grid-3-tablet { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Section spacing ===== */
.section {
  margin-bottom: var(--space-6);
}
.section:last-child {
  margin-bottom: 0;
}

/* ===== Swipe area ===== */
.swipeable {
  touch-action: pan-y;
  user-select: none;
}
