/* =========================================================================
   Historical Records Page - CLEAN CSS (NO VERTICAL LINES)
   ========================================================================= */

/* Reset and ensure visibility */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f4f1e8 0%, #e8ddd4 50%, #d4c4a0 100%);
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    padding-top: 156px;
}

/* Typography */
.title-en, .section-en, .card-en, .nav-en, .btn-en, .footer-en, .logo-text-en,
.subtitle-en, .desc-en, .card-desc-en, .stat-en, .cta-en, .cta-desc-en,
.footer-desc-en, .link-en, .platform-desc-en, .contact-en, .copyright-en,
.manuscript-en, .ruler-en, .event-en, .method-en, .achieve-en,
.result-en, .detail-en {
    font-family: 'Playfair Display', serif;
}

.title-bo, .section-bo, .card-bo, .nav-bo, .btn-bo, .footer-bo, .logo-text-bo,
.subtitle-bo, .desc-bo, .card-desc-bo, .stat-bo, .cta-bo, .cta-desc-bo,
.footer-desc-bo, .link-bo, .platform-desc-bo, .contact-bo, .copyright-bo,
.manuscript-bo, .ruler-bo, .event-bo, .method-bo, .achieve-bo,
.result-bo, .detail-bo {
    font-family: 'Noto Sans Tibetan', sans-serif;
}

/* Language Toggle */
body.tibetan .title-en, body.tibetan .section-en, body.tibetan .card-en,
body.tibetan .nav-en, body.tibetan .btn-en, body.tibetan .footer-en,
body.tibetan .subtitle-en, body.tibetan .desc-en, body.tibetan .card-desc-en,
body.tibetan .stat-en, body.tibetan .cta-en, body.tibetan .cta-desc-en,
body.tibetan .footer-desc-en, body.tibetan .link-en, body.tibetan .platform-desc-en,
body.tibetan .contact-en, body.tibetan .copyright-en, body.tibetan .logo-text-en,
body.tibetan .manuscript-en, body.tibetan .ruler-en, body.tibetan .event-en,
body.tibetan .method-en, body.tibetan .achieve-en, body.tibetan .result-en,
body.tibetan .detail-en {
    display: none;
}

body:not(.tibetan) .title-bo, body:not(.tibetan) .section-bo, body:not(.tibetan) .card-bo,
body:not(.tibetan) .nav-bo, body:not(.tibetan) .btn-bo, body:not(.tibetan) .footer-bo,
body:not(.tibetan) .subtitle-bo, body:not(.tibetan) .desc-bo, body:not(.tibetan) .card-desc-bo,
body:not(.tibetan) .stat-bo, body:not(.tibetan) .cta-bo, body:not(.tibetan) .cta-desc-bo,
body:not(.tibetan) .footer-desc-bo, body:not(.tibetan) .link-bo, body:not(.tibetan) .platform-desc-bo,
body:not(.tibetan) .contact-bo, body:not(.tibetan) .copyright-bo, body:not(.tibetan) .logo-text-bo,
body:not(.tibetan) .manuscript-bo, body:not(.tibetan) .ruler-bo, body:not(.tibetan) .event-bo,
body:not(.tibetan) .method-bo, body:not(.tibetan) .achieve-bo, body:not(.tibetan) .result-bo,
body:not(.tibetan) .detail-bo {
    display: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================================
   1. Hero Section
   ========================================================================= */
.historical-hero {
    height: 100vh;
    background: linear-gradient(rgba(139, 69, 19, 0.7), rgba(160, 82, 45, 0.7)),
        url('https://images.unsplash.com/photo-1481627834876-b7833e8f5570?w=1920&h=1080&fit=crop') center/cover;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.6), rgba(205, 133, 63, 0.6));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 20px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    margin-bottom: 40px;
    opacity: 0.95;
    line-height: 1.7;
}

.breadcrumb {
    margin-top: 30px;
    opacity: 0.9;
    font-size: 1rem;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: white;
}

.separator {
    margin: 0 10px;
}

.current {
    font-weight: 600;
}

/* Floating Documents Animation */
.floating-documents {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.doc-icon {
    position: absolute;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.2);
    animation: float-documents 6s ease-in-out infinite;
}

.doc-icon:nth-child(1) {
    top: 20%;
    left: 10%;
}

