.timeline-layout {
   display: flex;
   width: 100vw;
   height: calc(100vh - 56px);
   margin: 0;
   padding: 0;
   overflow: hidden;
   background-color: #242424;
   color: rgba(255, 255, 255, 0.87);
   box-sizing: border-box;
}

.filters-section {
   width: 18vw;
   padding: 1rem;
   padding-right: 1.5rem;
   background-color: #281E94;
   border-right: 1px solid #333;
   height: calc(100vh - 56px);
   display: flex;
   flex-direction: column;
   overflow-y: auto;
   box-sizing: border-box;
}

.filters-section h2 {
   margin: 0 0 0.2rem 0;
   font-size: 1rem;
   padding-left: 0.4rem;
   color: rgba(255, 255, 255, 0.87);
}

.timeline-section {
   width: 82vw;
   padding: 2rem 3rem;
   height: calc(100vh - 56px);
   display: flex;
   flex-direction: column;
   overflow: hidden;
   background: url("../../img/lineaTemporal/FondoLineaTiempo.png") center center/cover no-repeat;
   box-sizing: border-box;
}

.timeline-header {
   position: sticky;
   top: 0;
   left: 0;
   width: 100vw;
   z-index: 100;
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 0.5rem 1rem;
   margin-bottom: 0;
   background: #1B1464;
   backdrop-filter: blur(2px);
   border-bottom: 1px solid #333;
   min-height: 56px;
   box-sizing: border-box;
}

.timeline-header h2 {
   color: #F93B2D;
   margin: 0;
   font-size: 1.1rem;
}

.theme-selector-button {
   background-color: #2a2a2a;
   color: rgba(255, 255, 255, 0.87);
   border: 1px solid #444;
   border-radius: 4px;
   padding: 0.5rem 1rem;
   font-size: 0.9rem;
   cursor: pointer;
   transition: all 0.3s ease;
}

.theme-selector-button:hover {
   background-color: #333;
}

