/* ──────────────────────────────────────────────────
   miHojaDeVida · App CSS
   Responsive · Dark/Light · Modern · Premium
   ────────────────────────────────────────────────── */

:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --secondary: #64748b;
  --success: #10b981;
  --dark: #0f172a;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: .25s ease;
  --navbar-h: 66px;
  --font: 'Inter', system-ui, sans-serif;
}

[data-bs-theme="dark"] {
  --surface: #1e293b;
  --surface-alt: #0f172a;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.2);
}

/* ── Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  line-height: 1.65;
}

/* ── Navbar ───────────────────────────────────── */
.navbar-custom {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--navbar-h);
  transition: box-shadow var(--transition);
}
[data-bs-theme="dark"] .navbar-custom {
  background: rgba(15,23,42,.92);
}
.navbar-custom.scrolled { box-shadow: var(--shadow); }
.navbar-brand { font-weight: 800; font-size: 1.1rem; color: var(--text) !important; }
.logo-dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(37,99,235,.4); }
  50% { box-shadow: 0 0 0 6px rgba(37,99,235,0); }
}
.nav-link { color: var(--text-muted) !important; font-weight: 500; transition: color var(--transition); }
.nav-link:hover { color: var(--primary) !important; }
.theme-toggle { border-color: var(--border); }

/* ── Hero ─────────────────────────────────────── */
.hero-section {
  padding: calc(var(--navbar-h) + 60px) 0 80px;
  background: linear-gradient(135deg, var(--surface-alt) 0%, var(--surface) 100%);
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(37,99,235,.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge .badge {
  font-size: .8rem; padding: .4em .9em; border-radius: 20px;
  background: var(--primary-light) !important;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--text);
}
.hero-subtitle {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: .5rem;
}
.hero-description { color: var(--text-muted); }
.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: .5rem;
  font-size: .95rem;
}
.hero-note {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text-muted);
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
}

/* Profile card */
.profile-card-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}
.profile-avatar-wrap { position: relative; text-align: center; }
.profile-avatar-img {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.avatar-badge {
  position: absolute;
  bottom: 0; right: calc(50% - 60px);
  background: var(--primary);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  padding: .2em .6em;
  border-radius: 20px;
  letter-spacing: .05em;
}
.pi-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.pi-item:last-child { border-bottom: none; }
.pi-item i { margin-top: 3px; width: 16px; flex-shrink: 0; }
.pi-item div { display: flex; flex-direction: column; }
.pi-item strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.pi-item a, .pi-item span { font-size: .9rem; color: var(--text); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .5rem; }
.stat-box {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: .5rem;
  text-align: center;
  border: 1px solid var(--border);
}
.stat-num { font-size: 1.3rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-lbl { font-size: .65rem; color: var(--text-muted); }

/* ── Section helpers ──────────────────────────── */
.section-alt { background: var(--surface-alt); }
.section-header { margin-bottom: 3rem; }
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
}
.section-subtitle { font-size: 1.05rem; }

/* ── About ────────────────────────────────────── */
.value-prop-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.value-prop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.vp-icon { font-size: 2rem; margin-bottom: .5rem; }
.specialty-card { border: none !important; }
.specialty-list li {
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.specialty-list li:last-child { border: none; }

/* ── Timeline ─────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), transparent);
}
.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 1.5rem;
  width: 16px; height: 16px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.timeline-content { border: none; border-left: 3px solid var(--primary); }
.achievements-list { list-style: none; padding: 0; margin: 0; }
.achievements-list li {
  padding: .3rem 0;
  font-size: .9rem;
  display: flex;
  gap: .5rem;
}

/* ── Projects ─────────────────────────────────── */
.filter-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 20px;
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.project-card { border-radius: var(--radius); overflow: hidden; }
.featured-project {
  border-top: 3px solid var(--primary) !important;
}
.featured-badge {
  background: var(--primary);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  padding: .3em .8em;
  display: inline-block;
  margin: .75rem .75rem 0;
  border-radius: 20px;
}
.project-icon-box { font-size: 2rem; }
.project-features { display: flex; flex-wrap: wrap; gap: .25rem; }
.feature-chip {
  display: inline-block;
  font-size: .7rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: .2em .6em;
  border-radius: 20px;
}
.hover-lift { transition: transform var(--transition), box-shadow var(--transition); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg) !important; }

/* ── Skills ───────────────────────────────────── */
.skill-category-card { border-radius: var(--radius); }
.skill-name { font-size: .9rem; }
.skill-level-badge { font-size: .75rem; color: var(--text-muted); }
.skill-progress .progress-bar { transition: width 1.2s cubic-bezier(.4,0,.2,1); }
.soft-skill-icon {
  width: 40px; height: 40px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
}

/* ── Education ────────────────────────────────── */
.education-item { border-left: 3px solid var(--primary) !important; border-top: none; border-right: none; border-bottom: none; }
.edu-icon { font-size: 2.5rem; }
.courses-list .progress { border-radius: 4px; }
.badge-sm { font-size: .65rem; }

/* ── Contact ──────────────────────────────────── */
.contact-method-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  color: var(--text) !important;
  transition: all var(--transition);
}
.contact-method-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateX(4px);
}
.cm-icon { width: 40px; flex-shrink: 0; }

