/* FacturasSimplesRN - User Manual Styles */
/* Beautiful, print-friendly documentation for the invoicing app */

:root {
  --primary: #0F172A;
  --primary-light: #E2E8F0;
  --primary-dark: #020617;
  --accent: #059669;
  --accent-light: #D1FAE5;
  --accent-dark: #047857;
  --info: #0284C7;
  --info-light: #E0F2FE;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --bg: #F8FAFC;
  --bg-white: #FFFFFF;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --sidebar-width: 280px;
  --topbar-height: 60px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ── Top Bar ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--primary);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  text-decoration: none;
}

.topbar-logo:hover { text-decoration: none; color: #fff; }

.topbar-logo svg { width: 28px; height: 28px; }

.topbar-logo .logo-sub {
  font-weight: 400;
  font-size: 13px;
  color: var(--text-light);
  margin-left: 8px;
}

.topbar-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-light);
}

.topbar-info a { color: var(--accent-light); }

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
  z-index: 90;
}

.sidebar-header {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
}

.sidebar-header h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}

.sidebar-chapter {
  margin-bottom: 4px;
}

.sidebar-chapter-title {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s;
}

.sidebar-chapter-title:hover { color: var(--text); }

.sidebar-chapter-title .chapter-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0.6;
}

.sidebar-chapter-title .arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s;
  color: var(--text-light);
}

.sidebar-chapter-title.collapsed .arrow { transform: rotate(-90deg); }

.sidebar-items { list-style: none; }
.sidebar-items.hidden { display: none; }

.sidebar-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px 6px 32px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar-item a:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
  text-decoration: none;
}

.sidebar-item a.active {
  background: var(--accent-light);
  border-left-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}

/* ── Main Content ── */
.main {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 40px;
  min-height: calc(100vh - var(--topbar-height));
  max-width: 1200px;
}

/* ── Hero Banner (Index Page) ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1E3A5F 100%);
  border-radius: var(--radius-xl);
  padding: 48px;
  margin-bottom: 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, rgba(5,150,105,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
  position: relative;
}

.hero p {
  font-size: 16px;
  color: #CBD5E1;
  max-width: 600px;
  line-height: 1.6;
  position: relative;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  position: relative;
}

.hero-stat {
  text-align: center;
}

.hero-stat .value {
  font-size: 28px;
  font-weight: 800;
  color: #10B981;
}

.hero-stat .label {
  font-size: 12px;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Chapter Cards (Index Page) ── */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.chapter-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.chapter-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: inherit;
}

.chapter-card-header {
  padding: 24px 24px 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.chapter-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chapter-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chapter-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.chapter-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.chapter-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.chapter-card-footer .section-count {
  font-weight: 600;
  color: var(--accent);
}

/* ── Quick Reference Table ── */
.reference-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.reference-table th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reference-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.reference-table tr:last-child td { border-bottom: none; }

.reference-table tr:hover td { background: var(--bg); }

.dte-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 14px;
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .sep { color: var(--text-light); }

/* ── Section Header ── */
.section-header {
  margin-bottom: 32px;
}

.section-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--primary);
}

.section-header .subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 700px;
}

/* ── Device Tabs — pill style ── */
.device-tabs {
  display: flex;
  gap: 4px;
  background: #F0FDF4;
  border: 1px solid var(--accent-light);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
  width: fit-content;
  max-width: 100%;
}

.device-tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  cursor: pointer;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.device-tab:hover {
  background: rgba(5,150,105,0.1);
  color: var(--accent-dark);
}

.device-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(5,150,105,0.3);
}

.device-tab svg { opacity: 0.8; }
.device-tab.active svg { opacity: 1; }

.device-tab .device-count {
  background: rgba(255,255,255,0.2);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.device-tab:not(.active) .device-count {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.device-panel { display: none; }
.device-panel.active { display: block; }

/* ── Steps ── */
.steps { display: flex; flex-direction: column; gap: 20px; max-width: 820px; }

.step {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.step:hover { box-shadow: var(--shadow-md); }

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(5,150,105,0.35);
}

.step-caption {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.6;
  padding-top: 4px;
  max-width: 680px;
}

.step-body {
  padding: 20px 24px;
}

/* ── Info-only steps (no screenshots) — styled bullet list ── */
.steps-info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  padding: 8px 0;
}

.step-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--accent-light);
  transition: border-color 0.15s;
}

.step-info:hover { border-left-color: var(--accent); }

.step-info-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-info-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

