/**
 * GoldLedger Base & Mobile Shell Styles
 * مجوهرات السعادة
 */

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

html {
  font-family: var(--font-arabic);
  font-size: 16px; /* Strict >= 16px to prevent iOS auto-zoom */
  line-height: 1.5;
  background-color: #060911;
  color: var(--text-primary);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #060911;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(217, 119, 6, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(15, 23, 42, 0.8) 0%, transparent 70%);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Allow text selection in inputs and notes */
input, textarea, .selectable {
  user-select: text;
  -webkit-user-select: text;
}

/* Desktop Mobile Simulator Container */
.app-wrapper {
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 100vh;
  background-color: var(--bg-canvas);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(245, 158, 11, 0.15);
}

@media (min-width: 520px) {
  body {
    padding: 16px;
  }
  .app-wrapper {
    height: 94vh;
    border-radius: 28px;
    border: 1.5px solid rgba(245, 158, 11, 0.25);
    box-shadow: 
      0 20px 60px -10px rgba(0, 0, 0, 0.9),
      0 0 0 1px rgba(255, 255, 255, 0.05),
      0 0 40px -10px rgba(217, 119, 6, 0.15);
  }
}

/* Main Scrollable Viewport */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(var(--nav-height) + var(--safe-bottom) + 20px) 16px;
  scroll-behavior: smooth;
}

/* Custom Sleek Scrollbar */
.app-content::-webkit-scrollbar {
  width: 4px;
}
.app-content::-webkit-scrollbar-track {
  background: transparent;
}
.app-content::-webkit-scrollbar-thumb {
  background: var(--border-muted);
  border-radius: var(--radius-full);
}

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

.font-digits {
  font-family: var(--font-digits);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Tab Navigation (Pinned Bottom) */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(17, 24, 39, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.nav-tab-btn {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  font-weight: 600;
  gap: 4px;
  position: relative;
}

.nav-tab-btn .nav-icon {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.nav-tab-btn.active {
  color: var(--gold-400);
}

.nav-tab-btn.active .nav-icon {
  transform: translateY(-2px) scale(1.1);
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.4));
}

.nav-tab-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 48px;
  height: 3px;
  background: var(--gold-gradient);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.6);
}

.nav-tab-btn:active {
  transform: scale(0.96);
}