/* ── Blog ─────────────────────────────────────── */
.blog-card { border-radius: var(--radius); }
.blog-card .card-img-top { transition: transform .4s ease; }
.blog-card:hover .card-img-top { transform: scale(1.03); }

/* ── Footer ───────────────────────────────────── */
.footer-custom {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
}
.footer-icon-link {
  color: var(--text-muted);
  font-size: 1.25rem;
  transition: color var(--transition), transform var(--transition);
}
.footer-icon-link:hover { color: var(--primary); transform: translateY(-2px); }

/* ── Chat Widget ──────────────────────────────── */
.chat-widget { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1050; }
.btn-chat-float {
  width: 56px; height: 56px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
  transition: all var(--transition);
  position: relative;
}
.btn-chat-float:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(37,99,235,.5); }
.chat-badge {
  position: absolute; top: -4px; right: -4px;
  background: #ef4444; color: white;
  font-size: .65rem; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%; display: grid; place-items: center;
}
.chat-box {
  position: absolute;
  bottom: 70px; right: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.chat-header {
  background: var(--primary);
  padding: .75rem 1rem;
}
.chat-online-dot {
  width: 10px; height: 10px;
  background: #10b981;
  border-radius: 50%;
  border: 2px solid white;
}
.chat-messages {
  height: 220px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.chat-msg {
  max-width: 80%;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
}
.chat-msg.admin {
  background: var(--primary-light);
  color: var(--primary);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.chat-msg.visitor {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

/* ── Admin Login ──────────────────────────────── */
.admin-login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark) 0%, #1e3a8a 100%);
  display: grid;
  place-items: center;
}

/* ── Blog Post ─────────────────────────────────── */
.blog-post-content {
  font-size: 1.05rem;
  line-height: 1.8;
}
.blog-post-content h2, .blog-post-content h3 {
  margin-top: 2rem;
  font-weight: 700;
}
.blog-post-content pre {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
}
.blog-post-content code {
  background: var(--surface-alt);
  padding: .1em .3em;
  border-radius: 3px;
  font-size: .9em;
}

/* ── Utilities ────────────────────────────────── */
.bg-primary-soft { background: var(--primary-light) !important; }
.bg-secondary-soft { background: var(--surface-alt) !important; }
.text-primary { color: var(--primary) !important; }
.tech-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tech-tags .badge {
  font-size: .75rem;
  font-weight: 500;
  padding: .3em .7em;
}

/* ── Animations (AOS-style fallback) ──────────── */
[data-aos] { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
[data-aos].aos-animate { opacity: 1; transform: none; }

/* ── Responsive tweaks ────────────────────────── */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .chat-box { width: 290px; }
  .timeline { padding-left: 1.25rem; }
}

/* ── Print ────────────────────────────────────── */
@media print {
  .navbar-custom, .chat-widget, footer, #blog { display: none !important; }
  body { padding-top: 0 !important; }
}

/* ── Availability badges ── */
.availability-badge {
  background: rgba(59, 130, 246, 0.12);
  color: var(--bs-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35em 0.75em;
  border-radius: 20px;
}

/* ── Capability cards ── */
.capability-card {
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.capability-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}
.cap-icon {
  font-size: 2.2rem;
  line-height: 1;
}

/* ── GitHub section ── */
.github-card {
  border: 1px solid rgba(0,0,0,0.1);
  transition: box-shadow 0.2s ease;
}
.github-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}
.github-upcoming li {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.github-upcoming li:last-child {
  border-bottom: none;
}

[data-bs-theme="dark"] .availability-badge {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.3);
}
[data-bs-theme="dark"] .capability-card {
  border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .github-card {
  border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .github-upcoming li {
  border-bottom-color: rgba(255,255,255,0.06);
}

/* ── CTA Band ── */
.cta-band {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 50%, #2563eb 100%);
  color: #fff;
}
.cta-band-title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}
.cta-band-sub {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

/* ── Architecture tags ── */
.arch-tag {
  background: var(--bs-body-bg);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: default;
}
.arch-tag:hover {
  border-color: var(--bs-primary);
  background: rgba(59,130,246,0.06);
}
[data-bs-theme="dark"] .arch-tag {
  background: rgba(255,255,255,0.05);
  border-color: rgba(96,165,250,0.2);
}
[data-bs-theme="dark"] .arch-tag:hover {
  background: rgba(96,165,250,0.1);
}

/* ── Engineering Case Studies ── */
.case-study-card {
  border-top: 3px solid var(--bs-primary);
}
.cs-block {
  background: rgba(59,130,246,0.04);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}
.cs-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bs-primary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.cs-value {
  font-size: 0.85rem;
  font-weight: 500;
}
.cs-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  color: var(--bs-secondary-color, #6c757d);
}
.cs-list li {
  margin-bottom: 0.3rem;
}
[data-bs-theme="dark"] .cs-block {
  background: rgba(96,165,250,0.06);
}

/* ── Engineering Identity Band ── */
.engineering-identity-band {
  background: linear-gradient(135deg, rgba(37,99,235,.07) 0%, rgba(37,99,235,.02) 100%);
  border-top: 1px solid rgba(37,99,235,.12);
  border-bottom: 1px solid rgba(37,99,235,.12);
}
[data-bs-theme="dark"] .engineering-identity-band {
  background: linear-gradient(135deg, rgba(37,99,235,.15) 0%, rgba(37,99,235,.04) 100%);
  border-color: rgba(96,165,250,.15);
}
.engineering-quote {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
  line-height: 1.6;
}

/* ── Value Role Cards (¿Qué aporta Luis?) ── */
.value-role-card {
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  transition: transform var(--transition), box-shadow var(--transition);
}
.value-role-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg) !important; }
.vr-icon { font-size: 2.4rem; }

/* ── AI Assistant Section ── */
.ai-preview-card { border: 1px solid var(--border); background: var(--surface); }
.ai-msg { display: flex; flex-direction: column; margin-bottom: .75rem; }
.ai-msg.user { align-items: flex-end; }
.ai-msg.bot { align-items: flex-start; }
.msg-bubble {
  display: inline-block;
  padding: .55rem .95rem;
  border-radius: 12px;
  max-width: 88%;
  font-size: .875rem;
  line-height: 1.5;
}
.user-bubble {
  background: var(--primary);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.bot-bubble {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px 14px 14px 14px;
  color: var(--text);
}
[data-bs-theme="dark"] .bot-bubble {
  background: rgba(255,255,255,.06);
}
.ai-assistant-badge .badge {
  font-size: .8rem; padding: .4em .9em; border-radius: 20px;
  background: var(--primary-light) !important;
}
