/* Manual de Usuario ZEUMAX - Estilos mejorados */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

:root {
  --brand: #F5A623;
  --brand-dark: #D97706;
  --brand-light: #FFFBEB;
  --navy: #2C3E50;
  --navy-light: #34495E;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F3F4F6;
  --text: #1F2937;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --success: #16A34A;
  --danger: #DC2626;
  --warning: #F59E0B;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.15);
  --radius: 12px;
  --sidebar-width: 280px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --bg: #1e293b;
  --surface: #27374d;
  --surface-2: #334155;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --border: #475569;
  --brand-light: rgba(245,166,35,0.15);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.35), 0 2px 4px -2px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .2s, color .2s;
}

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--navy);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: .75rem;
}

.brand-logo {
  width: 40px; height: 40px; border-radius: 10px; background: var(--brand);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.brand-logo img { width: 28px; height: 28px; object-fit: contain; }

.brand-name { font-size: 1.35rem; font-weight: 700; color: #fff; line-height: 1.2; }
.brand small { display: block; color: rgba(255,255,255,0.65); font-size: 0.75rem; }

.sidebar nav { flex: 1; padding: 1rem 0; }
.sidebar nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: 0.8rem 1.5rem; color: rgba(255,255,255,0.8);
  text-decoration: none; transition: all 0.2s; border-left: 4px solid transparent;
  font-size: .95rem;
}
.sidebar nav a i { width: 20px; text-align: center; }
.sidebar nav a:hover,
.sidebar nav a.active { background: rgba(255,255,255,0.1); color: white; border-left-color: var(--brand); }

.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* Search */
.search-box { position: relative; margin: 0 1.5rem 1rem; }
.search-box input {
  width: 100%; height: 40px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.1); color: #fff; padding: 0 12px 0 36px; font-size: .9rem; outline: none;
}
.search-box input::placeholder { color: rgba(255,255,255,0.5); }
.search-box input:focus { background: rgba(255,255,255,0.15); border-color: var(--brand); }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.5); font-size: .85rem; }
.search-empty { display: none; padding: 1rem 1.5rem; color: rgba(255,255,255,.6); font-size: .85rem; }

/* Content */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  max-width: calc(100% - var(--sidebar-width));
  padding: 1.5rem 2rem 3rem;
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.page-header-left { display: flex; align-items: center; gap: 1rem; }
.page-header h1 { margin: 0; color: var(--navy); font-size: 1.75rem; font-weight: 700; }
[data-theme="dark"] .page-header h1 { color: var(--brand); }

.menu-toggle {
  display: none; background: var(--brand); border: none; color: white;
  width: 40px; height: 40px; border-radius: var(--radius); font-size: 1.1rem; cursor: pointer;
}

.header-actions { display: flex; align-items: center; gap: .5rem; }
.icon-toggle {
  width: 40px; height: 40px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer;
  transition: all .2s;
}
.icon-toggle:hover { border-color: var(--brand); color: var(--brand); }

