@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;700;800&display=swap');

:root {
  --primary: #4a148c;
  --primary-light: #7c43bd;
  --primary-dark: #12005e;
  --accent: #ba68c8;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --radius: 20px;
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-color: rgba(74, 20, 140, 0.15);
  --shadow-glow: 0 0 20px var(--shadow-color);
  
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: 1px solid rgba(255, 255, 255, 0.4);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, hsla(280, 75%, 95%, 1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(260, 40%, 93%, 1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .outfit {
  font-family: 'Outfit', sans-serif;
  color: var(--primary-dark);
  line-height: 1.2;
}

/* ---------------- Header & Navigation ---------------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--glass-bg);
  border-bottom: var(--glass-border);
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary);
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1.25rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
  background: rgba(74, 20, 140, 0.05);
  color: var(--primary);
}

.nav-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
}

/* ---------------- Main Content Layout ---------------- */
main {
  max-width: 1400px;
  margin: 3rem auto;
  padding: 0 2rem;
  min-height: 70vh;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
  display: block;
}

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

/* ---------------- UI Components ---------------- */

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

.glass-card {
  background: var(--surface);
  border: var(--glass-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* ---------------- Specific Pages ---------------- */

/* Inicio */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text {
  font-size: 1.15rem;
  color: var(--text-muted);
}

.hero-text strong {
  color: var(--primary);
  font-weight: 600;
}

.hero-img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow);
  object-fit: cover;
  aspect-ratio: 4/3;
}

/* Producción Académica (Bento Grid) */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.prof-card {
  text-align: center;
  padding: 3rem 2rem;
}

.prof-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.prof-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  background: var(--bg);
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Seminarios - Giant Text Fragmented Strategy */
.seminario-wrapper {
  margin-bottom: 4rem;
}

.sem-title-box {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 2rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.sem-title-box h3 {
  color: white;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}
.sem-title-box .sem-date {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.2rem;
  font-family: 'Outfit', sans-serif;
}

.sem-body {
  background: var(--surface);
  padding: 2rem;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
}

.text-cards-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Tarjetas de texto para fragmentar lectura */
.text-card {
  background: var(--bg);
  padding: 1.5rem 2rem;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  font-size: 1.1rem;
  color: var(--text-main);
}
.text-card p {
  margin-bottom: 0;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}
.gallery img {
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}
.gallery img:hover {
  transform: scale(1.05);
}

/* Profesores Colaboradores (Grid 3 cols) */
.colab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.colab-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.colab-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -2.5rem -2.5rem 1.5rem -2.5rem;
  width: calc(100% + 5rem);
}

.colab-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

/* Integrantes Table to Modern Grid */
.integrantes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.integrante-card {
  position: relative;
  overflow: hidden;
}

.integrante-linea {
  display: inline-block;
  background: var(--primary-light);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.integrante-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.integrante-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem;
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  margin-top: 5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-tabs {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--surface);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }
  
  .nav-tabs.show {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
}
