/* ===== ICCS Platform — Main Styles ===== */

/* ── Tipografías personalizadas ──────────────────────────────
   Oswald  → Google Fonts (libre, condensed-bold, títulos)
   Avenir  → sistema: macOS/iOS tienen Avenir nativo;
             Windows usa Century Gothic como sustituto visual
   ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600;700&display=swap');

:root {
  --navy: #001f5b;
  --navy-dark: #001040;
  --red: #c8102e;
  --red-dark: #a00d24;
  --white: #ffffff;
  --gray-50: #f9f9f9;
  --gray-100: #f0f0f0;
  --gray-200: #e0e0e0;
  --gray-500: #9e9e9e;
  --gray-700: #444444;
  --text: #1a1a2e;
  --nav-h: 85px;
  --radius: 6px;
  --shadow: 0 4px 16px rgba(0,0,0,0.12);
  --transition: 0.2s ease;

  /* ── Variables de tipografía ── */
  --font-oswald: 'Oswald', 'Impact', 'Arial Narrow', sans-serif;
  --font-avenir: 'Avenir Next', 'Avenir', 'Century Gothic', 'Trebuchet MS', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-avenir);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

/* ── Asignación de tipografías ───────────────────────────────
   Oswald  → títulos, encabezados, hero, secciones
   Avenir  → cuerpo, descripciones, etiquetas, nav links
   ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-oswald);
  letter-spacing: 0.3px;
}

.hero-title   { font-family: var(--font-oswald); }
.section-title { font-family: var(--font-oswald); letter-spacing: 1px; }
.feature-card h3 { font-family: var(--font-oswald); }

.hidden { display: none !important; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: #ba0c2f;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  border-bottom: 8px solid #ffffff;
}

.nav-brand { flex: 0 0 auto; }
.nav-logo {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 10px;
  margin-left: 16px;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 1.5rem;
  font-family: var(--font-oswald);
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover { background: rgba(255,255,255,0.12); color: var(--white); }

.nav-logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 1.5rem;
  font-family: var(--font-oswald);
  transition: background var(--transition), color var(--transition);
}
.nav-logout-btn:hover { background: rgba(255,255,255,0.12); color: var(--white); }

.nav-auth, .nav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-user span {
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  margin-right: 4px;
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-family: var(--font-oswald);
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.6); }
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }
.btn-outline.dark { color: var(--navy); border-color: var(--navy); }
.btn-outline.dark:hover { background: var(--navy); color: var(--white); }
.btn-navy { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-navy:hover { background: var(--navy-dark); border-color: var(--navy-dark); }
.btn-light { border-color: rgba(255,255,255,0.75); }
.btn-lg { padding: 13px 28px; font-size: 1.5rem; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-video,
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 16, 64, 0.25) 0%, rgba(13, 17, 23, 0.25) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  grid-column: 1;
  padding: 60px 48px 60px 8%;
  text-align: left;
  color: var(--white);
}

.hero-logo {
  height: 200px;
  margin-bottom: 100px;
  filter: brightness(0) invert(1);
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-desc {
  font-family: var(--font-avenir);
  font-size: 1.3rem;
  color: rgba(255,255,255,0.85);
  max-width: 480px;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* ===== DASHBOARD (grid de cursos, visible solo al hacer login) ===== */
.dashboard {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 56px) 24px 80px;
  background: var(--gray-100);
}

.dashboard-inner {
  max-width: 1240px;
  margin: 0 auto;
}

.dashboard-greeting {
  font-family: var(--font-oswald);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 40px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 80px 28px;
}

.course-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  transition: transform 0.25s ease;
}
.course-card:hover,
.course-card:focus-visible { transform: translateY(-6px); }
.course-card:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
  border-radius: 12px;
}

.course-card-placeholder { cursor: default; }
.course-card-placeholder:hover,
.course-card-placeholder:focus-visible { transform: none; }

.course-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--navy);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.25s ease;
}
.course-card:hover .course-card-media,
.course-card:focus-visible .course-card-media {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.course-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--gray-100);
}

.course-card-title {
  font-family: var(--font-oswald);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  text-transform: uppercase;
  line-height: 1.3;
  margin: 16px 0 14px;
}

.course-card-progress-track-wrap {
  position: relative;
  width: 75%;
  margin: 0 auto;
  padding-top: 20px;
}
.course-card-plane {
  position: absolute;
  top: 0;
  left: 0%;
  transform: translateX(-50%);
  width: 55px;
  height: 28px;
  object-fit: contain;
  transition: left 0.5s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}
.course-card-progress-track {
  height: 14px;
  background: var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
}
.course-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ba0c2f, #048c07);
  border-radius: 6px;
  width: 0%;
  transition: width 0.6s ease;
}
.course-card-progress-label {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--gray-700);
  text-align: center;
}

@media (max-width: 900px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .course-grid { grid-template-columns: 1fr; }
}

/* Scroll-hint reutilizado dentro del dashboard: recolorea para fondo claro
   y pasa de posición fija (pensada para el hero oscuro) a flujo normal */
.dashboard .scroll-hint {
  position: static;
  margin: 56px auto 0;
  transform: none;
}
.dashboard .scroll-hint-label { color: var(--gray-700); }
.dashboard .scroll-chevrons span { border-color: var(--gray-500); }

/* Scroll hint (visible solo cuando el usuario está logueado) */
.scroll-hint {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}
.scroll-hint-label {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.scroll-chevrons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: bounce-down 1.8s ease-in-out infinite;
}
.scroll-chevrons span {
  display: block;
  width: 26px;
  height: 26px;
  border-right: 3px solid rgba(255, 255, 255, 0.75);
  border-bottom: 3px solid rgba(255, 255, 255, 0.75);
  transform: rotate(45deg);
}
.scroll-chevrons span:nth-child(2) {
  opacity: 0.4;
  margin-top: -14px;
}
@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(10px); }
}

/* ===== FEATURES ===== */
.features {
  padding: 80px 0;
  background: var(--gray-50);
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--white);
  border-radius: 10px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.feature-card:hover { transform: translateY(-4px); }
.feature-icon { font-size: 2.4rem; margin-bottom: 16px; }
.feature-card h3 { color: var(--navy); font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--gray-700); font-size: 0.92rem; }

/* ===== FOOTER ===== */
.footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.55);
  padding: 24px 0;
  text-align: center;
  font-size: 0.84rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-auth { display: none; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--navy-dark);
    flex-direction: column;
    padding: 12px 0;
    gap: 0;
    margin-left: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 24px; border-radius: 0; font-size: 1rem; }

  .nav-user {
    display: none;
    position: absolute;
    top: calc(var(--nav-h) + 8px);
    right: 16px;
    background: var(--navy-dark);
    flex-direction: column;
    align-items: flex-end;
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    gap: 8px;
  }
  .nav-user.open { display: flex; }
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-content {
    grid-column: 1;
    padding: 60px 24px;
    text-align: center;
  }
  .hero-desc   { margin: 0 auto 32px; }
  .hero-actions { justify-content: center; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-lg { width: 100%; max-width: 280px; }
}
