/* VARIABLES MODO OSCURO EMPRESARIAL PREMIUM */
body.dark-mode {
  --bg-dark: #070a11;
  --card-bg: rgba(15, 23, 42, 0.82);
  --card-border: rgba(56, 189, 248, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --brand-blue: #0284c7;
  --brand-cyan: #38bdf8;
  --canvas-opacity: 0.85;
}

/* VARIABLES MODO CLARO CORPORATIVO */
body.light-mode {
  --bg-dark: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-border: rgba(2, 132, 199, 0.15);
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;
  --brand-blue: #0284c7;
  --brand-cyan: #0284c7;
  --canvas-opacity: 0.35;
}

:root {
  --radius: 12px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #818cf8);
  width: 0%;
  z-index: 1001;
}

#corporate-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  pointer-events: auto;
  opacity: var(--canvas-opacity);
}

.app-wrapper {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* BARRA SUPERIOR */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.8rem;
  color: #10b981;
  font-weight: 600;
}

.pulse-dot {
  width: 8px; height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.btn {
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
}

.btn-theme, .btn-lang {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--card-border);
}

.btn-theme:hover, .btn-lang:hover { background: rgba(255, 255, 255, 0.12); }

.btn-whatsapp {
  width: 100%;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  margin-top: 0.8rem;
}

.btn-whatsapp:hover { box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35); transform: translateY(-2px); }

/* GRID PRINCIPAL */
.cv-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-bottom: 1.35rem;
  transition: var(--transition);
}

.card:hover { border-color: rgba(56, 189, 248, 0.35); }

.card-corp-border {
  border-left: 4px solid var(--brand-blue);
}

.profile-card { text-align: center; }

.avatar-ring {
  width: 125px;
  height: 125px;
  margin: 0 auto 1rem auto;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.25);
  transition: var(--transition);
}

