/* ============================================================
   PORTUCALE Club — index.css (v8 final)
   ============================================================ */

:root {
  /* Light theme */
  --color-background-primary: #ffffff;
  --color-background-secondary: #f5f5f4;
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #6b6b6b;
  --color-text-tertiary: #a3a3a3;
  --color-border-tertiary: #e5e5e5;
  --color-border-secondary: #d4d4d4;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Brand */
  --pano-blue: #185FA5;
  --pano-blue-light: #E6F1FB;
  --pano-blue-dark: #0C447C;
  --pano-green: #0F6E56;
  --pano-green-light: #E1F5EE;
  --pano-green-dark: #085041;
  --pano-red: #E24B4A;
  --pano-red-light: #FCEBEB;
  --pano-yellow: #EF9F27;
  --pano-yellow-light: #FAEEDA;
  --pano-purple: #534AB7;
  --pano-purple-light: #EEEDFE;

  /* Typography scale — consistent sizing, larger for mobile readability */
  --font-xs: 11px;
  --font-sm: 13px;
  --font-base: 15px;
  --font-md: 17px;
  --font-lg: 20px;
  --font-xl: 24px;

  /* Layout */
  --navbar-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-background-primary: #1a1a1a;
    --color-background-secondary: #2a2a2a;
    --color-text-primary: #f0f0f0;
    --color-text-secondary: #a0a0a0;
    --color-text-tertiary: #666666;
    --color-border-tertiary: #333333;
    --color-border-secondary: #444444;
  }
}

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

html, body {
  font-family: var(--font-sans);
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
  font-size: var(--font-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  /* Lock the viewport height for mobile so the navbar can sit at the bottom reliably */
  min-height: 100dvh;
  /* Use safe area for top notch */
  padding-top: var(--safe-top);
  padding-bottom: 0; /* nav bar handles its own safe-bottom */
}

#root {
  min-height: 100dvh;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: var(--font-sm);
}

/* Hint to mobile browsers: keep zoom locked-in for inputs (prevents iOS auto-zoom on focus when font<16px) */
@media (max-width: 600px) {
  input, select, textarea {
    font-size: 16px; /* iOS zoom-on-focus threshold */
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* App container — gives nav bar room to be fixed at bottom */
.app-card {
  background: var(--color-background-primary);
  font-family: var(--font-sans);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  /* leave space at bottom for the fixed nav bar (and iOS home-bar inset) */
  padding-bottom: calc(var(--navbar-height) + var(--safe-bottom));
}

/* Inner content area (everything above the navbar) */
.app-content {
  padding: 16px;
  padding-bottom: 24px;
}

/* Nav bar pinned to the bottom of the viewport */
.app-navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--navbar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--color-background-primary);
  border-top: 1px solid var(--color-border-tertiary);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 8px;
  z-index: 100;
  /* On wide screens the card has max-width:480; align navbar with that */
  max-width: 480px;
  margin: 0 auto;
}

.app-navbar .nav-item {
  text-align: center;
  cursor: pointer;
  flex: 1;
  padding: 4px 2px;
}

.app-navbar .nav-item .nav-icon {
  font-size: 22px;
  display: block;
  line-height: 1;
}

.app-navbar .nav-item .nav-label {
  font-size: var(--font-xs);
  margin-top: 4px;
}