/* Markdown body */
.markdown-body {
  background: var(--surface); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 { color: var(--navy); margin-top: 2rem; margin-bottom: 1rem; font-weight: 700; }
.markdown-body h1 { font-size: 2rem; border-bottom: 3px solid var(--brand); padding-bottom: 0.5rem; }
.markdown-body h2 { font-size: 1.5rem; border-bottom: 2px solid var(--border); padding-bottom: 0.4rem; margin-top: 2.5rem; }
.markdown-body h3 { font-size: 1.25rem; color: var(--navy-light); }
[data-theme="dark"] .markdown-body h1,
[data-theme="dark"] .markdown-body h2,
[data-theme="dark"] .markdown-body h3,
[data-theme="dark"] .markdown-body h4 { color: var(--text); }
[data-theme="dark"] .markdown-body h2 { border-color: var(--border); }

.markdown-body p { margin-bottom: 1rem; }
.markdown-body a { color: var(--brand-dark); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body img { max-width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shadow); margin: 1rem 0; }
.markdown-body pre { background: #1F2937; color: #F3F4F6; padding: 1rem; border-radius: 8px; overflow-x: auto; }
.markdown-body code { background: var(--surface-2); padding: 0.2rem 0.4rem; border-radius: 4px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.9em; }
.markdown-body pre code { background: transparent; padding: 0; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 0.75rem; text-align: left; }
.markdown-body th { background: var(--navy); color: white; }
.markdown-body tr:nth-child(even) { background: var(--surface-2); }
.markdown-body blockquote { border-left: 4px solid var(--brand); margin: 1.5rem 0; padding: 0.75rem 1rem; background: var(--brand-light); border-radius: 0 8px 8px 0; }
.markdown-body ul, .markdown-body ol { margin-bottom: 1rem; padding-left: 1.5rem; }

.table-wrapper { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); margin: 1.5rem 0; }
.table-wrapper table { margin: 0; }

/* Mermaid placeholder */
.mermaid-diagram {
  background: var(--surface-2); border: 2px dashed var(--border); border-radius: 8px;
  padding: 2rem; text-align: center; color: var(--text-muted); margin: 1.5rem 0;
}

/* Mockup gallery - imágenes individuales con descripción */
.mockup-gallery { margin: 3rem 0; }
.mockup-gallery h2 {
  color: var(--navy); border-bottom: 2px solid var(--brand); padding-bottom: 0.5rem; margin-bottom: 1.5rem;
}
[data-theme="dark"] .mockup-gallery h2 { color: var(--text); }

.screenshot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1.5rem;
}
.screenshot-grid.mobile-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.mockup-item {
  margin: 0; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.mockup-item img {
  width: 100%; height: auto; display: block; border-bottom: 1px solid var(--border); cursor: zoom-in;
}
.mockup-item.mobile-mockup img {
  max-width: 260px; margin: 1rem auto 0;
  border: 1px solid var(--border); border-radius: 24px;
}
.mockup-item figcaption {
  padding: 1rem; font-size: 0.95rem; color: var(--text-muted); flex: 1;
}
.mockup-item figcaption strong {
  display: block; color: var(--navy); font-size: 1.05rem; margin-bottom: 0.4rem;
}
[data-theme="dark"] .mockup-item figcaption strong { color: var(--brand); }
.mockup-item figcaption p { margin: 0; line-height: 1.5; }

/* Legacy mockup hero (mantenido por compatibilidad) */
.mockup-hero { margin: 2rem 0; }
.mockup-hero figure { margin: 0; }
.mockup-hero img {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); cursor: zoom-in;
  border: 1px solid var(--border);
}
.mockup-hero figcaption { text-align: center; color: var(--text-muted); font-size: .9rem; margin-top: .5rem; }

/* Hero / Index */
.hero { text-align: center; }
.lead { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; text-align: left; }
.card {
  display: block; background: var(--surface); padding: 1.5rem; border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s; border-top: 4px solid var(--brand);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card h3 { margin-top: 0; color: var(--navy); display: flex; align-items: center; gap: .6rem; }
.card p { color: var(--text-muted); margin-bottom: 0; }
[data-theme="dark"] .card h3 { color: var(--brand); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; box-shadow: var(--shadow-lg); }
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem; width: 44px; height: 44px;
  background: rgba(255,255,255,.15); color: #fff; border-radius: 50%; border: none;
  font-size: 1.25rem; cursor: pointer; display: grid; place-items: center;
}
.lightbox-caption { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.8); font-size: .9rem; }

/* Footer manual */
.manual-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .85rem; text-align: center; }

/* Responsive */
/* Print styles */
@media print {
  @page { size: letter; margin: 0; }
  html, body { background: #fff !important; }
  .sidebar, .menu-toggle, .header-actions, .search-box, .search-empty, .sidebar-footer, .lightbox {
    display: none !important;
  }
  .content {
    margin-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0.5in !important;
  }
  .page-header {
    border-bottom-color: #000 !important;
    margin-bottom: 1rem !important;
  }
  .page-header h1 { color: #000 !important; }
  .markdown-body {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }
  .markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
    color: #000 !important;
    page-break-after: avoid;
  }
  .markdown-body a { color: #000 !important; text-decoration: underline; }
  .markdown-body img { box-shadow: none !important; border: 1px solid #ddd !important; }
  .mockup-hero, .screenshot-grid figure, .mockup-item {
    page-break-inside: avoid;
  }
  .card { break-inside: avoid; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; max-width: 100%; padding: 1rem; }
  .menu-toggle { display: grid; place-items: center; }
  .page-header h1 { font-size: 1.35rem; }
  .markdown-body { padding: 1rem; }
  .screenshot-grid { grid-template-columns: 1fr; }
  .search-box { margin: 0 1rem 1rem; }
}
