/* ===================================================
   LARAVEL PARA INICIANTES — Stylesheet
   =================================================== */

:root {
  --laravel-red: #FF2D20;
  --laravel-dark-red: #c0392b;
  --sidebar-width: 280px;
  --bg-light: #f0f2f5;
  --bg-white: #ffffff;
  --text-dark: #1a202c;
  --text-gray: #718096;
  --border-color: #e2e8f0;
  --code-bg: #1e1e2e;
  --sidebar-bg: #0f172a;
  --success: #38a169;
  --warning: #dd6b20;
  --info: #3182ce;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 8px 24px rgba(0,0,0,0.05);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 20px 40px rgba(0,0,0,0.08);
  --radius: 14px;
  --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.75;
}

/* ─── PROGRESS BAR ─────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #FF2D20, #ff6b6b, #ffa500);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ─── SIDEBAR ───────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
  padding: 28px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #FF2D20, #ff6b35);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: #fff;
  letter-spacing: -1px;
  box-shadow: 0 4px 12px rgba(255,45,32,0.4);
  flex-shrink: 0;
}

.sidebar-logo span {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-subtitle {
  color: rgba(255,255,255,0.4);
  font-size: 11.5px;
  margin-left: 48px;
}

.sidebar-nav {
  padding: 14px 0;
  flex: 1;
}

.nav-section-title {
  padding: 10px 22px 4px;
  color: rgba(255,255,255,0.3);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 22px;
  color: rgba(255,255,255,0.62);
  text-decoration: none;
  font-size: 13.5px;
  transition: all 0.18s;
  cursor: pointer;
  border-left: 3px solid transparent;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.nav-item.active {
  background: rgba(255,45,32,0.12);
  color: #ff6b6b;
  border-left-color: #FF2D20;
  font-weight: 600;
}

.nav-icon {
  font-size: 15px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.3);
  font-size: 11px;
  text-align: center;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ─── MAIN ──────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ─── HERO ──────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  padding: 72px 64px 64px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -80px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,45,32,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px; left: 20%;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,45,32,0.18);
  color: #ff9090;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 22px;
  border: 1px solid rgba(255,45,32,0.3);
}

.hero h1 {
  color: #fff;
  font-size: 46px;
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 18px;
  position: relative;
}

.hero h1 .accent { color: #FF2D20; }

.hero-desc {
  color: rgba(255,255,255,0.65);
  font-size: 17px;
  max-width: 540px;
  margin-bottom: 36px;
  line-height: 1.7;
  position: relative;
}

.hero-stats {
  display: flex;
  gap: 36px;
  position: relative;
}

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

.hero-stat-value {
  display: block;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.hero-stat-label {
  color: rgba(255,255,255,0.45);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── CONTENT ───────────────────────────────────── */
.content {
  padding: 56px 64px;
  max-width: 960px;
}

/* ─── SECTION ───────────────────────────────────── */
.section {
  margin-bottom: 72px;
  scroll-margin-top: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.section-num {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--laravel-red), #ff6b35);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(255,45,32,0.35);
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
}

p {
  margin-bottom: 14px;
  color: #4a5568;
  font-size: 15px;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text-dark);
}

h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 22px 0 8px;
  color: var(--text-dark);
}

strong { color: var(--text-dark); }

code:not([class]) {
  background: #fef3f2;
  color: #c0392b;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 13.5px;
  border: 1px solid #fecaca;
}

ul, ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

li {
  color: #4a5568;
  margin-bottom: 6px;
  font-size: 15px;
}

