/* ═══════════════════════════════════════════════════════════════
   ACES Cities Network — Design System
   Replica exacta de AppColors.swift + AppUIStyle.swift iOS
   Tipografía: Inter (equivalente web de SF Pro)
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables — AppColors equivalentes ── */
:root {
  /* Fondos — AppColors.background/Mid/Top */
  --bg:          #080F1E;
  --bg-mid:      #0A1528;
  --bg-top:      #0D1E3A;
  --bg-card:     rgba(12, 30, 62, 0.72);   /* AppColors.surfaceCard */
  --bg-field:    rgba(15, 45, 90, 0.38);   /* AppColors.surfaceField */

  /* Marca ACES */
  --primary:     #0A6EFA;   /* AppColors.primary */
  --primary-dk:  #0646B4;   /* AppColors.primaryDark */
  --cyan:        #00CFC8;   /* AppColors.accentCyan */
  --cyan-dk:     #00A09B;   /* AppColors.accentCyanDark */
  --cyan-glow:   rgba(0, 207, 200, 0.18);
  --cyan-dim:    rgba(0, 207, 200, 0.12);
  --blue-dim:    rgba(10, 110, 250, 0.12);

  /* Texto */
  --text-1:      #FFFFFF;                    /* textPrimary */
  --text-2:      rgba(255,255,255,0.70);     /* textSecondary */
  --text-3:      rgba(255,255,255,0.42);     /* textTertiary */

  /* Bordes */
  --border:      rgba(255,255,255,0.12);     /* surfaceBorder */
  --border-soft: rgba(255,255,255,0.08);

  /* Estados */
  --success:     #22C57A;
  --warning:     #F59E0B;
  --danger:      #EF4444;

  /* Radios — AppUIStyle.corner* */
  --r-sm:  10px;   /* cornerSmall */
  --r-md:  14px;   /* cornerMedium */
  --r-lg:  20px;   /* cornerLarge */

  /* Espaciado */
  --pad:    20px;
  --gap:    12px;

  /* Sidebar */
  --sidebar-w:        240px;
  --sidebar-w-tablet: 64px;
  --topbar-h:         60px;
  --bottomnav-h:      64px;

  /* Tipografía */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;

  /* Transiciones */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
  font-family: var(--font);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Scrollbar dark ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-mid); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ── Background gradient (= screenBackground) ── */
.screen-bg {
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg) 100%);
  min-height: 100vh;
}

/* ── Typography scale — replicando .system(size:weight:) iOS ── */
.text-caption   { font-size: 11px; font-weight: 400; color: var(--text-3); }
.text-caption2  { font-size: 12px; font-weight: 500; color: var(--text-2); }
.text-footnote  { font-size: 13px; font-weight: 400; color: var(--text-2); }
.text-subhead   { font-size: 15px; font-weight: 400; color: var(--text-2); }
.text-body      { font-size: 17px; font-weight: 400; color: var(--text-1); }
.text-callout   { font-size: 16px; font-weight: 400; color: var(--text-1); }
.text-headline  { font-size: 17px; font-weight: 600; color: var(--text-1); }
.text-title3    { font-size: 20px; font-weight: 700; color: var(--text-1); }
.text-title2    { font-size: 22px; font-weight: 700; color: var(--text-1); }
.text-title1    { font-size: 28px; font-weight: 800; color: var(--text-1); }
.text-largetitle { font-size: 34px; font-weight: 800; color: var(--text-1); letter-spacing: -0.02em; }

/* ── Utilities ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-cyan   { color: var(--cyan); }
.text-blue   { color: var(--primary); }
.text-muted  { color: var(--text-2); }
.text-dim    { color: var(--text-3); }
.text-success { color: var(--success); }
.text-warn    { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-bold   { font-weight: 700; }
.text-semibold { font-weight: 600; }
.text-medium { font-weight: 500; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── AppCard ── */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.app-card-tight  { padding: 12px; }
.app-card-loose  { padding: 20px 24px; }

/* ── AppSectionHeader ── */
.section-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
}
.section-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
}
.section-header p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
}

/* ── AppInfoRow ── */
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.info-row:last-child { border-bottom: none; }
.info-row-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--text-3);
}
.info-row-content { flex: 1; min-width: 0; }
.info-row-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.info-row-value {
  font-size: 15px;
  color: var(--text-1);
  font-weight: 400;
  word-break: break-word;
}

/* ── Tags / Badges (= AppTagStyle) ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag-neutral  { background: rgba(255,255,255,0.10); color: var(--text-2); border-color: rgba(255,255,255,0.15); }
.tag-cyan     { background: rgba(0,207,200,0.15);   color: var(--cyan);   border-color: rgba(0,207,200,0.30); }
.tag-blue     { background: rgba(10,110,250,0.15);  color: var(--primary); border-color: rgba(10,110,250,0.30); }
.tag-success  { background: rgba(34,197,122,0.15);  color: var(--success); border-color: rgba(34,197,122,0.30); }
.tag-warning  { background: rgba(245,158,11,0.15);  color: var(--warning); border-color: rgba(245,158,11,0.30); }
.tag-danger   { background: rgba(239,68,68,0.15);   color: var(--danger);  border-color: rgba(239,68,68,0.30); }

/* ── AppEmptyState ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  gap: 10px;
}
.empty-state-icon {
  font-size: 42px;
  opacity: 0.35;
  margin-bottom: 4px;
}
.empty-state h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
}
.empty-state p {
  font-size: 13px;
  color: var(--text-2);
  max-width: 260px;
  line-height: 1.5;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border-soft);
  margin: 12px 0;
}
.divider-cyan {
  background: linear-gradient(90deg, transparent, rgba(0,207,200,0.3), transparent);
}

/* ── Shimmer skeleton ── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.05) 25%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.05) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
.skeleton-text { height: 14px; border-radius: 7px; margin-bottom: 8px; }
.skeleton-text.w-3-4 { width: 75%; }
.skeleton-text.w-1-2 { width: 50%; }
.skeleton-text.w-1-3 { width: 33%; }
.skeleton-num  { height: 28px; width: 60px; border-radius: 8px; }
.skeleton-card { height: 80px; border-radius: var(--r-lg); }
.skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }

/* ── Fade-in animation ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.35s var(--ease) both; }
.fade-in-1 { animation-delay: 0.05s; }
.fade-in-2 { animation-delay: 0.10s; }
.fade-in-3 { animation-delay: 0.15s; }
.fade-in-4 { animation-delay: 0.20s; }
.fade-in-5 { animation-delay: 0.25s; }

/* ── Page transition ── */
@keyframes pageFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#app-view {
  animation: pageFade 0.2s var(--ease) both;
}

/* ── Scrollable container ── */
.scroll-y {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
