:root {
    --primary-green: #093916;
    --primary-gold: #eaa321;
    --dark-green: #041a0b;
    --light-gold: #f8e3be;
    --glass-bg: rgba(255, 255, 255, 0.18);
    --glass-border: rgba(255, 255, 255, 0.25);
}

body {
    font-family: 'Playfair Display', 'Georgia', serif; /* Elegant serif font */
    background-color: #f9f8f5;
    color: #333;
    line-height: 1.8;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Hero Section - Fixed centering */
.history-hero {
    text-align: center;
    padding: 0;
    position: relative;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    isolation: isolate;
    width: 100%;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(9, 57, 22, 0.85), rgba(4, 26, 11, 0.95)),
                url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -2;
    transform: scale(1.1);
    animation: bgScale 20s infinite alternate;
}

@keyframes bgScale {
    0% { transform: scale(1.1); }
    100% { transform: scale(1.15); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(9,57,22,0.7) 0%, rgba(4,26,11,0.95) 100%);
    z-index: -1;
}

.hero-content {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 30px;
    padding: 60px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    max-width: 900px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 1.5s ease 0.5s forwards;
    margin: 0 auto;
}

.history-title {
    font-family: 'Playfair Display', serif;
    font-size: calc(2rem + 3vw);
    font-weight: 900;
    margin-bottom: 20px;
    color: var(--primary-gold);
    text-shadow: 0 5px 15px rgba(0,0,0,0.3);
    line-height: 1.1;
    letter-spacing: 1px;
    background: linear-gradient(to right, var(--primary-gold), var(--light-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.history-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-gold);
    border-radius: 2px;
}

.history-subtitle {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 40px;
    color: white;
    font-weight: 300;
    opacity: 0.9;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-align: center;
}

.explore-btn {
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--light-gold) 100%);
    color: var(--primary-green);
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    box-shadow: 0 15px 35px rgba(234, 163, 33, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 1s ease 1s forwards;
}

.explore-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(234, 163, 33, 0.6);
}

/* Timeline Section - Initially hidden */
.timeline-section {
    display: none;
    position: relative;
    padding: 80px 0;
    margin: 0 auto;
    opacity: 1;
    width: 100%;
}

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

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-gold), var(--primary-green));
    z-index: 1;
    box-shadow: 0 0 30px rgba(234, 163, 33, 0.6);
}

.timeline-container {
    position: relative;
    margin-bottom: 100px;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
    width: 100%;
}

.timeline-container.visible {
    opacity: 1;
}

/* Alternating layout for timeline items */
.timeline-container:nth-child(odd) .row {
    flex-direction: row;
}

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

.timeline-content {
    padding: 30px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 2;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.4);
    height: 100%;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(234,163,33,0.08) 0%, rgba(9,57,22,0.05) 100%);
    z-index: -1;
}

.timeline-content:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 70px rgba(0,0,0,0.2), 0 0 0 2px var(--primary-gold);
}

.timeline-image-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    height: 100%;
    min-height: 250px;
}

.timeline-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.timeline-image-container:hover .timeline-image {
    transform: scale(1.05);
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(4,26,11,0.9) 0%, transparent 100%);
    color: white;
    padding: 20px 15px 10px;
    font-style: italic;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.timeline-image-container:hover .image-caption {
    transform: translateY(0);
}

.timeline-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    border: 6px solid var(--primary-green);
    z-index: 3;
    box-shadow: 0 0 0 6px var(--primary-gold), 0 0 30px rgba(234,163,33,0.8);
}

.timeline-year {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    padding: 8px 20px;
    border-radius: 30px;
    letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(9,57,22,0.3);
}

.timeline-heading {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 15px;
    line-height: 1.3;
}

.timeline-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-gold);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.timeline-content:hover .timeline-heading::after {
    width: 90px;
}

.timeline-text {
    margin-bottom: 15px;
    color: #555;
}

/* Floating Decorations */
.floating {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-gold) 0%, rgba(234,163,33,0) 70%);
    opacity: 0.15;
    z-index: 0;
    animation: float 8s ease-in-out infinite;
    filter: blur(2px);
}

/* Section Transition */
.section-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    z-index: 1000;
    transform: scaleY(0);
    transform-origin: bottom;
    pointer-events: none;
    transition: transform 0.8s cubic-bezier(0.86, 0, 0.07, 1);
}

.hero-removed {
    opacity: 0;
    pointer-events: none;
    height: 0;
    padding: 0;
    overflow: hidden;
}

/* Loading Bar Animation */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-gold), var(--light-gold));
    z-index: 9999;
    transition: width 0.3s ease;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg) scale(1); }
    50% { transform: translateY(-20px) rotate(5deg) scale(1.03); }
    100% { transform: translateY(0px) rotate(0deg) scale(1); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer Styles */
.footer {
    background-color: var(--primary-green);
    color: white;
    padding: 40px 0 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 0 20px;
}

.footer-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-column h4 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-column p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.footer-image img {
    width: 100px;
    height: 100px;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Enhanced Popup styles */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    pointer-events: auto;
    transition: opacity 0.3s ease-in-out;
}

.popup.show {
    display: flex;
    opacity: 1;
}

.popup-content {
    background: linear-gradient(135deg, #ffffff, #f1f1f1);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    z-index: 1001;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.4);
    max-width: 400px;
    width: 90%;
    animation: popupFadeIn 0.3s ease-in-out;
}

@keyframes popupFadeIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.popup button {
    margin: 12px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#login-button {
    background-color: #0b461b;
    color: white;
}

#login-button:hover {
    background-color: #FFD700;
}

#cancel-button {
    background-color: #0b461b;
    color: white;
}

#cancel-button:hover {
    background-color: #FFD700;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .hero-content {
        padding: 40px;
    }
    .history-title {
        font-size: calc(1.5rem + 3vw);
    }
    .history-subtitle {
        font-size: 1rem;
    }
    .explore-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
    .timeline::before {
        left: 30px;
    }
    .timeline-dot {
        left: 30px;
    }
    .timeline-container:nth-child(odd) .row,
    .timeline-container:nth-child(even) .row {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .timeline::before {
        left: 15px;
    }
    .timeline-dot {
        top: auto;
        bottom: -40px;
        left: 15px;
        transform: translateX(-50%);
    }
    .timeline-container {
        margin-bottom: 80px;
    }
    .timeline-content, .timeline-image-container {
        margin-bottom: 20px;
    }
    .timeline-heading {
        font-size: 1.5rem;
    }
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    .footer-columns {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .hero-content {
        padding: 30px 20px;
        border-radius: 20px;
    }
    .history-title {
        font-size: calc(1.2rem + 3vw);
    }
    .timeline-content {
        padding: 20px;
    }
    .timeline-year {
        font-size: 1rem;
        padding: 6px 15px;
    }
    .timeline-heading {
        font-size: 1.3rem;
    }
}