.avatar-ring:hover { transform: scale(1.03); }

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.name {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.highlight-corp { color: var(--brand-cyan); }

.role-badge {
  color: var(--brand-cyan);
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  display: inline-block;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.5rem;
}

.card-title i { color: var(--brand-cyan); }

.contact-list { list-style: none; }
.contact-list li { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; }

.icon-wrap {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.icon-blue { background: rgba(2, 132, 199, 0.1); color: #38bdf8; }
.icon-green { background: rgba(16, 185, 129, 0.1); color: #34d399; }
.icon-purple { background: rgba(129, 140, 248, 0.1); color: #818cf8; }
.icon-amber { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }

.contact-list small { display: block; color: var(--text-dim); font-size: 0.68rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }
.contact-list p, .contact-list a { color: var(--text-main); font-weight: 500; font-size: 0.85rem; text-decoration: none; }
.contact-list a:hover { color: var(--brand-cyan); }

.skill-group { margin-bottom: 0.85rem; }
.skill-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  font-family: 'Fira Code', monospace;
  transition: var(--transition);
  cursor: default;
}

.tag:hover { transform: translateY(-2px); }

.tag-java { background: rgba(2, 132, 199, 0.12); color: #38bdf8; border: 1px solid rgba(2, 132, 199, 0.3); }
.tag-php { background: rgba(129, 140, 248, 0.12); color: #818cf8; border: 1px solid rgba(129, 140, 248, 0.3); }
.tag-js { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.tag-sql { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.tag-python { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.tag-laravel { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.tag-mysql { background: rgba(14, 165, 233, 0.12); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }
.tag-sqlserver { background: rgba(168, 85, 247, 0.12); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

.section-heading { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.85rem; display: flex; align-items: center; gap: 0.6rem; color: var(--text-main); letter-spacing: -0.01em; }
.section-heading i { color: var(--brand-cyan); }
.profile-text { color: var(--text-muted); font-size: 0.88rem; line-height: 1.65; }
.profile-text strong { color: var(--text-main); font-weight: 700; }

.academic-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.year-badge { background: rgba(56, 189, 248, 0.1); color: var(--brand-cyan); border: 1px solid rgba(56, 189, 248, 0.25); padding: 0.15rem 0.6rem; border-radius: 12px; font-size: 0.72rem; font-family: 'Fira Code', monospace; }
.academic-body h3 { font-size: 0.98rem; color: var(--text-main); margin-bottom: 0.1rem; }
.academic-sub { color: var(--brand-cyan); font-size: 0.82rem; font-weight: 600; margin-bottom: 0.6rem; }
.academic-list { list-style: none; }
.academic-list li { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.5rem; }
.academic-list li i { color: #10b981; font-size: 0.75rem; }

.filter-buttons { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-btn { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--card-border); color: var(--text-muted); padding: 0.3rem 0.75rem; border-radius: 8px; font-size: 0.75rem; cursor: pointer; transition: var(--transition); font-weight: 500; }
.filter-btn.active, .filter-btn:hover { background: rgba(2, 132, 199, 0.15); border-color: var(--brand-cyan); color: var(--text-main); }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.85rem; }
.project-card { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--card-border); border-radius: 10px; padding: 1.1rem; cursor: pointer; transition: var(--transition); display: flex; flex-direction: column; justify-content: space-between; }
.project-card:hover { transform: translateY(-3px); border-color: var(--brand-cyan); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.project-header h4 { font-size: 0.88rem; color: var(--text-main); margin-bottom: 0.2rem; font-weight: 600; }
.tech-badge { display: inline-block; font-size: 0.68rem; font-family: 'Fira Code', monospace; color: var(--brand-cyan); margin-bottom: 0.5rem; }
.project-card p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; margin-bottom: 0.8rem; }
.view-more { font-size: 0.72rem; color: var(--brand-cyan); font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }

.certs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.85rem; }
.cert-card { display: flex; align-items: center; gap: 0.75rem; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--card-border); padding: 0.8rem; border-radius: 10px; cursor: pointer; transition: var(--transition); }
.cert-card:hover { border-color: var(--brand-cyan); transform: translateY(-2px); }
.cert-oracle { color: #f87171; }
.cert-cisco { color: var(--brand-cyan); }
.cert-card strong { display: block; font-size: 0.8rem; color: var(--text-main); font-weight: 600; }
.cert-card p { font-size: 0.7rem; color: var(--text-dim); }

/* METRICAS KPI & DASHBOARD DE GRÁFICOS */
.chart-header-flex { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.85rem; }
.tag-status { font-family: 'Fira Code', monospace; font-size: 0.7rem; color: #10b981; background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.25); padding: 0.2rem 0.55rem; border-radius: 6px; display: inline-flex; align-items: center; gap: 0.3rem; }
.chart-subtitle { font-size: 0.78rem; color: var(--text-dim); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.kpi-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--brand-cyan);
}

.kpi-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.chart-controls {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn-chart-style {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-chart-style:hover, .btn-chart-style.active {
  background: rgba(2, 132, 199, 0.18);
  border-color: var(--brand-cyan);
  color: var(--text-main);
}

.btn-pulse-toggle {
  margin-left: auto;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.btn-pulse-toggle:hover {
  background: rgba(16, 185, 129, 0.25);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 350px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1rem;
}

/* BOTÓN FLOTANTE WHATSAPP */
.whatsapp-float {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
  z-index: 999;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: pulse-whatsapp 2.5s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.6);
  color: white;
}

@keyframes pulse-whatsapp {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* MODALES & TOAST */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(7, 10, 17, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--brand-cyan);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-close { position: absolute; top: 0.8rem; right: 1rem; font-size: 1.3rem; color: var(--text-muted); cursor: pointer; }
.modal-close:hover { color: var(--text-main); }

.toast {
  position: fixed;
  bottom: 20px; left: 20px;
  background: #0284c7;
  color: #ffffff;
  padding: 0.75rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  pointer-events: none;
  z-index: 1000;
}

.toast.show { opacity: 1; transform: translateY(0); }

footer { text-align: center; padding: 1.5rem 0 0.5rem; color: var(--text-dim); font-size: 0.8rem; }

/*responsive-celular  */

/* =========================================
   DISEÑO RESPONSIVO: TABLET Y CELULAR
   Añade este bloque al final de tu archivo CSS
   ========================================= */

/* TABLET (Pantallas hasta 1024px) */
@media screen and (max-width: 1024px) {
  .cv-grid {
    /* Convierte el layout de 2 columnas a 1 columna apilada */
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .app-wrapper {
    padding: 1rem;
  }

  .profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .top-bar {
    flex-direction: column;
    text-align: center;
    gap: 1.2rem;
  }

  .actions {
    width: 100%;
    justify-content: center;
  }
}

/* CELULAR (Pantallas hasta 768px) */
@media screen and (max-width: 768px) {
  .app-wrapper {
    padding: 0.8rem;
  }

  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  /* Ajustes de Tipografía y Avatar */
  .avatar-ring {
    width: 100px;
    height: 100px;
  }

  .name {
    font-size: 1.2rem;
  }

  /* Grillas a 1 sola columna en móviles */
  .kpi-grid, 
  .projects-grid, 
  .certs-grid {
    grid-template-columns: 1fr;
  }

  /* Botones de filtros ocupando todo el ancho disponible */
  .filter-buttons {
    justify-content: center;
  }

  .filter-btn {
    flex: 1 1 calc(50% - 0.4rem);
    text-align: center;
  }

  /* Controles de gráficos apilados */
  .chart-header-flex {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-controls {
    width: 100%;
    justify-content: space-between;
  }

  .btn-chart-style {
    flex: 1;
    justify-content: center;
  }

  /* Altura reducida para gráficos en pantallas pequeñas */
  .chart-wrapper {
    height: 250px;
    padding: 0.5rem;
  }

  /* Botón de WhatsApp más discreto en móviles */
  .whatsapp-float {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  .modal-content {
    padding: 1.2rem;
    width: 95%;
  }
}

/* CELULAR PEQUEÑO (Pantallas hasta 480px) */
@media screen and (max-width: 480px) {
  .filter-btn {
    flex: 1 1 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .contact-list li {
    flex-direction: column;
    text-align: center;
    gap: 0.3rem;
  }
}