/* =====================================================
   Timeline Histórico — Digital Museum Premium
   PRD: Glassmorphism + Year Watermark + Media-First
   ===================================================== */

/* =====================================================
   HEADER + FILTROS
   ===================================================== */

.timeline-header {
    text-align: center;
    padding: 40px 0 20px;
}

.timeline-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    color: #D4AF37 !important;
    margin-bottom: 8px;
}

.timeline-header p {
    color: rgba(255,255,255,0.45);
    font-size: 1rem;
}

/* Filtros — Premium Era Tags */
.timeline-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 40px;
    padding: 0 20px;
}

.timeline-filter-chip {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    padding: 7px 18px;
    border-radius: 24px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-filter-chip:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
    border-color: rgba(255,255,255,0.15);
}

.timeline-filter-chip.active {
    background: rgba(212,175,55,0.12);
    border-color: rgba(212,175,55,0.4);
    color: #D4AF37;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(212,175,55,0.08);
}

/* =====================================================
   TIMELINE VERTICAL — Estructura
   ===================================================== */

.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0 60px;
}

/* Línea central — gradiente dorado radiante */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent 0%, #D4AF37 8%, #f5d060 50%, #D4AF37 92%, transparent 100%);
    transform: translateX(-50%);
    opacity: 0.5;
    box-shadow: 0 0 12px rgba(212,175,55,0.3), 0 0 30px rgba(212,175,55,0.1);
}

/* Items — fade-in con IntersectionObserver */
.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 40px 40px 0;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.timeline-visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 50px;
    text-align: left;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 50px;
    padding-right: 0;
    text-align: left;
}

/* Nodos dorados — glow exterior */
.timeline-dot {
    position: absolute;
    top: 12px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #D4AF37;
    border: 3px solid #0a0a14;
    box-shadow: 0 0 10px rgba(212,175,55,0.5), 0 0 25px rgba(212,175,55,0.15);
    z-index: 2;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    box-shadow: 0 0 15px rgba(212,175,55,0.7), 0 0 35px rgba(212,175,55,0.3);
    transform: scale(1.2);
}

.timeline-item:nth-child(odd) .timeline-dot { right: -8px; }
.timeline-item:nth-child(even) .timeline-dot { left: -8px; }

/* =====================================================
   TARJETA — Glassmorphism + Year Watermark
   ===================================================== */