/* ─── CARD ──────────────────────────────────────── */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── GRID ──────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* ─── CODE BLOCK ────────────────────────────────── */
.code-block {
  background: var(--code-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
  box-shadow: var(--shadow-lg);
}

.code-header {
  background: rgba(255,255,255,0.04);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
}

.code-dot.r { background: #ff5f57; }
.code-dot.y { background: #ffbd2e; }
.code-dot.g { background: #28c840; }

.code-filename {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  font-family: 'Courier New', monospace;
}

.code-block pre[class*="language-"] {
  margin: 0;
  padding: 20px 22px;
  background: transparent !important;
  font-size: 13.5px;
  line-height: 1.65;
  border-radius: 0;
  overflow-x: auto;
}

.code-block code[class*="language-"] {
  background: transparent;
  font-family: 'Fira Code', 'Courier New', monospace;
}

/* ─── INFO BOXES ────────────────────────────────── */
.info-box {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 18px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14.5px;
}

.info-box.tip {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
}

.info-box.warning {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
}

.info-box.success {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
}

.info-box.danger {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
}

.info-box-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-box-content {
  color: #374151;
  line-height: 1.6;
}

.info-box-title {
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text-dark);
}

/* ─── PROS & CONS ───────────────────────────────── */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0;
}

.pros-card, .cons-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.pros-card { border-top: 4px solid #22c55e; }
.cons-card { border-top: 4px solid #ef4444; }

.pros-cons-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pros-cons-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pros-cons-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: #4a5568;
}

.pros-cons-list li:last-child { border-bottom: none; }

.pros-cons-list li .badge {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 14px;
}

/* ─── DIRECTORY TREE ────────────────────────────── */
.dir-tree {
  background: #141422;
  border-radius: var(--radius);
  padding: 24px 28px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 13.5px;
  line-height: 1.8;
  overflow-x: auto;
  box-shadow: var(--shadow-lg);
}

.dir-row {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.dir-tree-prefix {
  color: rgba(255,255,255,0.18);
  user-select: none;
}

.dir-icon { margin-right: 5px; font-style: normal; }

.d-folder { color: #89DDFF; font-weight: 600; }
.d-file   { color: #C3E88D; }
.d-special { color: #FFCB6B; }
.d-comment { color: rgba(255,255,255,0.3); font-size: 12px; font-family: 'Segoe UI', sans-serif; margin-left: 10px; }

/* ─── MVC DIAGRAM ───────────────────────────────── */
.mvc-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0;
}

.mvc-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.mvc-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}

.mvc-card.model::before  { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.mvc-card.view::before   { background: linear-gradient(90deg, #0ea5e9, #06b6d4); }
.mvc-card.ctrl::before   { background: linear-gradient(90deg, #f59e0b, #ef4444); }

.mvc-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 22px;
}

.mvc-card.model .mvc-icon { background: #ede9fe; }
.mvc-card.view .mvc-icon  { background: #e0f2fe; }
.mvc-card.ctrl .mvc-icon  { background: #fef3c7; }

.mvc-letter {
  font-size: 22px;
  font-weight: 900;
}

.mvc-card.model .mvc-letter { color: #7c3aed; }
.mvc-card.view .mvc-letter  { color: #0284c7; }
.mvc-card.ctrl .mvc-letter  { color: #d97706; }

.mvc-title { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.mvc-subtitle { font-size: 11px; color: var(--text-gray); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.mvc-desc { font-size: 13px; color: #4a5568; text-align: left; line-height: 1.6; }

/* ─── FLOW DIAGRAM ──────────────────────────────── */
.flow-diagram {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  margin: 22px 0;
}

.flow-diagram-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-gray);
  text-align: center;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 12px;
}

.flow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.flow-box {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  text-align: center;
  min-width: 80px;
}

.flow-box.indigo  { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.flow-box.red     { background: linear-gradient(135deg, #FF2D20, #dc2626); }
.flow-box.blue    { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.flow-box.green   { background: linear-gradient(135deg, #22c55e, #16a34a); }
.flow-box.orange  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.flow-box.purple  { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.flow-box.teal    { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.flow-box.slate   { background: linear-gradient(135deg, #64748b, #475569); }

.flow-arrow {
  color: rgba(0,0,0,0.2);
  font-size: 18px;
  padding: 0 5px;
  flex-shrink: 0;
}

.flow-label {
  font-size: 11px;
  color: var(--text-gray);
  text-align: center;
  margin-top: 4px;
}

/* ─── LIFECYCLE STEPS ───────────────────────────── */
.lifecycle {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 22px 0;
}

.lc-item {
  display: flex;
  gap: 18px;
  align-items: stretch;
  position: relative;
}

.lc-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.lc-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF2D20, #ff6b35);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(255,45,32,0.3);
  position: relative; z-index: 2;
}

.lc-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, rgba(255,45,32,0.3), rgba(255,45,32,0.05));
  margin: 4px 0;
}

.lc-item:last-child .lc-line { display: none; }

.lc-content {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  flex: 1;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.lc-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 3px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lc-badge {
  font-size: 11px;
  background: #fef2f2;
  color: #dc2626;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid #fecaca;
}

.lc-desc {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
}

/* ─── TABLE ─────────────────────────────────────── */
.table-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 20px 0;
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--sidebar-bg);
  color: rgba(255,255,255,0.85);
  padding: 13px 18px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: #4a5568;
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #fafafa; }

/* ─── TAGS / BADGES ─────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px;
}

.tag.red    { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.tag.blue   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.tag.green  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.tag.purple { background: #faf5ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.tag.orange { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.tag.gray   { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

/* ─── HIGHLIGHT BOX ─────────────────────────────── */
.highlight-box {
  background: linear-gradient(135deg, #fef2f2, #fff5f5);
  border-left: 4px solid var(--laravel-red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 18px 0;
}

.highlight-box p {
  margin: 0;
  color: #374151;
  font-size: 15px;
}

/* ─── DIVIDER ───────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 56px 0;
}

/* ─── BACK TO TOP ───────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--laravel-red), #ff6b35);
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(255,45,32,0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── MOBILE MENU ───────────────────────────────── */
#menu-btn {
  display: none;
  position: fixed;
  bottom: 28px;
  right: 84px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--sidebar-bg);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99;
  backdrop-filter: blur(3px);
}

.overlay.active { display: block; }

/* ─── FOOTER ────────────────────────────────────── */
.footer {
  background: var(--sidebar-bg);
  color: rgba(255,255,255,0.5);
  padding: 40px 64px;
  text-align: center;
  font-size: 13.5px;
}

.footer a {
  color: #ff6b6b;
  text-decoration: none;
}

.footer a:hover { text-decoration: underline; }

/* ─── PROVIDER DIAGRAM ──────────────────────────── */
.provider-box {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 22px 0;
}

.provider-flow {
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── FACADE COMPARISON ─────────────────────────── */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0;
}

.compare-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.compare-card-header {
  padding: 12px 18px;
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-card-header.facade { background: #fef2f2; color: #dc2626; }
.compare-card-header.di     { background: #f0fdf4; color: #15803d; }

.compare-card-body { padding: 0; }

/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 1100px) {
  .content { padding: 48px 48px; }
  .hero    { padding: 60px 48px; }
}

@media (max-width: 900px) {
  .grid-3, .mvc-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }

  .hero { padding: 40px 24px 36px; }
  .hero h1 { font-size: 30px; }
  .hero-stats { gap: 20px; flex-wrap: wrap; }

  .content { padding: 28px 22px; }
  .section-title { font-size: 22px; }

  .grid-2, .grid-3, .pros-cons, .mvc-cards, .compare-grid {
    grid-template-columns: 1fr;
  }

  .flow-row { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }

  #menu-btn { display: flex; align-items: center; justify-content: center; }
  #back-to-top { right: 28px; }

  .footer { padding: 32px 22px; }

  .table-wrap { overflow-x: auto; }
  table { min-width: 600px; }
}
