
/* Contenedor principal */
.main-container {
  position: relative;
  z-index: 1;
  display: block;
  height: 100vh;
  background: #fbfdfe;
}

/* Page Layout Specific Styles - Only for page.html template */
.page-container {
  max-width: 1250px;
  margin: 40px auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 20px;
}

.page-content-area {
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
}

.page-sidebar-fixed {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  z-index: 1000;
}

/* Responsive design for page layout only */
@media (max-width: 992px) {
  .page-container {
    flex-direction: column !important;
    gap: 30px !important;
  }

  .page-content-area {
    width: 100% !important;
    order: 1 !important;
    flex: none !important;
  }

  .page-sidebar-fixed {
    position: static !important;
    width: 100% !important;
    max-height: none !important;
    overflow-y: visible !important;
    top: auto !important;
    order: 2 !important;
    flex: none !important;
  }
}

@media (max-width: 768px) {
  .page-container {
    margin: 20px auto !important;
    padding: 0 15px !important;
    gap: 20px !important;
    flex-direction: column !important;
  }

  .page-content-area {
    width: 100% !important;
    margin: 0 !important;
  }

  .page-sidebar-fixed {
    width: 100% !important;
    margin: 0 !important;
    position: static !important;
  }
}

@media (max-width: 480px) {
  .page-container {
    margin: 15px auto !important;
    padding: 0 10px !important;
    gap: 15px !important;
  }
}

/* Secciones de contenido con estilo mejorado */
.section {
  background: var(--content-bg);
  padding: 40px;
  backdrop-filter: blur(var(--blur-amount));
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Opción para desactivar estilos de sección */
.section-no-style {
  background: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  border: none !important;
  position: static !important;
  overflow: visible !important;
  z-index: auto !important;
}

.section-no-style::before {
  display: none !important;
}

.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(37, 170, 225, 0.02) 0%,
    rgba(189, 190, 192, 0.01) 50%,
    transparent 100%
  );
  border-radius: 20px;
  pointer-events: none;
  z-index: -1;
}

/* Secciones con backgrounds específicos mantienen su estilo */
.section[style*="background"] {
  backdrop-filter: blur(5px);
}

.section[style*="background"]::before {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%);
}

/* Mejorar el espaciado de párrafos en las secciones */
.section p {
  margin-bottom: 15px;
  line-height: 1.7;
}

/* Aplicar color solo a párrafos normales, excluyendo componentes con colores específicos */
.section p:not([style*="color"]) {
  /* color: var(--text-secondary); */
}

/* Excluir párrafos dentro de divs con colores específicos (como sliders) */
.section div[style*="color: #fff"] p,
.section div[style*="color: #4ec5f2"] p,
.section div[style*="color:#fff"] p,
.section div[style*="color:#4ec5f2"] p {
  color: inherit !important;
}

.section p:last-child {
  margin-bottom: 0;
}

/* Listas en secciones */
.section ul,
.section ol {
  margin-bottom: 20px;
  padding-left: 20px;
}

.section li {
  margin-bottom: 8px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Hero Section */
.hero-section {
  background: var(--content-bg);
  border-radius: 20px;
  padding: 60px 40px;
  margin-bottom: 40px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(37, 170, 225, 0.05) 0%,
    rgba(189, 190, 192, 0.03) 50%,
    transparent 100%
  );
  border-radius: 20px;
  pointer-events: none;
}

.hero-section h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.hero-section p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 30px;
  position: relative;
}

/* Botones consistentes con el menú */
.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.btn {
  padding: 15px 30px;
  border: 2px solid rgba(37, 170, 225, 0.8);
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-size: 16px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  text-decoration: none;
  display: inline-block;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
  transition: all 0.4s ease;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--logo-blue) 0%, #1e88c7 100%);
  color: white;
  border: 2px solid var(--logo-blue);
}

.btn-primary:hover {
  background: var(--header-dark);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(37, 170, 225, 0.4);
  border-color: var(--header-dark);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 170, 225, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--logo-blue);
  border: 2px solid var(--logo-blue);
}

.btn-secondary:hover {
  background: var(--logo-blue);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(37, 170, 225, 0.3);
  border-color: var(--logo-blue);
}

.btn-secondary:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 170, 225, 0.2);
}

/* Efectos adicionales para todos los botones */
.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 170, 225, 0.3);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Grid de contenido */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.content-card {
  background: var(--content-bg);
  border-radius: 15px;
  padding: 30px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.content-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 15px 15px 0 0;
}

.content-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px rgba(44, 62, 80, 0.15);
}

.content-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--header-dark);
}

.content-card p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.content-card .card-link {
  color: var(--logo-blue);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.content-card .card-link:hover {
  color: var(--header-dark);
  transform: translateX(5px);
}

.content-card .card-link::after {
  content: "→";
  transition: transform 0.3s ease;
}

.content-card .card-link:hover::after {
  transform: translateX(3px);
}

/* Sección de estadísticas */
.stats-section {
  background: var(--primary-gradient);
  border-radius: 20px;
  padding: 50px 40px;
  margin-bottom: 40px;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.stats-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(189, 190, 192, 0.05) 50%,
    transparent 100%
  );
  border-radius: 20px;
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  position: relative;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--logo-blue);
  text-shadow: 0 2px 10px rgba(37, 170, 225, 0.3);
}