.doc-icon:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.doc-icon:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float-documents {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* =========================================================================
   2. Section Navigation Dots
   ========================================================================= */
.section-navigation {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(139, 69, 19, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-dot:hover,
.nav-dot.active {
    background: #CD853F;
    transform: scale(1.2);
}

.nav-dot::before {
    content: attr(title);
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav-dot:hover::before {
    opacity: 1;
}

/* =========================================================================
   3. Content Sections
   ========================================================================= */
.content-section {
    padding: 100px 0;
    display: block;
    opacity: 1;
    visibility: visible;
}

.content-section:nth-child(odd) {
    background: linear-gradient(135deg, #f9f6f0 0%, #f0e6d2 100%);
}

.content-section:nth-child(even) {
    background: linear-gradient(135deg, #f4f1e8 0%, #e8ddd4 100%);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #8B4513;
    margin-bottom: 20px;
}

.section-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* =========================================================================
   4. Historical Categories
   ========================================================================= */
.historical-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.category-card {
    background: white;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(139, 69, 19, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(139, 69, 19, 0.15);
    border-color: #CD853F;
}

.card-icon {
    font-size: 3rem;
    color: #8B4513;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.category-card:hover .card-icon {
    color: #CD853F;
    transform: scale(1.1);
}

.category-card h3 {
    font-size: 1.5rem;
    color: #8B4513;
    margin-bottom: 15px;
}

.category-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.category-stats {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.stat {
    background: linear-gradient(135deg, #8B4513 0%, #CD853F 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}

/* =========================================================================
   5. Archive Search
   ========================================================================= */
.archive-search {
    margin: 50px 0;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.1);
}

.search-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 2;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #CD853F;
}

.filter-select {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #CD853F;
}

/* Search Results */
.search-results {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.1);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(139, 69, 19, 0.15);
    border-color: #CD853F;
}

.result-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B4513 0%, #CD853F 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.result-content {
    flex: 1;
}

.result-content h4 {
    font-size: 1.3rem;
    color: #8B4513;
    margin-bottom: 10px;
}

.result-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.result-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #888;
}

/* =========================================================================
   6. Manuscript Grid
   ========================================================================= */
.manuscript-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.manuscript-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(139, 69, 19, 0.1);
    transition: all 0.3s ease;
}

.manuscript-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(139, 69, 19, 0.15);
}

.manuscript-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

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

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

.manuscript-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(139, 69, 19, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.manuscript-image:hover .manuscript-overlay {
    opacity: 1;
}

.view-btn {
    background: none;
    border: 2px solid white;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: white;
    color: #8B4513;
}

.manuscript-content {
    padding: 30px;
}

.manuscript-content h3 {
    font-size: 1.4rem;
    color: #8B4513;
    margin-bottom: 15px;
}

.manuscript-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.manuscript-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.detail {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8B4513;
    font-size: 14px;
    font-weight: 500;
}

.detail i {
    color: #CD853F;
}

/* =========================================================================
   7. Royal Lineage - NO VERTICAL LINES
   ========================================================================= */
.royal-lineage-timeline {
    position: relative;
    margin-top: 50px;
    display: block;
    opacity: 1;
    visibility: visible;
}

.lineage-era {
    margin-bottom: 80px;
    display: block;
    opacity: 1;
    visibility: visible;
}

.era-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    z-index: 2;
}

.era-header h3 {
    font-size: 1.8rem;
    color: #8B4513;
    margin-bottom: 15px;
    background: white;
    padding: 20px 40px;
    border-radius: 25px;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.1);
}

.era-header p {
    color: #666;
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.rulers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    position: relative;
    opacity: 1;
    visibility: visible;
}

.ruler-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(139, 69, 19, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    display: block;
    opacity: 1;
    visibility: visible;
}

.ruler-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(139, 69, 19, 0.15);
    border-color: #CD853F;
}

.ruler-card.featured {
    border-color: #CD853F;
    background: linear-gradient(135deg, #fff 0%, #f9f6f0 100%);
}

.ruler-card.featured::before {
    content: '👑';
    position: absolute;
    top: -10px;
    right: -10px;
    background: #CD853F;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ruler-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #8B4513 0%, #CD853F 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
}

.ruler-card:hover .ruler-icon {
    transform: scale(1.1);
}

.ruler-card h4 {
    font-size: 1.3rem;
    color: #8B4513;
    margin-bottom: 15px;
    text-align: center;
}

.ruler-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.achievements {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.achievement {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 14px;
    color: #8B4513;
    border-left: 4px solid #CD853F;
}

/* =========================================================================
   8. Historical Timeline - NO VERTICAL LINES
   ========================================================================= */
.timeline-container {
    position: relative;
    margin-top: 50px;
    display: block;
    opacity: 1;
    visibility: visible;
}

.timeline-event {
    display: flex;
    align-items: center;
    margin-bottom: 60px;
    position: relative;
    opacity: 1;
    visibility: visible;
}

.timeline-event:nth-child(even) {
    flex-direction: row-reverse;
}

.event-marker {
    background: linear-gradient(135deg, #8B4513 0%, #CD853F 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    margin: 0 40px;
    white-space: nowrap;
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.3);
    z-index: 2;
    position: relative;
}

.event-content {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(139, 69, 19, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.timeline-event:hover .event-content {
    transform: translateY(-5px);
    border-color: #CD853F;
    box-shadow: 0 25px 50px rgba(139, 69, 19, 0.15);
}

.event-content h3 {
    font-size: 1.4rem;
    color: #8B4513;
    margin-bottom: 15px;
}

.event-content p {
    color: #666;
    line-height: 1.6;
}

/* =========================================================================
   9. Preservation Methods
   ========================================================================= */
.preservation-methods {
    margin-top: 50px;
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.method-card {
    background: white;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(139, 69, 19, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.method-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(139, 69, 19, 0.15);
    border-color: #CD853F;
}

.method-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #8B4513 0%, #CD853F 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 32px;
    color: white;
    transition: all 0.3s ease;
}

.method-card:hover .method-icon {
    transform: scale(1.1) rotate(5deg);
}

.method-card h3 {
    font-size: 1.4rem;
    color: #8B4513;
    margin-bottom: 20px;
}

.method-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

.method-stats {
    background: linear-gradient(135deg, #f9f6f0 0%, #f0e6d2 100%);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #CD853F;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #8B4513;
    display: block;
}

.stat-desc-en,
.stat-desc-bo {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* =========================================================================
   10. Preservation Achievements
   ========================================================================= */
.preservation-achievements {
    margin-top: 60px;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(139, 69, 19, 0.1);
}

.achievement-header {
    text-align: center;
    margin-bottom: 40px;
}

.achievement-header h3 {
    font-size: 1.6rem;
    color: #8B4513;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.achievement-item {
    text-align: center;
    padding: 30px;
    border-radius: 15px;
    background: linear-gradient(135deg, #f9f6f0 0%, #f0e6d2 100%);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.achievement-item:hover {
    border-color: #CD853F;
    transform: translateY(-5px);
}

.achieve-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B4513 0%, #CD853F 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: white;
}

.achievement-item h4 {
    font-size: 1.2rem;
    color: #8B4513;
    margin-bottom: 15px;
}

.achievement-item p {
    color: #666;
    line-height: 1.6;
}

/* =========================================================================
   11. Fade-in Animation
   ========================================================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in[data-delay="0.1"] { transition-delay: 0.1s; }
.fade-in[data-delay="0.2"] { transition-delay: 0.2s; }
.fade-in[data-delay="0.3"] { transition-delay: 0.3s; }
.fade-in[data-delay="0.4"] { transition-delay: 0.4s; }

/* =========================================================================
   12. Responsive Design
   ========================================================================= */
@media (max-width: 1024px) {
    .timeline-event {
        flex-direction: column;
        text-align: center;
    }
    
    .timeline-event:nth-child(even) {
        flex-direction: column;
    }
    
    .event-marker {
        margin: 20px 0;
    }
    
    .section-navigation {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .historical-hero {
        background-attachment: scroll;
        margin-top: 156px;
        height: 80vh;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-navigation {
        display: none;
    }
    
    .content-section {
        padding: 80px 0;
    }
    
    .historical-categories,
    .manuscript-grid,
    .rulers-grid,
    .method-grid,
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .result-item {
        flex-direction: column;
        text-align: center;
    }
    
    .timeline-event {
        margin-bottom: 40px;
    }
    
    .event-content {
        padding: 20px;
    }
    
    .category-card,
    .manuscript-card,
    .ruler-card,
    .method-card {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .content-section {
        padding: 60px 0;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .search-input,
    .filter-select {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .result-item {
        padding: 20px;
    }
    
    .manuscript-content {
        padding: 20px;
    }
    
    .preservation-achievements {
        padding: 20px;
    }
    
    .floating-documents {
        display: none;
    }
}

/* =========================================================================
   13. Print Styles
   ========================================================================= */
@media print {
    .section-navigation,
    .floating-social,
    .nav-bottom {
        display: none !important;
    }
    
    .content-section {
        page-break-inside: avoid;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .historical-hero {
        height: 50vh;
        background: #8B4513;
        color: white;
    }
}

/* =========================================================================
   14. Force Visibility for All Sections
   ========================================================================= */
#royal-lineage,
#timeline,
#overview,
#categories,
#manuscripts,
#preservation {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.royal-lineage-timeline,
.timeline-container,
.lineage-era,
.rulers-grid,
.timeline-event {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.rulers-grid {
    display: grid !important;
}

.timeline-event {
    display: flex !important;
}
