/* Google Fonts: Vazirmatn & JetBrains Mono */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;700&family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

/* CSS Reset & Defaults */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-main);
  direction: rtl;
  text-align: right;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* App Wrapper: Centers on desktop like a sleek mobile web app frame, full width on phones */
.app-container {
  width: 100%;
  max-width: var(--app-max-width);
  min-height: 100vh;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.06);
  padding-bottom: calc(var(--bottom-nav-height) + max(20px, var(--safe-bottom)));
}

.app-container.no-nav {
  padding-bottom: max(32px, var(--safe-bottom));
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--navy-primary);
  font-weight: 700;
  line-height: 1.35;
}

p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

a {
  color: var(--gold-darker);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--gold-primary);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* Prevents auto-zoom in iOS Safari */
}

button {
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
  touch-action: manipulation;
}

/* Utility Helpers */
.text-center { text-align: center; }
.text-gold { color: var(--gold-primary) !important; }
.text-navy { color: var(--navy-primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-gold {
  background: var(--gold-tint);
  color: var(--gold-darker);
  border: 1px solid rgba(239, 169, 64, 0.3);
}

.badge-navy {
  background: var(--navy-tint);
  color: var(--navy-primary);
  border: 1px solid var(--border-light);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

/* German Text styling (LTR inside RTL layout) */
.de-text {
  font-family: var(--font-main);
  direction: ltr;
  display: inline-block;
  font-weight: 600;
  text-align: left;
}