.stat-label {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Estilos para el slider */
.slider-container {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1250px;
}

.slider-content {
  width: 100%;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  border-radius: 15px;
  padding: 40px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.slider-inner-content {
  width: 60%;
  max-width: 100%;
}

.slider-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(44, 62, 80, 0.7) 0%, rgba(52, 73, 94, 0.5) 100%);
  border-radius: 15px;
  pointer-events: none;
  z-index: -1;
}

.slider-content h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.3;
}

.slider-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 25px;
  color: #4ec5f2;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
}

.slider-description {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.slider-description > div {
  font-size: 1.1rem;
  line-height: 1.6;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.95);
}

.slider-description > div:first-child {
  font-weight: 500;
}

.slider-description > div:last-child {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

/* Estilos para el layout con sidebar fijo */
.content-area {
  width: 78%;
  margin-right: 2%;
}

.sidebar-fixed {
  width: 20%;
  position: fixed;
  right: 20px;
  top: 120px; /* Posición inicial cuando el menú está visible */
  height: calc(100vh - 140px);
  overflow-y: auto;
  z-index: 1000;
  transition: top 0.3s ease-in-out;
}

/* Fix for flex container layout - Control flex behavior properly */
.main-container[style*="display: flex"] {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 20px !important;
  max-width: 1250px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
}

.main-container[style*="display: flex"] .content-area {
  flex: 1 !important;
  width: auto !important;
  margin-right: 0 !important;
  min-width: 0 !important; /* Prevents flex item from overflowing */
}

.main-container[style*="display: flex"] .sidebar-fixed {
  position: static !important;
  width: 300px !important;
  flex-shrink: 0 !important;
  height: auto !important;
  top: auto !important;
  right: auto !important;
  max-height: none !important;
  overflow-y: visible !important;
}

.sidebar-fixed.menu-hidden {
  top: 20px; /* Posición cuando el menú no está visible */
}

/* Responsive: En pantallas pequeñas el sidebar no debe ser fijo */
@media (max-width: 768px) {
  .sidebar-fixed {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    right: auto !important;
    top: auto !important;
    margin-top: 20px;
  }

  .content-area {
    width: 100% !important;
    margin-right: 0 !important;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-container {
    margin: 20px auto;
    padding: 0 15px;
  }

  .hero-section {
    padding: 40px 20px;
  }

  .hero-section h1 {
    font-size: 2.2rem;
  }

  .hero-section p {
    font-size: 1rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .content-card {
    padding: 20px;
  }

  .stats-section {
    padding: 30px 20px;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .slider-content {
    padding: 30px 20px;
  }

  .slider-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }

  .slider-content h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
  }

  .slider-description > div {
    font-size: 1rem;
  }

  .slider-container {
    padding: 15px;
    margin: 20px auto;
  }
}

/* Responsive específico para slider - menos de 600px = contenido interno 100% */
@media (max-width: 600px) {
  .slider-inner-content {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 1.8rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .slider-content {
    padding: 25px 15px;
  }

  .slider-content h2 {
    font-size: 1.6rem;
    line-height: 1.2;
  }

  .slider-content h3 {
    font-size: 1.1rem;
  }

  .slider-description > div {
    font-size: 0.95rem;
  }

  .slider-inner-content {
    width: 100% !important;
  }
}

/* Animaciones de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-section,
.content-card,
.stats-section {
  animation: fadeInUp 0.6s ease-out;
}

.content-card:nth-child(2) {
  animation-delay: 0.1s;
}

.content-card:nth-child(3) {
  animation-delay: 0.2s;
}

.content-card:nth-child(4) {
  animation-delay: 0.3s;
}

.video-container > iframe {
    width: 100%;
    min-height: 400px;
}

.embed-container {
    position: relative;
  width: 100%;
  /* Mantiene proporción 16:9 */
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.embed-container > iframe {
    position: absolute;
  top: 0;
  left: 0;
  width: 90%;
  height: 90%;
  border: 0;
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-links {
    flex: 1;
}

.search-button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 16px;
}

.search-button:hover {
    background-color: #f5f5f5;
    border-color: #999;
    color: #333;
}

.search-button:hover svg {
    stroke: #333 !important;
}

.search-button .search-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.search-button:hover .search-icon circle,
.search-button:hover .search-icon line {
    stroke: #333;
}

.search-button svg {
    display: block;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-overlay.show {
    display: flex;
    opacity: 1;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}

.search-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 70vh;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.search-overlay.show .search-container {
    transform: translateY(0);
}

.search-input-container {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    padding: 10px;
    background: transparent;
}

.search-submit-button, .search-close-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: 8px;
    border-radius: 4px;
    color: #666;
    transition: background-color 0.2s ease;
}

.search-submit-button:hover, .search-close-button:hover {
    background-color: #f5f5f5;
}

.search-loading {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-size: 16px;
    font-weight: 500;
    color: #007bff;
    text-decoration: none;
    display: block;
}

.search-result-title:hover {
    text-decoration: underline;
}

.search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}