/* ── Callout Cards ── */
.callout {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.callout-warning {
  background: #FEF3C7;
  border-left: 4px solid #F59E0B;
  color: #78350F;
}

.callout-info {
  background: #EFF6FF;
  border-left: 4px solid #3B82F6;
  color: #1E3A5F;
}

.callout-success {
  background: #ECFDF5;
  border-left: 4px solid #059669;
  color: #065F46;
}

.callout strong { font-weight: 700; }

/* ── Screenshot Grid ── */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* Desktop screenshots get a browser-chrome header */
.device-panel[data-device="desktop"] .screenshot-card::before {
  content: '';
  display: block;
  height: 32px;
  background: #E5E7EB;
  border-bottom: 1px solid #D1D5DB;
  border-radius: var(--radius) var(--radius) 0 0;
  background-image: radial-gradient(circle, #FC605B 6px, transparent 6px),
                    radial-gradient(circle, #FDBC40 6px, transparent 6px),
                    radial-gradient(circle, #35CD4B 6px, transparent 6px);
  background-repeat: no-repeat;
  background-position: 12px center, 28px center, 44px center;
}

.screenshot-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}

.screenshot-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  transform: translateY(-1px);
}

.screenshot-card img {
  width: 100%;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s;
}

.screenshot-card img:hover { opacity: 0.95; }

.screenshot-card .caption {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  background: #F8FAFC;
  border-top: 1px solid var(--border-light);
  line-height: 1.5;
}

/* ── Device-specific screenshot sizing ── */
/* Mobile screenshots — show at phone-like max width */
.device-panel[data-device="android-emulator"] .screenshot-grid,
.device-panel[data-device="ios-phone"] .screenshot-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 340px));
}

/* Tablet screenshots — wider */
.device-panel[data-device="android-tablet"] .screenshot-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 540px));
}

/* Mobile screenshots get a phone-chrome top notch */
.device-panel[data-device="android-emulator"] .screenshot-card::before,
.device-panel[data-device="ios-phone"] .screenshot-card::before {
  content: '';
  display: block;
  height: 20px;
  background: #1F2937;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Cap iOS iPhone Pro Max captures (1320×2868) to phone-sized rendering */
.device-panel[data-device="ios-phone"] .screenshot-card img {
  max-width: 320px;
  margin: 0 auto;
  display: block;
}

/* ── Device Comparison ── */
.device-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.device-frame {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 12px;
  text-align: center;
}

.device-frame-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.device-frame img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
}

/* ── Page Navigation ── */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.page-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
}

.page-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.page-nav .nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
}

.page-nav .nav-title {
  font-weight: 600;
}

.page-nav .nav-prev .nav-arrow,
.page-nav .nav-next .nav-arrow {
  font-size: 18px;
  color: var(--text-light);
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.lightbox-close {
  position: fixed;
  top: 20px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.25); }

.lightbox-label {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Hamburger ── */
.hamburger-btn {
  display: none;
  width: 40px; height: 40px;
  border: none; background: none;
  cursor: pointer; padding: 8px;
  margin-right: 8px; border-radius: 6px;
  flex-shrink: 0;
}

.hamburger-btn:hover { background: rgba(255,255,255,0.1); }

.hamburger-btn span {
  display: block; width: 20px; height: 2px;
  background: #fff; margin: 4px auto;
  border-radius: 1px; transition: transform 0.2s, opacity 0.2s;
}

.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(4px,4px); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(4px,-4px); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 85;
}

.sidebar-overlay.active { display: block; }

/* ── Info Box ── */
.info-box {
  background: var(--info-light);
  border-left: 4px solid var(--info);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text);
}

.info-box strong { color: var(--info); }

/* ── Responsive: Tablet ── */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 240px; }
  .main { margin-left: 240px; padding: 28px; }
  .hero { padding: 36px; }
  .hero h1 { font-size: 26px; }
  .chapters-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Responsive: Mobile ── */
@media (max-width: 768px) {
  .hamburger-btn { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: var(--sidebar-width);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 20px 16px; }
  .topbar { padding: 0 12px; }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 22px; }
  .hero-stats { gap: 16px; flex-wrap: wrap; }
  .hero-stat .value { font-size: 22px; }
  .chapters-grid { grid-template-columns: 1fr; }
  .device-comparison { grid-template-columns: 1fr; }
  .screenshot-grid { grid-template-columns: 1fr; }
  .section-header h1 { font-size: 22px; }
  .step-header { padding: 14px 16px; flex-wrap: wrap; }
  .step-body { padding: 16px; }
  .page-nav { flex-direction: column; gap: 12px; }
  .page-nav a { width: 100%; justify-content: center; }
  .sidebar-item a, .sidebar-chapter-title { min-height: 44px; display: flex; align-items: center; }
  .device-tab { padding: 10px 14px; font-size: 13px; }
  body.sidebar-open { overflow: hidden; }
}

/* ── Print Styles ── */
@media print {
  .sidebar, .topbar, .lightbox, .hamburger-btn, .sidebar-overlay, .page-nav, .device-tabs { display: none !important; }
  .main { margin: 0; padding: 20px; max-width: none; }
  .device-panel { display: block !important; }
  .device-panel::before {
    content: attr(data-device);
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: #666;
  }
  .step { page-break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .chapter-card { page-break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .hero { background: #1E293B !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: white; }
  .screenshot-card img { max-width: 100%; }
}
