/*
 * SUPER-STYLE.CSS
 * Un diseño personalizado, profesional y moderno para César Ciotti
 * Modo Oscuro, centrado en Expertise Cloud.
 */

/* ===== 1. Variables y Reseteo Global ===== */
:root {
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Paleta de Colores (Dark Mode) */
  --color-background: #101418; /* Negro azulado muy oscuro */
  --color-surface: #191F24;   /* Superficie de la tarjeta (un poco más claro) */
  --color-border: rgba(255, 255, 255, 0.1);
  --color-text-primary: #F0F4F8; /* Blanco suave */
  --color-text-secondary: #A0AEC0; /* Gris azulado para descripciones */
  
  /* Acento (Azul Google) */
  --color-accent: #4285F4;
  --color-accent-hover: #60a5fa;

  /* Sombras */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);

  /* Layout */
  --container-width: 1140px;
  --border-radius: 12px;
  --transition: all 0.3s ease-in-out;
}

/* Reseteo básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-background);
  color: var(--color-text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--color-accent-hover);
}

/* ===== 2. Header y Navbar ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: var(--transition);
}
.header-reduce,
.header.scrolled {
  background-color: rgba(16, 20, 24, 0.85); /* Fondo oscuro con transparencia */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
}
.navbar-brand:hover {
  color: var(--color-text-primary);
}

.navbar-nav {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}
.nav-link {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  position: relative;
}
.nav-link:hover {
  color: var(--color-text-primary);
}
.nav-link.active {
  color: var(--color-accent);
}

/* ===== 3. Botones y Elementos UI ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.btn-secondary {
  background-color: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.intro-section {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  background-size: contain;  /* <-- CAMBIO AQUÍ */
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat; /* <-- AÑADIDO AQUÍ */
}
.intro-overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(to bottom, rgba(16, 20, 24, 0.8), rgba(16, 20, 24, 1));
}
.intro-content {
  position: relative;
  z-index: 2;
  max-width: 800px; /* Limita el ancho del texto */
  margin: 0; /* Alinea a la izquierda */
  padding: 0 2rem;
}
.intro-title {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--color-text-primary);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}
.intro-subtitle {
  font-size: 1.5rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}
.intro-actions {
  display: flex;
  gap: 1rem;
}

/* Versión simple para subpáginas */
.intro-section-simple {
  padding: 10rem 0 4rem 0;
  background-color: var(--color-surface);
  text-align: center;
}
.intro-section-simple .intro-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.intro-section-simple .intro-subtitle {
  font-size: 1.2rem;
  margin-bottom: 0;
}

/* ===== 5. Estructura de Secciones ===== */
.section-container {
  padding: 6rem 0;
  border-top: 1px solid var(--color-border);
}
.section-title {
  text-align: center;
  margin-bottom: 4rem;
}
.section-title .subtitle {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}
.section-title h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
}
.section-footer {
  text-align: center;
  margin-top: 4rem;
}

/* ===== 6. Layouts y Tarjetas (Expertise, Proyectos, Certs) ===== */
.grid-layout {
  display: grid;
  gap: 2rem;
}
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* Card de Expertise (Glassmorphism) */
.expertise-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 2rem;
  transition: var(--transition);
  height: 100%; /* <-- Esta línea ya estaba */
  display: flex; /* <-- AÑADE ESTO */
  flex-direction: column; /* <-- AÑADE ESTO */
}

.card-description {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  min-height: 50px;
  flex-grow: 1; /* <-- AÑADE ESTO (hace que la descripción crezca) */
}
.expertise-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(66, 133, 244, 0.3);
}
.card-icon {
  font-size: 2.5rem;
  color: var(--color-accent);
  margin-bottom: 1rem;
}
.card-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.75rem;
}

.tech-list {
  list-style: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.tech-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 0.5rem;
}
.tech-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-accent);
  font-weight: bold;
}

/* Card de Proyectos */
.project-card {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  align-items: center;
  margin-bottom: 4rem;
}
.project-card.reverse {
  grid-template-areas: "content image";
}
.project-card.reverse .project-image { grid-area: image; }
.project-card.reverse .project-content { grid-area: content; }

.project-image {
  height: 350px;
  background-size: contain;   /* <-- CAMBIO AQUÍ */
  background-position: center;
  background-repeat: no-repeat; /* <-- AÑADIDO AQUÍ */
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.project-card:hover .project-image {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

.project-category {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}
.project-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}
.project-description {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

/* Card de Certificaciones (REEMPLAZADO POR EMBED) */
.cert-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: var(--transition);
}
.cert-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(66, 133, 244, 0.3);
}
.cert-logo {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.7;
}
.cert-card:hover .cert-logo {
  filter: grayscale(0);
  opacity: 1;
}
.cert-date {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* ===== NUEVO: Estilos para el Embed de Credly ===== */
.cert-embed-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Esto selecciona el div de Credly y lo estiliza como una "placa"
  para que se vea bien en el fondo oscuro.
*/
div[data-share-badge-id="3afecf61-e113-489b-a1bd-4ab00781f17e"] {
  background-color: #fff; /* Fondo blanco para el badge */
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden; /* Asegura que el iframe no se desborde */
}


/* ===== 7. Footer ===== */
.footer {
  padding: 5rem 0 2rem 0;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
}
.footer-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}
.footer-about p {
  max-width: 300px;
  color: var(--color-text-secondary);
}
.contact-email {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}
.social-links {
  display: flex;
  gap: 1.5rem;
}
.social-links a {
  font-size: 1.75rem;
  color: var(--color-text-secondary);
}
.social-links a:hover {
  color: var(--color-accent);
  transform: translateY(-2px);
}
.footer-bottom {
  padding-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}
.footer-bottom p {
  margin-bottom: 0.5rem;
}

/* ===== 8. Utilidades (Back to Top, Animaciones) ===== */
.back-to-top {
  position: fixed;
  display: none; /* Controlado por JS */
  right: 20px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 1.5rem;
  background-color: var(--color-accent);
  color: #fff;
  border-radius: var(--border-radius);
  z-index: 999;
}
.back-to-top:hover {
  background-color: var(--color-accent-hover);
  color: #fff;
}

/* Animación de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.fade-in-section {
  opacity: 0;
  visibility: hidden;
}
.is-visible {
  opacity: 1;
  visibility: visible;
  animation: fadeInUp 1s ease-out forwards;
}

/* ===== 9. Responsive ===== */
@media (max-width: 992px) {
  .container { padding: 0 1.5rem; }
  .grid-layout.cols-3, .grid-layout.cols-2 {
    grid-template-columns: 1fr;
  }
  .project-card, .project-card.reverse {
    grid-template-columns: 1fr;
    grid-template-areas: "image" "content";
  }
  .project-card .project-image { grid-area: image; }
  .project-card .project-content { grid-area: content; }
  
  .intro-title { font-size: 2.5rem; }
  .intro-subtitle { font-size: 1.25rem; }
}

@media (max-width: 768px) {
  /* Ocultar menú de navbar para futuro menú hamburguesa */
  .navbar-menu { display: none; }
  .intro-title { font-size: 2rem; }
  .section-container { padding: 4rem 0; }
  .section-title h2 { font-size: 2rem; }
  .footer-content { flex-direction: column; text-align: center; }
  .footer-about p { max-width: 100%; }
  .social-links { justify-content: center; }
}