/* Explore Page Styles */

.explore-page {
    background-color: #fff;
}

/* Hero Section */
.explore-hero {
    position: relative;
    height: 400px;
    background: linear-gradient(135deg, #990000 0%, #cc0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.explore-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Pattern gradient thay thế cho pattern.png */
    background:
        repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.03) 10px,
            rgba(255, 255, 255, 0.03) 20px);
    opacity: 0.5;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-family: 'Patriot', 'Playfair Display', serif;
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 300;
    line-height: 1.6;
    opacity: 0.95;
}

/* Search Section */
.search-section {
    background-color: #f8f8f8;
    padding: 30px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.search-section .container {
    max-width: 800px;
    margin: 0 auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.filter-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

.search-box input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #990000;
    box-shadow: 0 0 0 4px rgba(153, 0, 0, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn i {
    font-size: 16px;
}

.filter-btn:hover {
    border-color: #990000;
    color: #990000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(153, 0, 0, 0.15);
}

.filter-btn.active {
    background-color: #990000;
    border-color: #990000;
    color: white;
}

/* Heroes Grid Section */
.heroes-section {
    padding: 60px 20px;
}

.heroes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.hero-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
}

.hero-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.card-image {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Fallback khi ảnh không load */
.card-image img:not([src]),
.card-image img[src=""] {
    display: none;
}

.card-image:has(img:not([src])),
.card-image:has(img[src=""]) {
    background: linear-gradient(135deg, #990000 0%, #cc0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image:has(img:not([src]))::before,
.card-image:has(img[src=""])::before {
    content: '\f007';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 64px;
    color: rgba(255, 255, 255, 0.3);
}

.hero-card:hover .card-image img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.category-badge {
    background-color: #990000;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-content {
    padding: 24px;
}

.card-name {
    font-family: 'Patriot', 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: #990000;
    margin-bottom: 8px;
}

.card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    margin-bottom: 12px;
}

.card-period {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #999;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-period i {
    color: #990000;
}

.card-description {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #990000;
    text-decoration: none;
    transition: all 0.3s ease;
}

.card-link:hover {
    gap: 12px;
    color: #cc0000;
}

.card-link i {
    transition: transform 0.3s ease;
}

.card-link:hover i {
    transform: translateX(4px);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
}

.no-results i {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
}

.no-results h3 {
    font-family: 'Patriot', 'Playfair Display', serif;
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.no-results p {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: #999;
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, #FFF6EC 0%, #FFE8D6 100%);
    padding: 60px 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.stat-item {
    text-align: center;
}

.stat-item i {
    font-size: 48px;
    color: #990000;
    margin-bottom: 16px;
}

.stat-number {
    font-family: 'Patriot', 'Playfair Display', serif;
    font-size: 48px;
    font-weight: 700;
    color: #990000;
    margin-bottom: 8px;
}

.stat-label {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    color: #666;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .filter-buttons {
        justify-content: center;
    }

    .heroes-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .stat-number {
        font-size: 36px;
    }
}

/* ==================== EXPLORE PAGE TIMELINE (Scope-specific) ==================== */
.explore-page .timeline-content-section {
    background: #fff;
    padding: 40px 0 80px;
}

.explore-page .timeline-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
}

/* Timeline Sidebar */
.explore-page .timeline-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.explore-page .timeline-title {
    font-family: 'Patriot', serif;
    font-size: 24px;
    font-weight: 700;
    color: #990000;
    margin: 0 0 24px 0;
    text-align: center;
}

.explore-page .timeline-sidebar .timeline-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

/* Timeline line */
.explore-page .timeline-sidebar .timeline-list::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 30px;
    bottom: 30px;
    width: 3px;
    background: linear-gradient(180deg, #990000 0%, #F4E9D7 100%);
    border-radius: 2px;
}

.explore-page .timeline-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 12px 18px 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.explore-page .timeline-btn:hover {
    background: transparent;
    transform: translateX(4px);
}

.explore-page .timeline-btn.active {
    background: transparent;
}

.explore-page .timeline-dot {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    background: #990000;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(153, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.explore-page .timeline-btn:hover .timeline-dot {
    transform: scale(1.3);
    box-shadow: 0 0 0 6px rgba(153, 0, 0, 0.1);
}

.explore-page .timeline-btn.active .timeline-dot {
    background: #cc0000;
    transform: scale(1.4);
    box-shadow: 0 0 0 8px rgba(153, 0, 0, 0.15);
}

.explore-page .timeline-label {
    font-family: 'Poppins', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    line-height: 1.4 !important;
    transition: all 0.3s ease;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.explore-page .timeline-btn:hover .timeline-label,
.explore-page .timeline-btn.active .timeline-label {
    color: #990000 !important;
    font-weight: 700 !important;
}

/* Content Area */
.explore-page .content-area {
    min-width: 0;
}

.explore-page .dynasty-section {
    margin-bottom: 80px;
    scroll-margin-top: 80px;
}

.explore-page .dynasty-section:last-child {
    margin-bottom: 0;
}

.explore-page .dynasty-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 3px solid #990000;
}

.explore-page .dynasty-name {
    font-family: 'Patriot', serif;
    font-size: 32px;
    font-weight: 800;
    color: #990000;
    margin: 0 0 8px 0;
}

.explore-page .dynasty-desc {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Card Footer */
.explore-page .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.explore-page .card-stats {
    display: flex;
    gap: 16px;
}

.explore-page .card-stats span {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.explore-page .card-stats i {
    color: #990000;
}

.explore-page .card-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    margin: 4px 0 12px;
}

/* Responsive */
@media (max-width: 1024px) {
    .explore-page .timeline-container {
        grid-template-columns: 240px 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .explore-page .timeline-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .explore-page .timeline-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }

    .explore-page .timeline-sidebar .timeline-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .explore-page .timeline-sidebar .timeline-list::before {
        display: none;
    }

    .explore-page .timeline-btn {
        padding: 10px 16px;
        background: #f5f5f5;
        border: 2px solid transparent;
    }

    .explore-page .timeline-btn:hover,
    .explore-page .timeline-btn.active {
        background: #990000;
        border-color: #990000;
    }

    .explore-page .timeline-btn:hover .timeline-label,
    .explore-page .timeline-btn.active .timeline-label {
        color: #8e1a1a;
    }

    .explore-page .timeline-dot {
        display: none;
    }

    .explore-page .dynasty-section {
        margin-bottom: 60px;
    }

    .explore-page .dynasty-name {
        font-size: 28px;
    }
}