:root {
  /* iOS System Colors - Light Mode */
  --system-background: #f2f2f7;
  --secondary-system-background: #ffffff;
  --tertiary-system-background: #f9f9fb;
  --label: #000000;
  --secondary-label: #3c3c4399;
  --tertiary-label: #3c3c434d;
  
  --ios-blue: #007aff;
  --ios-blue-rgb: 0, 122, 255;
  --ios-purple: #af52de;
  --ios-red: #ff3b30;
  --ios-green: #34c759;
  --ios-orange: #ff9500;
  --ios-teal: #5ac8fa;
  --ios-indigo: #5856d6;
  
  --separator: #c6c6c8;
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  
  --radius-lg: 16px;
  --radius-md: 12px;
  --max-w: 680px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* iOS System Colors - Dark Mode */
    --system-background: #000000;
    --secondary-system-background: #1c1c1e;
    --tertiary-system-background: #2c2c2e;
    --label: #ffffff;
    --secondary-label: #ebebf599;
    --tertiary-label: #ebebf54d;
    
    --ios-blue: #0a84ff;
    --ios-blue-rgb: 10, 132, 255;
    --ios-purple: #bf5af2;
    --ios-red: #ff453a;
    --ios-green: #30d158;
    --ios-orange: #ff9f0a;
    --ios-teal: #64d2ff;
    --ios-indigo: #5e5ce6;
    
    --separator: #38383a;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--system-background);
  color: var(--label);
  line-height: 1.5;
  padding: 0 0 48px 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  background: var(--ios-blue);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-md);
  z-index: 9999;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Container */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation / Breadcrumb */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 16px;
}
.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ios-blue);
  font-weight: 500;
  text-decoration: none;
  font-size: 17px;
  transition: opacity 0.15s ease;
}
.nav-back:hover {
  opacity: 0.7;
}

/* Reusable Header style based on Homescreen UI */
.header-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
  margin-bottom: 24px;
  text-align: left;
}

/* Brand/Logo using Gradient Style */
.broadcast-gradient {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #007aff, #af52de);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", sans-serif;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-img {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.header-subtitle {
  font-size: 16px;
  color: var(--secondary-label);
  margin: 0;
  font-weight: 400;
}

/* Welcome Card (Production Architecture) */
.welcome-card {
  background-color: rgba(var(--ios-blue-rgb), 0.08);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid rgba(var(--ios-blue-rgb), 0.12);
}

.welcome-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ios-blue);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.welcome-header svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.welcome-body {
  font-size: 13px;
  color: var(--secondary-label);
  margin: 0;
  line-height: 1.4;
}

/* Cards Section - SwiftUI rounded list look */
.cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.menu-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--secondary-system-background);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-decoration: none;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease;
  border: 1px solid transparent;
}

.menu-card:hover {
  transform: scale(1.02);
  background-color: var(--tertiary-system-background);
}

.menu-card:active {
  transform: scale(0.99);
}

.icon-wrapper {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-wrapper svg {
  width: 26px;
  height: 26px;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
  text-align: left;
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--label);
  margin: 0;
}

.card-subtitle {
  font-size: 13px;
  color: var(--secondary-label);
  margin: 0;
  line-height: 1.3;
}

.chevron-right {
  color: var(--tertiary-label);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.menu-card:hover .chevron-right {
  transform: translateX(3px);
  color: var(--secondary-label);
}

/* Content Sections */
.detail-section {
  background-color: var(--secondary-system-background);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}

.detail-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--label);
}

.detail-section p {
  color: var(--secondary-label);
  font-size: 15px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pill-item {
  background-color: var(--system-background);
  color: var(--label);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--separator);
}

.grid-two-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 600px) {
  .grid-two-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.grid-card {
  background-color: var(--tertiary-system-background);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--separator);
}

.grid-card ul {
  margin: 0;
  padding-left: 20px;
}

.grid-card li {
  font-size: 14px;
  color: var(--secondary-label);
  margin-bottom: 8px;
}

.grid-card li:last-child {
  margin-bottom: 0;
}

.link-highlight {
  color: var(--ios-blue);
  text-decoration: none;
  font-weight: 500;
}

.link-highlight:hover {
  text-decoration: underline;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--label);
}

input, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--separator);
  background-color: var(--tertiary-system-background);
  color: var(--label);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus {
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(var(--ios-blue-rgb), 0.25);
}

button {
  background-color: var(--ios-blue);
  color: #ffffff;
  border: none;
  font-size: 17px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 12px rgba(var(--ios-blue-rgb), 0.3);
}

button:hover {
  opacity: 0.9;
}

button:active {
  transform: scale(0.98);
}

.form-status {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  min-height: 20px;
}

.success-message {
  color: var(--ios-green);
}

.error-message {
  color: var(--ios-red);
}

/* Image style */
.image-showcase {
  text-align: center;
  margin-top: 24px;
}

.image-showcase img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--separator);
}

/* Footer */
footer {
  text-align: center;
  padding: 24px 0;
  font-size: 12px;
  color: var(--secondary-label);
  border-top: 1px solid var(--separator);
  margin-top: 48px;
}

/* Focus Visible Accessibility */
:focus-visible {
  outline: 3px solid var(--ios-blue);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