.timeline-card {
    background: rgba(14, 14, 26, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.06);
    border-left: 3px solid var(--era-color, #D4AF37);
    border-radius: 16px;
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.timeline-item:nth-child(odd) .timeline-card {
    border-left: 1px solid rgba(255,255,255,0.06);
    border-right: 3px solid var(--era-color, #D4AF37);
}

/* Hover — PRD: translateY + brillo perimetral */
.timeline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 50px rgba(0,0,0,0.4), 0 0 25px rgba(212,175,55,0.05);
    border-color: rgba(212,175,55,0.2) !important;
    background: rgba(20, 20, 38, 0.8);
}

/* =====================================================
   YEAR WATERMARK — PRD §6.3
   Gran marca de agua del año detrás del contenido
   ===================================================== */

.timeline-year-watermark {
    position: absolute;
    top: -15px;
    right: -5px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 7rem;
    font-weight: 700;
    color: var(--era-color, #D4AF37);
    opacity: 0.06;
    line-height: 1;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

.timeline-item:nth-child(odd) .timeline-year-watermark {
    right: auto;
    left: -5px;
}

.timeline-card:hover .timeline-year-watermark {
    opacity: 0.1;
    transition: opacity 0.4s ease;
}

/* =====================================================
   IMAGEN — PRD §6.4 Media-First
   ===================================================== */

.timeline-img-wrapper {
    margin: -28px -28px 20px -28px;
    height: 180px;
    overflow: hidden;
    position: relative;
    border-radius: 16px 16px 0 0;
}

.timeline-item:nth-child(odd) .timeline-img-wrapper {
    border-radius: 16px 13px 0 0;
}

.timeline-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(50%) sepia(10%);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.timeline-card:hover .timeline-img-wrapper img {
    transform: scale(1.05);
    filter: grayscale(10%) sepia(5%);
}

/* Gradiente suave bajo la imagen */
.timeline-img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(14,14,26,0.95) 0%, rgba(14,14,26,0.3) 50%, transparent 100%);
    pointer-events: none;
}

/* =====================================================
   CONTENIDO — z-index sobre watermark
   ===================================================== */

.timeline-content {
    position: relative;
    z-index: 1;
}

/* Año visible (pequeño, encima del título) */
.timeline-year {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--era-color, #D4AF37);
    opacity: 0.6;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

/* Título */
.timeline-title {
    font-family: Georgia, 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.35;
}

.timeline-title i {
    color: var(--era-color, #D4AF37);
    margin-right: 8px;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Descripción */
.timeline-desc {
    color: rgba(255,255,255,0.5);
    font-size: 0.84rem;
    line-height: 1.65;
    margin-bottom: 14px;
}

/* =====================================================
   ERA BADGE — PRD §6.5 Premium Era Tags
   ===================================================== */

.timeline-era-badge {
    display: inline-block;
    background: rgba(212,175,55,0.06);
    color: #D4AF37;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px solid rgba(212,175,55,0.18);
    position: relative;
    z-index: 1;
}

/* =====================================================
   SEPARADORES DE ERA
   ===================================================== */

.timeline-era-separator {
    text-align: center;
    padding: 40px 0 24px;
    position: relative;
    clear: both;
    width: 100%;
}

.timeline-era-separator span {
    background: rgba(10,10,18,0.9);
    backdrop-filter: blur(8px);
    padding: 10px 28px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--era-color, #D4AF37);
    position: relative;
    z-index: 3;
    border: 1px solid var(--era-color, #D4AF37);
    border-radius: 30px;
    box-shadow: 0 0 20px rgba(212,175,55,0.06);
}

/* =====================================================
   RESPONSIVE — Mobile First
   ===================================================== */

@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding-left: 50px;
        padding-right: 15px;
        text-align: left;
    }

    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 12px;
        right: auto;
    }

    .timeline-item:nth-child(odd) .timeline-card {
        border-left: 3px solid var(--era-color, #D4AF37);
        border-right: 1px solid rgba(255,255,255,0.06);
    }

    .timeline-item:nth-child(odd) .timeline-year-watermark {
        right: -5px;
        left: auto;
    }

    .timeline-year-watermark {
        font-size: 5rem;
    }

    .timeline-header h1 {
        font-size: 1.8rem;
    }

    .timeline-img-wrapper {
        height: 140px;
    }
}

/* =====================================================
   SALÓN DE LA FAMA (Leyendas)
   ===================================================== */

.legends-header {
    text-align: center;
    padding: 40px 0 30px;
}

.legends-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    color: #D4AF37 !important;
    margin-bottom: 8px;
}

.legends-header p {
    color: rgba(255,255,255,0.5);
    font-size: 1rem;
}

/* Grid de leyendas */
.legends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 0 0 60px;
}

/* Tarjeta de leyenda */
.legends-card {
    background: rgba(20, 20, 35, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: center;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.legends-card:hover {
    background: rgba(30, 30, 50, 0.8);
    border-color: rgba(212,175,55,0.2);
    box-shadow: 0 12px 40px rgba(212,175,55,0.1);
    transform: translateY(-4px);
}

/* Avatar — foto real con borde dorado */
.legends-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #D4AF37;
    margin-bottom: 20px;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(212,175,55,0.2), 0 0 40px rgba(212,175,55,0.08);
    flex-shrink: 0;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.legends-card:hover .legends-avatar {
    box-shadow: 0 0 25px rgba(212,175,55,0.35), 0 0 50px rgba(212,175,55,0.12);
    transform: scale(1.05);
}

/* Fallback con iniciales (si no hay imagen) */
.legends-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #D4AF37;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(184,115,51,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    color: #D4AF37;
    box-shadow: 0 0 20px rgba(212,175,55,0.15);
    flex-shrink: 0;
}

.legends-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.legends-years {
    color: rgba(255,255,255,0.35);
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.legends-nickname {
    color: #D4AF37;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.legends-highlight {
    color: rgba(255,255,255,0.5);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.legends-role-badge {
    display: inline-block;
    background: rgba(212,175,55,0.1);
    color: #D4AF37;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.legends-btn {
    display: inline-block;
    background: linear-gradient(135deg, #D4AF37, #b8860b);
    color: #000 !important;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.legends-btn:hover {
    box-shadow: 0 4px 15px rgba(212,175,55,0.3);
    transform: translateY(-1px);
}

/* =====================================================
   GLASS PANEL — Componente reutilizable
   ===================================================== */

.glass-panel {
    background: rgba(18, 18, 30, 0.65) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

/* =====================================================
   DETALLE DE LEYENDA — Vista biografía
   ===================================================== */

/* Botón volver */
.legend-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(212, 175, 55, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.25s ease;
    background: rgba(212, 175, 55, 0.05);
}

.legend-back-btn:hover {
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.12);
    transform: translateX(-3px);
}

.legend-back-btn i {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.legend-back-btn:hover i {
    transform: translateX(-3px);
}

/* Grid de detalle */
.legend-detail {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    padding-bottom: 60px;
}

/* Columna principal */
.legend-detail-main {
    padding: 36px 40px;
}

.legend-detail-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #D4AF37 !important;
    margin-bottom: 4px;
    line-height: 1.2;
}

.legend-detail-nickname {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.95rem;
    font-style: italic;
    margin-bottom: 8px;
    font-family: Georgia, serif;
}

.legend-detail-meta {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.82rem;
    margin-bottom: 0;
}

.legend-detail-meta i {
    color: rgba(212, 175, 55, 0.5);
    margin-right: 6px;
    font-size: 0.75rem;
}

/* Separador decorativo */
.legend-separator {
    height: 1px;
    background: linear-gradient(90deg, #D4AF37, rgba(212,175,55,0.1), transparent);
    margin: 20px 0 24px;
}

/* Biografía */
.legend-detail-bio {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.85;
}

.legend-detail-bio p {
    margin-bottom: 16px;
}

/* Entradilla — primer párrafo destacado */
.legend-lead {
    font-size: 1.05rem !important;
    color: rgba(255, 255, 255, 0.75) !important;
    line-height: 1.75 !important;
    font-weight: 400;
    border-left: 3px solid #D4AF37;
    padding-left: 16px;
    margin-bottom: 20px !important;
}

/* Sidebar */
.legend-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Título de sección sidebar */
.legend-sidebar-title {
    color: #D4AF37;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.legend-sidebar-title i {
    margin-right: 8px;
    font-size: 0.75rem;
}

/* Grado máximo */
.legend-grade {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    color: #D4AF37;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

/* =====================================================
   PALMARÉS PREMIUM
   ===================================================== */

.palmares-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.palmares-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
}

.palmares-list li.last {
    border-bottom: none;
}

.palmares-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: #D4AF37;
    margin-top: 5px;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
}

/* =====================================================
   NAVEGACIÓN LEYENDAS SIDEBAR
   ===================================================== */

.legend-nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legend-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 7px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.legend-nav-link:hover {
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.08);
}

.legend-nav-link i {
    font-size: 0.6rem;
    color: rgba(212, 175, 55, 0.4);
    transition: transform 0.2s ease;
}

.legend-nav-link:hover i {
    transform: translateX(3px);
    color: #D4AF37;
}

/* Enlace al timeline */
.legend-timeline-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px !important;
    text-decoration: none;
    color: #D4AF37;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-color: rgba(212, 175, 55, 0.15) !important;
}

.legend-timeline-link:hover {
    background: rgba(212, 175, 55, 0.1) !important;
    border-color: rgba(212, 175, 55, 0.3) !important;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.1) !important;
}

.legend-timeline-link i {
    font-size: 1rem;
}

/* =====================================================
   RESPONSIVE LEYENDAS
   ===================================================== */

@media (max-width: 768px) {
    .legend-detail {
        grid-template-columns: 1fr;
    }

    .legend-detail-main {
        padding: 24px 20px;
    }

    .legend-detail-title {
        font-size: 1.7rem;
    }

    .legends-header h1 {
        font-size: 1.8rem;
    }
}
