/* ============================================
   CHIROGUN PORTAL — iOS-Native Redesign Patch
   Inter Font + Bottom Tab Bar + Safe Areas
   v1.0 — 26.05.2026
   ============================================ */

/* === FONT OVERRIDE: Inter überall === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

body,
.header-logo,
.user-name-badge,
.role-badge,
.logout-btn,
.hero-label, .hero-sport,
.stat-label, .stat-sub,
.section-title, .section-sub,
.form-label, .form-input, .form-hint, .form-divider,
.auth-logo, .auth-sub,
.auth-tab, .role-tab,
.auth-btn,
.auth-error, .auth-success,
.copy-card-label, .copy-card-value,
.empty-state, .loading,
.upload-grid *, .drive-grid *,
.date-filter-range, .date-filter-preset,
.photo-upload-title, .photo-upload-sub, .photo-upload-status,
.stripe-banner-label, .stripe-banner-title, .stripe-banner-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Tabular Nums für Numbers/Codes (looks like Mono but sharper) */
.stat-value,
.copy-card-value,
#aff-code,
#aff-link,
.user-name-badge {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum', 'cv01', 'cv02';
}

/* Stat Values bleiben fett & gross, aber clean */
.stat-value { letter-spacing: -0.02em; }
.hero-name { letter-spacing: -0.03em; }
.auth-title { letter-spacing: -0.02em; }

/* === HEADER REDESIGN: Logo statt Wordmark === */
.header {
  padding: 12px 20px !important;
  padding-top: calc(12px + env(safe-area-inset-top)) !important;
  background: rgba(17, 17, 17, 0.85) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border) !important;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 0 !important; /* Hide old text */
  line-height: 0;
}

.header-logo img.header-logo-img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

/* Hide old Chiro<span>Gun</span> text inside header-logo */
.header-logo > *:not(img) {
  display: none !important;
}

/* === BOTTOM TAB BAR === */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  padding: 8px 0 0 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 1000;
  display: none; /* Hidden until user is logged in */
}

.tab-bar.active {
  display: flex;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px 8px;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
  position: relative;
}

.tab-btn:active {
  background: rgba(200, 245, 71, 0.05);
}

.tab-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.tab-btn span {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}

.tab-btn.active {
  color: var(--accent);
}

.tab-btn.active svg {
  transform: scale(1.08);
}

.tab-btn.active span {
  font-weight: 600;
}

/* === SAFE AREA + MAIN PADDING ADJUST === */
.main {
  padding: 24px 20px calc(100px + env(safe-area-inset-bottom)) !important;
  max-width: 900px !important;
}

/* === TAB CONTENT (Section Show/Hide) === */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.25s ease;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === LOGOUT BUTTON: kleiner, im Header rechts === */
.logout-btn {
  font-size: 11px !important;
  padding: 8px 14px !important;
  letter-spacing: 0.5px !important;
  font-weight: 500 !important;
}

/* User name badge - sauberer Look */
.user-name-badge {
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
}

.role-badge {
  font-size: 9px !important;
  font-weight: 600 !important;
  letter-spacing: 1px !important;
  padding: 4px 10px !important;
  border-radius: 4px;
}

/* === HERO: kompakter, da Hero-Image weg === */
.hero {
  margin-bottom: 24px !important;
}

.hero-name {
  font-size: 32px !important;
  font-weight: 700 !important;
}

.hero-label {
  font-size: 11px !important;
  letter-spacing: 2px !important;
  font-weight: 500 !important;
}

/* === SECTIONS: leicht polish === */
.section {
  border-radius: 12px;
  overflow: hidden;
}

.section-title {
  font-size: 14px !important;
  letter-spacing: 0.5px !important;
  font-weight: 600 !important;
}

.section-sub {
  font-size: 11px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* === FORM INPUTS: cleaner === */
.form-input {
  font-size: 14px !important;
  letter-spacing: 0 !important;
  border-radius: 8px;
}

.form-label {
  font-size: 11px !important;
  letter-spacing: 1px !important;
  font-weight: 500 !important;
}

/* === BUTTONS: subtle iOS feel === */
.auth-btn {
  font-size: 13px !important;
  letter-spacing: 0.5px !important;
  font-weight: 600 !important;
  border-radius: 10px;
  min-height: 44px; /* Apple HIG min tap target */
}

/* === STAT CARDS: rounded === */
.stat-card {
  border-radius: 12px;
}

.stat-label {
  font-size: 10px !important;
  letter-spacing: 1px !important;
  font-weight: 500 !important;
}

/* === MOBILE OPTIMIZATIONS === */
@media (max-width: 600px) {
  .main { padding: 16px 16px calc(100px + env(safe-area-inset-bottom)) !important; }
  .hero-name { font-size: 26px !important; }
  .stats-grid { gap: 12px !important; }
  .stat-card { padding: 16px !important; }
  .stat-value { font-size: 22px !important; }
  .header { padding: 10px 16px !important; padding-top: calc(10px + env(safe-area-inset-top)) !important; }
  .user-name-badge { display: none; }
}

/* === AUTH SCREEN: Safe areas === */
.auth-screen {
  padding-top: calc(24px + env(safe-area-inset-top)) !important;
  padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important;
}
/* ============================================
/* ============================================
/* ============================================
/* ============================================
   CSS Patch v2.3
   - iOS Input Zoom prevention (16px min)
   - Healthy gap for external sections (24px)
   ============================================ */

/* === FIX 1: iOS Input Auto-Zoom === */
input,
textarea,
select,
.form-input,
.auth-input {
  font-size: 16px !important;
}

/* === FIX 2: External body-level sections === */

/* Hide by default */
#global-statements-zone,
#global-danger-zone {
  display: none !important;
}

/* Show Statements ONLY on Payouts tab */
body[data-current-tab="payouts"] #global-statements-zone {
  display: block !important;
  max-width: 900px;
  margin: 24px auto 0 auto !important;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important;
}

/* Show Gefahrenzone ONLY on Settings tab */
body[data-current-tab="settings"] #global-danger-zone {
  display: block !important;
  max-width: 900px;
  margin: 24px auto 0 auto !important;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important;
}

/* Reduce main bottom padding when external sections show */
body[data-current-tab="payouts"] .main,
body[data-current-tab="settings"] .main {
  padding-bottom: 8px !important;
}

/* Mobile */
@media (max-width: 600px) {
  body[data-current-tab="payouts"] #global-statements-zone,
  body[data-current-tab="settings"] #global-danger-zone {
    padding-left: 16px;
    padding-right: 16px;
    margin-top: 20px !important;
  }
}
