@import url('./design-tokens.css');

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--color-text-primary);
}

.app-shell__header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(var(--space-6) + env(safe-area-inset-top)) var(--space-6) var(--space-4);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.75) 60%, rgba(255, 255, 255, 0) 100%);
  backdrop-filter: blur(16px);
}

.app-shell__header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.app-shell__brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-shell__brand-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
}

.app-shell__brand-subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.app-shell__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.app-shell__main {
  flex: 1;
  padding: var(--space-4) var(--space-6) calc(var(--space-12) + 70px) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.app-shell__section-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-4);
}

.app-shell__bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: var(--space-4) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(60, 80, 110, 0.12);
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  border: 1px solid transparent;
  transition: background var(--duration-normal) var(--easing-standard), color var(--duration-normal) var(--easing-standard), border-color var(--duration-normal) var(--easing-standard);
  text-align: center;
  line-height: 1.15;
}

.bottom-nav__item-text {
  display: block;
}

.bottom-nav__item-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  background: rgba(82, 113, 189, 0.1);
}

.bottom-nav__item.is-active {
  color: var(--color-text-primary);
  background: rgba(47, 181, 179, 0.12);
  border-color: rgba(47, 181, 179, 0.28);
}

.bottom-nav__item.is-active .bottom-nav__item-icon {
  background: var(--gradient-accent);
  color: var(--color-text-inverse);
}

.bottom-nav__item--featured {
  position: relative;
  background: rgba(95, 225, 214, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 24px rgba(95, 225, 214, 0.2);
  color: var(--color-text-primary);
}

.bottom-nav__featured-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--gradient-accent);
  color: var(--color-text-inverse);
  margin-bottom: var(--space-1);
  box-shadow: var(--shadow-glow-accent);
}

.app-shell__floating-action {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom));
  right: var(--space-6);
  z-index: 38;
}

.floating-action-button {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--gradient-highlight);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-glow-highlight);
}

.app-shell__scroll-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

@media (min-width: 960px) {
  .app-shell {
    max-width: 420px;
    margin: 0 auto;
    border-left: 1px solid rgba(148, 163, 184, 0.08);
    border-right: 1px solid rgba(148, 163, 184, 0.08);
    min-height: 100vh;
  }

  .app-shell__bottom-nav {
    max-width: 420px;
    margin: 0 auto;
  }

  .app-shell__header {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }

  .app-shell__floating-action {
    right: calc(50% - 210px + var(--space-6));
  }
}
.app-shell__bottom-nav {
  width: 100%;
}

@media (max-width: 640px) {
  .bottom-nav {
    gap: 10px;
  }

  .bottom-nav__item {
    font-size: 10px;
    padding-inline: var(--space-2);
  }
}

@media (max-width: 380px) {
  .bottom-nav__item {
    padding-inline: var(--space-1);
  }

  .bottom-nav__item-text {
    font-size: 9px;
  }
}
