/* =====================================================
   VARIABLES CSS GLOBALES
   ===================================================== */
:root {
  /* Colores principales */
  --github-red: #d1242f;
  --github-dark: #24292f;
  --github-gray: #656.campus-experts-img {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
  }
  --github-light-gray: #f6f8fa;
  --github-border: #d1d9e0;
  --white: #ffffff;

  /* Colores de texto */
  --text-primary: #24292f;
  --text-secondary: #656d76;
  --text-muted: #8b949e;

  /* Colores de acento */
  --accent-blue: #0969da;
  --accent-green: #1a7f37;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;

  /* Sombras */
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-large: 0 8px 25px rgba(0, 0, 0, 0.2);

  /* Bordes y espaciado */
  --border-radius: 8px;
  --border-radius-large: 12px;
  --border-radius-small: 4px;

  /* Transiciones */
  --transition-fast: all 0.15s ease;
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;

  /* Fuentes */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* Tamaños de fuente */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Espaciado */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  /* Contenedores */
  --container-max-width: 1200px;
  --container-padding: 20px;
}

/* =====================================================
   RESET Y ESTILOS BASE
   ===================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--white);
  overflow-x: hidden;
  min-height: 100vh;
}

/* =====================================================
   TIPOGRAFÍA GLOBAL
   ===================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-4xl);
}
h2 {
  font-size: var(--text-3xl);
}
h3 {
  font-size: var(--text-2xl);
}
h4 {
  font-size: var(--text-xl);
}
h5 {
  font-size: var(--text-lg);
}
h6 {
  font-size: var(--text-base);
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--github-dark);
  text-decoration: underline;
}

/* =====================================================
   COMPONENTES REUTILIZABLES
   ===================================================== */

/* Contenedores */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: var(--text-sm);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--github-red);
  color: var(--white);
  border: 2px solid var(--github-red);
}

.btn-primary:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: var(--white);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--github-border);
}

.btn-secondary:hover {
  background: var(--github-light-gray);
  border-color: var(--text-primary);
  color: var(--text-primary);
  text-decoration: none;
  transform: translateY(-2px);
}

/* Código */
code {
  background: var(--github-light-gray);
  padding: 2px 6px;
  border-radius: var(--border-radius-small);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--github-red);
}

.code-example {
  background: var(--github-dark);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin: var(--spacing-md) 0;
  overflow-x: auto;
}

.code-example pre {
  margin: 0;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.code-example code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* =====================================================
   HEADER Y NAVEGACIÓN
   ===================================================== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--github-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-light);
}

.header-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

/* Logo GitHub Campus Experts */
.campus-experts-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  text-decoration: none;
}

.campus-experts-logo:hover {
  text-decoration: none;
}

.campus-experts-img {
  height: 70px;
  width: auto;
  object-fit: contain;
  transition: var(--transition);
}

.campus-experts-img:hover {
  transform: scale(1.05);
}

.campus-experts-img.small {
  height: 30px;
}

/* Navegación */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-2xl);
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  padding: var(--spacing-md) 0;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--github-red);
}

/* Menu móvil toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 1001;
  transition: var(--transition);
  border-radius: var(--border-radius-small);
}

.mobile-menu-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Overlay para cerrar el menú móvil */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
}

.welcome-modal.active {
  opacity: 1;
  visibility: visible;
}

.welcome-modal-content {
  background: var(--white);
  border-radius: var(--border-radius-large);
  padding: var(--spacing-2xl);
  max-width: 450px;
  width: 90%;
  position: relative;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-large);
  text-align: center;
}

.welcome-modal.active .welcome-modal-content {
  transform: scale(1);
}

.welcome-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.15);
  border: 2px solid rgba(0, 0, 0, 0.3);
  font-size: 24px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: var(--transition);
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 10;
  line-height: 1;
  font-family: Arial, sans-serif;
}

.welcome-close-btn:hover {
  background: rgba(220, 53, 69, 0.9);
  border-color: #dc3545;
  color: white;
  transform: scale(1.1);
}

.welcome-close-btn:active {
  transform: scale(0.95);
}

.welcome-header {
  margin-bottom: var(--spacing-xl);
}

.welcome-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--github-red), #ff6b6b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-lg);
  font-size: 28px;
  color: white;
  animation: welcomePulse 2s infinite;
}

@keyframes welcomePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.welcome-header h2 {
  font-size: 28px;
  color: var(--text-primary);
  margin: 0;
  font-weight: 700;
}

.welcome-body {
  margin-bottom: var(--spacing-xl);
}

.welcome-body p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

.welcome-footer .btn {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  min-width: 140px;
}

/* Responsive para modal */
@media (max-width: 768px) {
  .welcome-modal-content {
    padding: var(--spacing-xl);
    margin: var(--spacing-lg);
  }

  .welcome-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

  .welcome-header h2 {
    font-size: 24px;
  }

  .welcome-body p {
    font-size: 15px;
  }
}

/* Overlay para menú móvil */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  background: var(--github-dark);
  color: var(--white);
  margin-top: auto;
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--spacing-3xl) var(--container-padding);
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-3xl);
  align-items: start;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.footer-logo .campus-experts-logo.small {
  transform: scale(0.8);
  transform-origin: left center;
}

.footer-logo .github-text,
.footer-logo .campus-text {
  color: var(--white);
}

.footer-description {
  color: #8b949e;
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.footer-right {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  align-items: flex-end;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  align-items: flex-end;
}

.footer-links a {
  color: var(--white);
  text-decoration: none;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--github-red);
  text-decoration: none;
}

.footer-credit {
  color: #8b949e;
  font-size: var(--text-xs);
  margin: 0;
}

/* =====================================================
   UTILIDADES
   ===================================================== */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: var(--spacing-xs);
}
.mt-2 {
  margin-top: var(--spacing-sm);
}
.mt-3 {
  margin-top: var(--spacing-md);
}
.mt-4 {
  margin-top: var(--spacing-lg);
}
.mt-5 {
  margin-top: var(--spacing-xl);
}

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: var(--spacing-xs);
}
.mb-2 {
  margin-bottom: var(--spacing-sm);
}
.mb-3 {
  margin-bottom: var(--spacing-md);
}
.mb-4 {
  margin-bottom: var(--spacing-lg);
}
.mb-5 {
  margin-bottom: var(--spacing-xl);
}

.hidden {
  display: none;
}
.visible {
  display: block;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 768px) {
  :root {
    --container-padding: 16px;
  }

  .header-nav {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 80px);
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-2xl) var(--spacing-xl);
    transition: right 0.3s ease;
    z-index: 1000;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    border-left: 1px solid var(--github-border);
  }

  .header-nav.active {
    right: 0;
  }

  .header-nav .nav-link {
    width: 100%;
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--github-border);
    margin-bottom: var(--spacing-sm);
    font-size: var(--text-lg);
  }

  .header-nav .nav-link:last-child {
    border-bottom: none;
  }

  .header-nav .nav-link.active::after {
    display: none;
  }

  .header-nav .nav-link.active {
    color: var(--github-red);
    background: rgba(209, 36, 47, 0.05);
    border-radius: var(--border-radius);
    padding-left: var(--spacing-md);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .footer-right {
    align-items: flex-start;
  }

  .footer-links {
    align-items: flex-start;
  }

  h1 {
    font-size: var(--text-3xl);
  }
  h2 {
    font-size: var(--text-2xl);
  }
  h3 {
    font-size: var(--text-xl);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: var(--text-2xl);
  }
  h2 {
    font-size: var(--text-xl);
  }

  .btn {
    padding: 10px 20px;
    font-size: var(--text-xs);
  }
}
