/* RetroRevistas Audit - Style Sheet */
:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #334155;
  --border: #334155;
  --border2: #475569;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --purple: #a855f7;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --sidebar-w: 280px;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === LAYOUT === */
.audit-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audit-header .brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.audit-header .brand span { color: var(--accent-light); }

.audit-header .header-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.audit-layout {
  display: flex;
  flex: 1;
}

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: var(--surface); }
.sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.sidebar-group { margin-bottom: 1.5rem; }

.sidebar-group-title {
  padding: 0.25rem 1.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.sidebar a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-left-color: var(--border2);
}

.sidebar a.active {
  background: rgba(59,130,246,0.1);
  color: var(--accent-light);
  border-left-color: var(--accent);
  font-weight: 500;
}

/* === MAIN CONTENT === */
.main {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1200px;
}

/* === BREADCRUMBS === */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.breadcrumbs a { color: var(--accent-light); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--text-dim); }

/* === PAGE HEADER === */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header .page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.page-header .page-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.page-header .page-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.page-meta-item {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* === CARDS === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* === SECTIONS === */
.section { margin-bottom: 3rem; }

.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.section-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

/* === TABLES === */
.table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--surface2);
}

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

tbody td {
  padding: 0.75rem 1rem;
  vertical-align: top;
  color: var(--text);
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-success { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-info { background: rgba(6,182,212,0.15); color: #22d3ee; border: 1px solid rgba(6,182,212,0.3); }
.badge-purple { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.badge-neutral { background: rgba(148,163,184,0.1); color: #94a3b8; border: 1px solid rgba(148,163,184,0.2); }
.badge-accent { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

/* Priority badges */
.p-critical { background: rgba(239,68,68,0.2); color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.p-high { background: rgba(245,158,11,0.2); color: #fcd34d; border: 1px solid rgba(245,158,11,0.4); }
.p-medium { background: rgba(6,182,212,0.15); color: #67e8f9; border: 1px solid rgba(6,182,212,0.3); }
.p-low { background: rgba(34,197,94,0.1); color: #86efac; border: 1px solid rgba(34,197,94,0.2); }

/* === CODE === */
pre, code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

pre {
  background: #080f1a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  color: #a5f3fc;
}

code {
  background: rgba(6,182,212,0.1);
  color: #67e8f9;
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

pre code { background: none; color: inherit; padding: 0; }

/* === CALLOUT === */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid;
  font-size: 0.9rem;
}

.callout-danger { background: rgba(239,68,68,0.07); border-color: var(--danger); color: #fca5a5; }
.callout-warning { background: rgba(245,158,11,0.07); border-color: var(--warning); color: #fcd34d; }
.callout-info { background: rgba(6,182,212,0.07); border-color: var(--info); color: #67e8f9; }
.callout-success { background: rgba(34,197,94,0.07); border-color: var(--success); color: #86efac; }
.callout strong { display: block; margin-bottom: 0.25rem; }

/* === SCORE CARDS === */
.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.score-card .score-num {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.score-card .score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-good { color: var(--success); }
.score-ok { color: #a3e635; }
.score-warn { color: var(--warning); }
.score-bad { color: var(--danger); }

/* === PROGRESS === */
.progress-bar {
  background: var(--surface2);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* === TOC === */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.toc ol, .toc ul { padding-left: 1.25rem; }
.toc li { margin-bottom: 0.3rem; }
.toc a { color: var(--accent-light); text-decoration: none; font-size: 0.875rem; }
.toc a:hover { text-decoration: underline; }

/* === GRID LAYOUT === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* === STATUS INDICATOR === */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red { background: var(--danger); }
.status-dot.blue { background: var(--accent); }

/* === BACK TO INDEX === */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
  margin-bottom: 1.5rem;
}

.back-btn:hover {
  background: var(--border2);
  color: var(--text);
}

/* === MERMAID DIAGRAMS === */
.mermaid-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

/* === INDEX PAGE SPECIFIC === */
.hero {
  background: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(168,85,247,0.1) 100%);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 16px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.nav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-card:hover {
  border-color: var(--accent);
  background: rgba(59,130,246,0.05);
  transform: translateY(-2px);
}

.nav-card .nav-num {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
}

.nav-card .nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.nav-card .nav-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .main { padding: 1.5rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .audit-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .main { padding: 1rem; }
  .hero h1 { font-size: 1.75rem; }
}

/* === UTILITY === */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-light); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

p { margin-bottom: 0.75rem; color: var(--text-muted); }
h2 { font-size: 1.375rem; font-weight: 700; color: var(--text); margin-bottom: 0.75rem; margin-top: 2rem; }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; margin-top: 1.5rem; }
h4 { font-size: 0.95rem; font-weight: 600; color: var(--accent-light); margin-bottom: 0.5rem; }
ul, ol { padding-left: 1.5rem; color: var(--text-muted); margin-bottom: 0.75rem; }
li { margin-bottom: 0.25rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

.page-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}
.status-completed { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-inprogress { background: rgba(245,158,11,0.15); color: #fbbf24; }
.status-pending { background: rgba(148,163,184,0.1); color: #94a3b8; }

/* === SCREENSHOTS === */
.screenshot {
  margin: 1.75rem 0;
}

.screenshot-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: zoom-in;
  text-decoration: none;
  max-width: 720px;
}

.screenshot-link:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(59,130,246,0.2);
  transform: translateY(-2px);
}

.screenshot-link img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot-caption {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 720px;
}

.screenshot-caption::after {
  content: "↗";
  font-size: 0.7rem;
  color: var(--accent-light);
  opacity: 0.7;
}
