:root {
  --ios-bg: #F2F2F7;
  --ios-surface: #FFFFFF;
  --ios-surface-2: #F9F9FB;
  --ios-label: #1C1C1E;
  --ios-secondary: #6E6E73;
  --ios-separator: rgba(60, 60, 67, 0.12);
  --ios-accent: #0F766E;
  --ios-accent-soft: rgba(15, 118, 110, 0.10);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  background-color: var(--ios-bg);
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
  background-color: var(--ios-bg);
  color: var(--ios-label);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.022em;
}

/* iOS Frosted Glass */
.ios-glass {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.ios-glass-dark {
  background: rgba(28, 28, 30, 0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* iOS Grouped Cards */
.ios-card {
  background: var(--ios-surface);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.025);
}

.ios-card-interactive {
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s ease;
}

@media (hover: hover) {
  .ios-card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07), 0 2px 6px rgba(0, 0, 0, 0.03);
  }
}

.ios-press {
  transition: transform 0.14s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.14s ease, background-color 0.15s ease;
}
.ios-press:active {
  transform: scale(0.965);
}

/* iOS Segmented Control */
.ios-segmented {
  background: rgba(118, 118, 128, 0.12);
  padding: 3px;
  border-radius: 13px;
}

.ios-seg-btn {
  border-radius: 10px;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.ios-seg-active {
  background: #FFFFFF;
  color: #1C1C1E;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10), 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Desktop Sidebar Active State */
.sidebar-item-active {
  background: #0F766E !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.28);
}

/* Mobile Bottom Tab Bar */
.mobile-tab-bar {
  padding-bottom: max(0.5rem, var(--safe-bottom));
}

.mobile-tab-active {
  color: #0F766E !important;
}

.mobile-tab-active .tab-icon-wrap {
  background: rgba(15, 118, 110, 0.12);
}

/* Safe area spacing */
.mobile-top-safe {
  padding-top: max(0.65rem, var(--safe-top));
}

.main-bottom-safe {
  padding-bottom: calc(6rem + var(--safe-bottom));
}

@media (min-width: 1024px) {
  .main-bottom-safe {
    padding-bottom: 3rem;
  }
}

/* iOS Native Switch */
.ios-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 28px;
  border-radius: 9999px;
  background: #D1D1D6;
  position: relative;
  cursor: pointer;
  transition: background-color 0.22s ease;
  flex-shrink: 0;
}

.ios-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #FFFFFF;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ios-switch:checked {
  background: #0F766E;
}

.ios-switch:checked::after {
  transform: translateX(18px);
}

/* Circular iOS Checklist Checkbox */
.ios-check {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 2px solid #C7C7CC;
  background: #FFFFFF;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.ios-check::before {
  content: '';
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  background-color: #FFFFFF;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.ios-check:checked {
  background: #0F766E;
  border-color: #0F766E;
}

.ios-check:checked::before {
  transform: scale(1);
}

/* Bottom Sheet Animation */
.ios-sheet-backdrop {
  animation: fadeInBackdrop 0.2s ease-out;
}

.ios-sheet-panel {
  animation: slideUpSheet 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 640px) {
  .ios-sheet-panel {
    animation: scaleInModal 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

.ios-drawer-panel {
  animation: slideInRight 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUpSheet {
  from { transform: translateY(36px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleInModal {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(36px); opacity: 0.7; }
  to { transform: translateX(0); opacity: 1; }
}

/* Hide scrollbars on horizontal iOS pills */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Subtle custom scrollbars for desktop sheets */
.custom-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 9999px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}
