/* Variables */
:root {
  /* Colores suaves pero atractivos */
  --primary-color: #4a6fa5;
  --secondary-color: #166088;
  --accent-color: #47b39d;
  --background-color: #f9f9f9;
  --text-color: #333333;
  --light-text: #666666;
  --white: #ffffff;

  /* ODS colores */
  --ods-education: #c5192d;
  --ods-inequality: #ff9e00;
  --ods-communities: #56c02b;

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

  /* Bordes */
  --border-radius: 0.5rem;
}

/* Estilos generales */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--background-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
}

h2 {
  font-size: 2.2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

p {
  margin-bottom: var(--spacing-sm);
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: all 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
}

.main-content {
  max-width: 100%;
  overflow-x: hidden;
}

section {
  padding: var(--spacing-xl) 5%;
}

/* Botones */
.cta-button {
  display: inline-block;
  background-color: var(--accent-color);
  color: var(--white);
  padding: 0.8rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  text-align: center;
}

.cta-button:hover {
  background-color: #3a9d85;
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.secondary-button {
  display: inline-block;
  background-color: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  text-align: center;
  margin-left: var(--spacing-sm);
}

.secondary-button:hover {
  background-color: var(--accent-color);
  color: var(--white);
}

/* Hero Section */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 80vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
}

.hero-content {
  flex: 1;
  padding: var(--spacing-lg);
  min-width: 20rem;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20rem;
}

.hero-image img {
  max-width: 100%;
  height: auto;
}

.tagline {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

.description {
  font-size: 1.2rem;
  margin-bottom: var(--spacing-md);
  max-width: 40rem;
}

/* ODS Section */
.ods-section {
  background-color: var(--white);
}

.ods-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-md);
}

.ods-card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  flex: 1;
  min-width: 18rem;
  max-width: 25rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.ods-card:hover {
  transform: translateY(-5px);
}

.ods-icon {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
  height: 5rem;
  width: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 auto var(--spacing-md);
}

.ods-card:nth-child(1) .ods-icon {
  color: var(--ods-education);
  background-color: rgba(197, 25, 45, 0.1);
}

.ods-card:nth-child(2) .ods-icon {
  color: var(--ods-inequality);
  background-color: rgba(255, 158, 0, 0.1);
}

.ods-card:nth-child(3) .ods-icon {
  color: var(--ods-communities);
  background-color: rgba(86, 192, 43, 0.1);
}

/* Features Section */
.features-section {
  background-color: #f0f4f8;
}

.features-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-md);
}

.feature {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  flex: 1;
  min-width: 15rem;
  max-width: 20rem;
  text-align: center;
  transition: all 0.3s ease;
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.feature i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

/* Courses Section */
.courses-section {
  background-color: var(--white);
}

.courses-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-md);
}

