/* java.css — Estilos para la Guía de Java */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 20px 80px;
}

/* ── Cabecera de página ── */
pre { overflow-x: auto; max-width: 100%; }
.page-header { text-align: center; margin-bottom: 60px; }

.page-title {
  font-size: 2.8rem;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  background: linear-gradient(135deg, #ed8b00, #ffb03a, #007396);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  line-height: 1.2;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 650px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

/* ── Stats Badge Row ── */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.stat-pill {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 8px 20px;
  font-family: "Outfit", sans-serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
  backdrop-filter: blur(10px);
}
.stat-pill span { color: #ed8b00; font-weight: 700; }

/* ── Tabs ── */
.section-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 22px;
  border: 1px solid var(--glass-border);
  background: var(--card-bg);
  color: var(--text-secondary);
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: "Outfit", sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tab-btn.active, .tab-btn:hover {
  background: #ed8b00;
  color: #fff;
  border-color: #ed8b00;
  box-shadow: 0 4px 18px rgba(237, 139, 0, 0.35);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeInJava 0.4s ease; }

@keyframes fadeInJava {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Título de sección ── */
.section-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 40px 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

/* ── Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.java-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 22px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.java-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, #ed8b00, #ffb03a);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.java-card:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(237, 139, 0, 0.18); }
.java-card:hover::before { opacity: 1; }

.java-card h3 {
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  color: #ed8b00;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.java-card .desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* ── Concept Model Cards ── */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.model-card {
  border-radius: 16px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
}
.model-card:hover { transform: translateY(-5px); border-color: #ed8b00; }

.model-card.c-var { background: linear-gradient(135deg, rgba(237,139,0,0.12), rgba(255,176,58,0.08)); border: 1px solid rgba(237,139,0,0.3); }
.model-card.c-ctrl { background: linear-gradient(135deg, rgba(0,115,150,0.12), rgba(0,147,191,0.08)); border: 1px solid rgba(0,115,150,0.3); }
.model-card.c-func { background: linear-gradient(135deg, rgba(52,211,153,0.12), rgba(16,185,129,0.08)); border: 1px solid rgba(52,211,153,0.3); }
.model-card.c-poo { background: linear-gradient(135deg, rgba(167,139,250,0.12), rgba(139,92,246,0.08)); border: 1px solid rgba(167,139,250,0.3); }
.model-card.c-arr { background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(220,38,38,0.08)); border: 1px solid rgba(239,68,68,0.3); }
.model-card.c-exc { background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(217,119,6,0.08)); border: 1px solid rgba(245,158,11,0.3); }
.model-card.c-pkg { background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(79,70,229,0.08)); border: 1px solid rgba(99,102,241,0.3); }

.model-badge {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.badge-var { background: rgba(237,139,0,0.2); color: #ed8b00; }
.badge-ctrl { background: rgba(0,115,150,0.2); color: #00b0e6; }
.badge-func { background: rgba(52,211,153,0.2); color: #34d399; }
.badge-poo { background: rgba(167,139,250,0.2); color: #a78bfa; }
.badge-arr { background: rgba(239,68,68,0.2); color: #f87171; }
.badge-exc { background: rgba(245,158,11,0.2); color: #fbbf24; }
.badge-pkg { background: rgba(99,102,241,0.2); color: #818cf8; }

.model-card h3 {
  font-family: "Outfit", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.model-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}
.model-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ex-tag {
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  padding: 2px 9px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

/* ── POO Grid ── */
.poo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.poo-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.poo-card::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: #007396;
  transition: width 0.4s ease;
}
.poo-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,115,150,0.15); }
.poo-card:hover::after { width: 100%; }

.poo-card .poo-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.poo-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.poo-icon.class { background: rgba(237,139,0,0.15); color: #ed8b00; }
.poo-icon.inherit { background: rgba(0,115,150,0.15); color: #00b0e6; }
.poo-icon.poly { background: rgba(52,211,153,0.15); color: #34d399; }
.poo-icon.encap { background: rgba(167,139,250,0.15); color: #a78bfa; }
.poo-icon.abs { background: rgba(239,68,68,0.15); color: #f87171; }
.poo-icon.inter { background: rgba(251,191,36,0.15); color: #fbbf24; }

.poo-card h3 {
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.poo-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
}
.poo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.poo-tag {
  font-size: 0.7rem;
  font-family: "JetBrains Mono", monospace;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,115,150,0.1);
  color: #00b0e6;
  border: 1px solid rgba(0,115,150,0.25);
}

/* ── Code snippets ── */
.code-block-wrapper {
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px 18px;
  position: relative;
  margin-bottom: 20px;
}
.code-lang-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: #ed8b00;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}
.code-block-wrapper pre {
  margin: 0;
  overflow-x: auto;
}
.code-block-wrapper code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: #e6edf3;
  line-height: 1.6;
}
/* Basic Syntax Highlighting for Java */
.kw { color: #ff7b72; } /* Keywords: public, class, void */
.typ { color: #f0883e; } /* Types: String, int */
.str { color: #a5d6ff; } /* Strings */
.cmt { color: #8b949e; } /* Comments */
.mth { color: #d2a8ff; } /* Methods */
.num { color: #79c0ff; } /* Numbers */

/* ── Guía Práctica ── */
.practice-block {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  transition: box-shadow 0.3s ease;
}
.practice-block:hover {
  box-shadow: 0 8px 30px rgba(237, 139, 0, 0.1);
}
.practice-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.practice-header h3 {
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.practice-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.step-num {
  background: #ed8b00;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.step p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  padding-top: 3px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .page-title { font-size: 2rem; }
  .cards-grid,
  .model-grid,
  .poo-grid {
    grid-template-columns: 1fr;
  }
  .section-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ════════════════════════════════════════════════
   LIGHT MODE OVERRIDES FOR JAVA COMPONENT
══════════════════════════════════════════════════ */

/* Ajuste de colores base para los bloques predefinidos */
body.light-mode .java-card pre[style],
body.light-mode .model-card pre[style],
body.light-mode .practice-block pre[style],
body.light-mode div[style*="background:#0d1117"] {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-mode .java-card code[style],
body.light-mode .model-card code[style],
body.light-mode .practice-block code[style] {
  color: #334155 !important;
}

/* Estilos de bloque de código general */
body.light-mode .code-block-wrapper {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
body.light-mode .code-block-wrapper code {
  color: #334155;
}

/* Highlighting de sintaxis para Light Mode (Tonos legibles y vibrantes) */
body.light-mode .kw { color: #9333ea; font-weight: 600; } /* public, class, void */
body.light-mode .typ { color: #0284c7; } /* String, int */
body.light-mode .str { color: #16a34a; } /* Strings */
body.light-mode .cmt { color: #64748b; font-style: italic; } /* Comments */
body.light-mode .mth { color: #ea580c; } /* Methods */
body.light-mode .num { color: #e11d48; } /* Numbers */

/* Cajas hardcodeadas en HTML (para "Funciones Predeterminadas") */
body.light-mode div[style*="background:rgba(255,255,255,0.03)"] {
  background: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05) !important;
  border: 1px solid #e2e8f0 !important;
}
body.light-mode h4[style*="color:#e2e8f0"] {
  color: #0f172a !important;
}
body.light-mode p[style*="color:#94a3b8"] {
  color: #475569 !important;
}

/* Gradientes suaves de las tarjetas en Light Mode */
body.light-mode .model-card.c-var { background: linear-gradient(135deg, rgba(237,139,0,0.05), rgba(255,176,58,0.01)); border-color: rgba(237,139,0,0.2); }
body.light-mode .model-card.c-ctrl { background: linear-gradient(135deg, rgba(0,115,150,0.05), rgba(0,147,191,0.01)); border-color: rgba(0,115,150,0.2); }
body.light-mode .model-card.c-func { background: linear-gradient(135deg, rgba(52,211,153,0.05), rgba(16,185,129,0.01)); border-color: rgba(52,211,153,0.2); }
body.light-mode .model-card.c-poo { background: linear-gradient(135deg, rgba(167,139,250,0.05), rgba(139,92,246,0.01)); border-color: rgba(167,139,250,0.2); }
body.light-mode .model-card.c-arr { background: linear-gradient(135deg, rgba(239,68,68,0.05), rgba(220,38,38,0.01)); border-color: rgba(239,68,68,0.2); }
body.light-mode .model-card.c-exc { background: linear-gradient(135deg, rgba(245,158,11,0.05), rgba(217,119,6,0.01)); border-color: rgba(245,158,11,0.2); }
body.light-mode .model-card.c-pkg { background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(79,70,229,0.01)); border-color: rgba(99,102,241,0.2); }

/* Etiquetas pequeñas (tags) */
body.light-mode .ex-tag {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-mode .poo-card::after {
  background: #4f46e5;
}
