/* shared/theme.css — Common styles extracted from inline page styles */

/* CSS Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Body defaults */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--tg-theme-bg-color, #ffffff);
  color: var(--tg-theme-text-color, #000000);
  min-height: 100vh;
}

/* Pages with bottom nav need padding to avoid content hidden behind the bar */
body.has-nav {
  padding-bottom: 70px;
}

/* Loading Screen */
.loading-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh; gap: 16px;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--tg-theme-hint-color, #999);
  border-top-color: var(--tg-theme-button-color, #3390ec);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.loading-text { font-size: 14px; color: var(--tg-theme-hint-color, #999); }

/* Spin Animation */
@keyframes spin { to { transform: rotate(360deg); } }

/* Error Screen */
.error-screen {
  display: none; text-align: center; padding: 24px; max-width: 320px;
  margin: 0 auto; min-height: 80vh; flex-direction: column;
  align-items: center; justify-content: center;
}
.error-screen.visible { display: flex; }
.error-icon { font-size: 48px; margin-bottom: 12px; }
.error-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.error-message {
  font-size: 14px; color: var(--tg-theme-hint-color, #999);
  margin-bottom: 20px; line-height: 1.4;
}
.retry-btn {
  display: inline-block; padding: 12px 32px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  background-color: var(--tg-theme-button-color, #3390ec);
  color: var(--tg-theme-button-text-color, #fff);
  transition: opacity 0.2s ease;
}
.retry-btn:active { opacity: 0.8; }

/* Empty State */
.empty-state {
  display: none; text-align: center; padding: 48px 24px; max-width: 320px;
  margin: 0 auto; flex-direction: column; align-items: center;
}
.empty-state.visible { display: flex; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-text { font-size: 14px; color: var(--tg-theme-hint-color, #999); line-height: 1.4; }

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: 60px;
  display: flex; align-items: center; justify-content: space-around;
  background-color: var(--tg-theme-bg-color, #fff);
  border-top: 1px solid var(--tg-theme-hint-color, rgba(0,0,0,0.1));
  z-index: 50;
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; border: none; background: none;
  cursor: pointer; padding: 6px 12px; min-width: 56px;
  transition: opacity 0.2s ease; position: relative;
}
.nav-btn:active { opacity: 0.7; }
.nav-btn svg { width: 24px; height: 24px; }
.nav-btn span { font-size: 10px; font-weight: 500; }
.nav-btn.active svg { fill: var(--tg-theme-button-color, #3390ec); }
.nav-btn.active span { color: var(--tg-theme-button-color, #3390ec); }
.nav-btn:not(.active) svg { fill: var(--tg-theme-hint-color, #999); }
.nav-btn:not(.active) span { color: var(--tg-theme-hint-color, #999); }
.nav-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background-color: var(--tg-theme-button-color, #3390ec);
  color: var(--tg-theme-button-text-color, #fff);
  font-size: 10px; font-weight: 700; line-height: 16px;
  text-align: center; padding: 0 4px;
}