.theme-selector {
   background-color: #281E94;
   padding: 0.4rem;
   border-radius: 6px;
   margin-bottom: 0.4rem;
   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.theme-selector h3 {
   color: rgba(255, 255, 255, 0.87);
   margin: 0 0 0.2rem 0;
   font-size: 0.9rem;
   padding-left: 0.2rem;
}

.theme-checkboxes {
   display: flex;
   flex-direction: column;
   gap: 0.2rem;
}

.theme-checkbox {
   display: flex;
   align-items: center;
   gap: 0.2rem;
   padding: 0.1rem 0.2rem;
   background-color: #333;
   border-radius: 4px;
   cursor: pointer;
   transition: all 0.3s ease;
   border: 1px solid #444;
   font-size: 0.85rem;
}

.theme-checkbox:hover {
   background-color: #404040;
}

.theme-checkbox input[type="checkbox"] {
   width: 14px;
   height: 14px;
   cursor: pointer;
   margin: 0;
}

.timeline {
   position: relative;
   padding: 0.5rem 0;
   padding-left: 2rem;
   padding-right: 2rem;
   flex: 1;
   overflow-y: auto;
   overflow-x: hidden;
}

.timeline::before {
   content: '';
   position: absolute;
   left: calc(50% + 0.5rem);
   transform: translateX(-50%);
   width: 4px;
   min-height: 10000vh;
   background-color: #FEE9CE;
   z-index: 1;
}

.timeline-item {
   position: relative;
   margin-bottom: -2.5rem;
   width: 100%;
   display: flex;
   justify-content: center;
   cursor: pointer;
   transition: transform 0.2s ease;
}

.timeline-item::before {
   content: '';
   position: absolute;
   top: 50%;
   width: 20%;
   height: 3px;
   background-color: #FEE9CE;
   z-index: 1;
}

.timeline-item:nth-child(odd)::before {
   left: 50%;
   transform: translateX(-100%);
}

.timeline-item:nth-child(even)::before {
   right: 50%;
   transform: translateX(100%);
}

.timeline-dot {
   position: absolute;
   top: 50%;
   transform: translate(-0%, -50%);
   width: 16px;
   height: 16px;
   border-radius: 50%;
   z-index: 2;
   background: #FBABA4;
}

.timeline-item:nth-child(odd) .timeline-dot {
   left: 50%;
}

.timeline-item:nth-child(even) .timeline-dot {
   left: 50%;
}

.timeline-content {
   width: 35%;
   padding: 0.9rem;
   background-color: #FEE9CE;
   border-radius: 12px;
   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
   position: relative;
   z-index: 3;
   transition: box-shadow 0.2s ease;
   color: #1B1464;
}

.timeline-item:hover .timeline-content {
   box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
}

.timeline-item:nth-child(odd) .timeline-content {
   margin-right: 65%;
}

.timeline-item:nth-child(even) .timeline-content {
   margin-left: 65%;
}

/* Add connecting line between event and timeline */
.timeline-content::before {
   content: '';
   position: absolute;
   top: 50%;
   width: 15px;
   height: 2px;
   background-color: #FEE9CE;
   z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-content::before {
   right: -15px;
}

.timeline-item:nth-child(even) .timeline-content::before {
   left: -15px;
}

.theme-tag {
   display: inline-block;
   padding: 0.1rem 0.35rem;
   border-radius: 10px;
   color: white;
   font-size: 0.7rem;
   margin-bottom: 0.15rem;
}

.timeline-content h2,
.timeline-content h3,
.timeline-content .event-title {
   font-family: 'Fraunces', serif;
   margin: 0 0 0.1rem 0;
   font-size: 0.9rem;
   line-height: 1.2;
}

.timeline-content p,
.timeline-content .event-description,
.timeline-content .timeline-date,
.timeline-content span,
.timeline-content {
   font-family: 'Poppins', sans-serif;
}

.timeline-content h3 {
   color: rgba(255, 255, 255, 0.87);
   margin: 0 0 0.1rem 0;
   font-size: 0.75rem;
   line-height: 1.1;
}

.timeline-content p {
   color: rgba(255, 255, 255, 0.6);
   margin: 0 0 0.15rem 0;
   font-size: 0.65rem;
   line-height: 1.2;
}

.timeline-date {
   display: block;
   color: rgba(255, 255, 255, 0.6);
   font-weight: bold;
   font-size: 0.65rem;
   margin-top: 0.1rem;
}

.event-image {
   display: block;
   width: 70%;
   height: 40px;
   object-fit: cover;
   border-radius: 4px;
   margin: 6px auto 0 auto;
}

.modal-image-container {
   display: block;
   margin: 16px auto;
   border-radius: 8px;
   box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
   width: fit-content;
}

.modal-image {
   display: block;
   max-width: 100%;
   max-height: 350px;
   width: auto;
   height: auto;
   border-radius: 8px;
   object-fit: contain;
}

.modal-content {
   background-color: #FEE9CE !important;
   border-radius: 18px !important;
   border: 1.5px solid #1B1464 !important;
   font-family: 'Fraunces', serif !important;
}

.modal-content,
.modal-content h2,
.modal-content h3,
.modal-content p,
.modal-content span,
.modal-content .modal-date,
.modal-content div,
.modal-content strong,
.modal-content em {
   color: #1B1464 !important;
}

.modal-content h2,
.modal-content h3 {
   font-family: 'Poppins', sans-serif !important;
   color: #1B1464 !important;
}

.timeline-content h2 {
   font-size: 1.3rem;
}

.timeline-content h3,
.timeline-content .event-title,
.timeline-content>div>div>div>span {
   font-size: 1.1rem;
}

.timeline-content p,
.timeline-content span,
.timeline-content .timeline-date {
   font-size: 1rem;
}

@media (max-width: 768px) {
   .timeline-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.25rem;
      padding: 0.5rem 0.75rem 0.35rem 0.75rem;
      min-height: 42px;
   }

   .timeline-layout {
      flex-direction: column;
      height: auto;
      min-height: calc(100vh - 42px);
   }

   .filters-section {
      display: none;
      height: auto;
   }

   .timeline-section {
      width: 100%;
      height: auto;
      min-height: calc(100vh - 42px);
      padding: 0.75rem;
   }

   .timeline {
      padding: 0.4rem 0;
   }

   .timeline::before {
      left: 25px;
      width: 3px;
   }

   .timeline-dot {
      left: 25px !important;
      width: 12px;
      height: 12px;
   }

   .timeline-content {
      width: calc(100% - 50px);
      margin-left: 50px !important;
      margin-right: 0 !important;
      padding: 0.5rem;
      border-radius: 8px;
   }

   .timeline-item {
      margin-bottom: 0.25rem;
   }

   .timeline-item::before {
      display: none;
   }

   .timeline-item:nth-child(odd) .timeline-content,
   .timeline-item:nth-child(even) .timeline-content {
      margin-left: 50px !important;
      margin-right: 0 !important;
   }

   .timeline-content::before {
      left: -15px;
      right: auto;
      width: 12px;
      height: 2px;
   }

   .timeline-item:nth-child(odd) .timeline-content::before,
   .timeline-item:nth-child(even) .timeline-content::before {
      left: -15px;
      right: auto;
   }

   .timeline-content h2 {
      font-size: 0.85rem;
      margin: 0 0 0.05rem 0;
      font-family: 'Fraunces', serif;
   }

   .timeline-content h3,
   .timeline-content .event-title,
   .timeline-content>div>div>div>span {
      font-size: 0.75rem;
      margin: 0 0 0.05rem 0;
      font-family: 'Fraunces', serif;
   }

   .timeline-content p,
   .timeline-content span,
   .timeline-content .timeline-date {
      font-size: 0.65rem;
      margin: 0 0 0.1rem 0;
      font-family: 'Poppins', sans-serif;
   }

   .event-image {
      width: 60%;
      height: 30px;
      margin: 4px auto 0 auto;
   }
}

/* Efecto hover para la selección visual de temas */
.theme-visual-toggle:hover,
.theme-visual-toggle-modal:hover {
   background: rgba(0, 0, 0, 0.06);
   cursor: pointer;
   border-radius: 6px;
   transition: background 0.15s;
}

/* Estilos específicos para los filtros de temas */
.theme-visual-toggle,
.theme-visual-toggle-modal {
   font-size: 1rem;
   display: flex;
   align-items: flex-start;
   padding: 4px 0;
   min-height: 32px;
   box-sizing: border-box;
}

/* Asegurar que los círculos de color mantengan su forma */
.theme-visual-toggle span:first-of-type,
.theme-visual-toggle-modal span:first-of-type {
   flex-shrink: 0;
   width: 18px;
   height: 18px;
   border-radius: 50%;
   margin-right: 8px;
   display: inline-block;
   transform: translateY(5px);
}

/* Asegurar que los iconos de ojo mantengan su tamaño */
.theme-visual-toggle img,
.theme-visual-toggle-modal img {
   flex-shrink: 0;
   width: 28px;
   height: 28px;
   margin-right: 8px;
}

/* Permitir que el texto se ajuste */
.theme-visual-toggle span:last-of-type,
.theme-visual-toggle-modal span:last-of-type {
   flex: 1;
   word-wrap: break-word;
   overflow-wrap: break-word;
   hyphens: auto;
}

.timeline-content,
.timeline-content h2,
.timeline-content h3,
.timeline-content p,
.timeline-content span,
.timeline-content .timeline-date {
   color: #1B1464;
}

.theme-visual-toggle,
.theme-visual-toggle-modal {
   font-size: 1rem;
}

/* Estilos personalizados para barras de scroll menos invasivas */
.filters-section::-webkit-scrollbar,
.timeline::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
   width: 8px;
}

.filters-section::-webkit-scrollbar-track,
.timeline::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
   background: rgba(255, 255, 255, 0.05);
   border-radius: 4px;
}

.filters-section::-webkit-scrollbar-thumb,
.timeline::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
   background: rgba(255, 255, 255, 0.2);
   border-radius: 4px;
   transition: background 0.3s ease;
}

.filters-section::-webkit-scrollbar-thumb:hover,
.timeline::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
   background: rgba(255, 255, 255, 0.3);
}

/* Para Firefox */
.filters-section,
.timeline,
.modal-content {
   scrollbar-width: thin;
   scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* Ocultar scrollbar cuando no se está usando (opcional) */
.filters-section:not(:hover)::-webkit-scrollbar-thumb,
.timeline:not(:hover)::-webkit-scrollbar-thumb,
.modal-content:not(:hover)::-webkit-scrollbar-thumb {
   background: rgba(255, 255, 255, 0.1);
}

/* Estilos específicos para títulos y descripciones de eventos */
.event-in-year span {
   font-family: 'Fraunces', serif !important;
}

.event-in-year p {
   font-family: 'Poppins', sans-serif !important;
}