.course-level {
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  flex: 1;
  min-width: 15rem;
  max-width: 18rem;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.course-level:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.course-icon {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: var(--spacing-sm);
}

.level-link {
  margin-top: auto;
  display: inline-block;
  color: var(--primary-color);
  font-weight: 600;
  padding: var(--spacing-xs) 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.level-link:hover {
  border-bottom-color: var(--primary-color);
}

/* Call to Action Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--white);
  text-align: center;
  padding: var(--spacing-xl) 5%;
}

.cta-section h2 {
  color: var(--white);
  margin-bottom: var(--spacing-sm);
}

.cta-section p {
  font-size: 1.2rem;
  margin-bottom: var(--spacing-md);
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.cta-section .cta-button {
  background-color: var(--white);
  color: var(--primary-color);
}

.cta-section .cta-button:hover {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--secondary-color);
}

.cta-section .secondary-button {
  border-color: var(--white);
  color: var(--white);
}

.cta-section .secondary-button:hover {
  background-color: var(--white);
  color: var(--primary-color);
}

/* Media Queries */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .hero {
    flex-direction: column;
    text-align: center;
  }

  .hero-content {
    padding: var(--spacing-md);
  }

  .description {
    font-size: 1.1rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .secondary-button {
    margin-left: 0;
    margin-top: var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  section {
    padding: var(--spacing-lg) 5%;
  }

  .ods-card,
  .feature,
  .course-level {
    min-width: 100%;
  }
}

/* Estilos para el menú de usuario */
.user-menu {
  position: relative;
  display: inline-block;
}

.user-button {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  font-size: 14px;
  white-space: nowrap;
}

.user-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.user-button i.fa-chevron-down {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.user-menu.active .user-button i.fa-chevron-down {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  color: black;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown .user-info {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.user-dropdown .user-info strong {
  display: block;
  color: #333;
  font-size: 14px;
  margin-bottom: 2px;
}

.user-dropdown .user-info small {
  color: #666;
  font-size: 12px;
  text-transform: capitalize;
}

.user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #333 !important; /* Color oscuro forzado para contrastar con el fondo blanco */
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.user-dropdown .dropdown-item:hover {
  background-color: #f8f9fa;
  color: var(--primary-color) !important;
}

.user-dropdown .dropdown-item.logout {
  color: #dc3545 !important;
}

.user-dropdown .dropdown-item.logout:hover {
  background-color: #fff5f5;
  color: #dc3545 !important;
}

.dropdown-divider {
  height: 1px;
  background-color: #f0f0f0;
  margin: 4px 0;
}

/* Header */
header {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
  min-height: 3.75rem;
}

/* Asegurarnos de que los enlaces en el header principal sigan siendo blancos */
header nav a,
header .auth-buttons > a /* Solo los enlaces directos en auth-buttons */,
header .user-button {
  color: var(--white);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.logo i {
  color: var(--accent-color);
}

.logo a {
  color: var(--white);
  text-decoration: none;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  white-space: nowrap;
}

nav a:hover {
  color: var(--accent-color);
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.auth-buttons a {
  color: var(--white);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
}

.auth-buttons a:first-child {
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-buttons a:last-child {
  background-color: var(--accent-color);
}

.auth-buttons a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.auth-buttons a:last-child:hover {
  background-color: #3a9d85;
}

/* Responsive para tablets */
@media (max-width: 1024px) {
  header {
    padding: 0.8rem 3%;
  }

  nav ul {
    gap: 1.5rem;
  }

  .auth-buttons {
    gap: 0.8rem;
  }
}

/* Responsive para móviles */
@media (max-width: 768px) {
  header {
    padding: 0.7rem 2%;
    flex-wrap: wrap;
    min-height: auto;
  }

  nav {
    order: 3;
    width: 100%;
    margin-top: 0.5rem;
  }

  nav ul {
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
  }

  .logo {
    font-size: 1.3rem;
  }

  .auth-buttons {
    gap: 0.5rem;
  }

  .auth-buttons a {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .user-dropdown {
    right: -0.625rem;
    min-width: 11.25rem;
  }

  .user-button span {
    display: none;
  }

  .auth-buttons {
    gap: 0.5rem;
  }
}

/* Responsive para móviles pequeños */
@media (max-width: 480px) {
  header {
    padding: 0.5rem 1rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  nav ul {
    gap: 0.8rem;
    font-size: 0.9rem;
  }

  .auth-buttons a {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }

  header {
    padding: 0.5rem 1rem;
  }

  .user-button {
    padding: 0.375rem 0.5rem;
    font-size: var(--user-menu-small-font);
  }

  .user-dropdown {
    right: -1.25rem;
    min-width: 10rem;
  }
}

/* FOOTER */

.footer {
  background-color: #1e293b;
  color: white;
  padding: 5vh 5vw 3vh 5vw;
  font-family: 'Segoe UI', sans-serif;
  font-size: 0.9rem;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4vw;
  max-width: 90vw;
  margin: 0 auto;
}

.footer-column {
  flex: 1 1 20%;
  min-width: 18vw;
}

.footer-column strong {
  font-size: 1.1rem;
  display: block;
  margin-bottom: 1rem;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 0.8rem;
}

.footer-column a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-column a:hover {
  text-decoration: underline;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 1vw;
  margin-bottom: 1rem;
}

.footer-logo i {
  font-size: 1.8rem;
}

.footer-brand {
  font-size: 1.5rem;
  font-weight: bold;
}

.footer-description {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.footer-divider {
  border: none;
  height: 0.1rem;
  background-color: #334155;
  margin: 3vh 0 1.5vh 0;
  width: 100%;
}

.footer-bottom {
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Asegurarnos de que el texto en el botón de usuario sea blanco */
.user-button {
  color: var(--white) !important;
}