/* === HISTORY PAGE STYLES === */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e3a5f;
    --secondary: #2c5aa0;
    --accent: #4a90e2;
    --gold: #d4af37;
    --light: #f8fafc;
    --dark: #0f172a;
    --card-bg: #1e293b;
    --gray: #94a3b8;
    --gradient: linear-gradient(135deg, #1e3a5f 0%, #4a90e2 100%);
}

html, body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    background: var(--dark);
    color: var(--light);
    line-height: 1.8;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    background: var(--dark);
    color: var(--light);
    line-height: 1.8;
    overflow-x: hidden;
}

/* --- HERO SECTION --- */
.hero-section {
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.8), var(--dark)), url('https://i.ibb.co/rGtYdH0P/miliana-place-de-l-horloge.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 8rem 2rem 6rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--gold);
}

.hero-title {
    font-family: 'Kufam', serif;
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    font-weight: 800;
}

.hero-subtitle {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    color: var(--gold);
    max-width: 800px;
    margin: 0 auto;
}

/* --- CONTAINER & HEADERS --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.section-header {
    padding: 0 2rem;
    margin: 4rem 2rem 2rem 0;
    border-right: 5px solid var(--gold);
    text-align: right;
}

.section-tag {
    display: inline-block;
    color: var(--gold);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.section-title {
    font-family: 'Kufam', serif;
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
}

/* --- VERTICAL TIMELINE STYLES --- */
.timeline-wrapper {
    position: relative;
    padding: 4rem 2rem;
    overflow: hidden;
}

/* The glowing line */
.timeline-line {
    position: absolute;
    right: 50%;
    transform: translateX(50%);
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gold);
    box-shadow: 0 0 15px var(--gold);
    z-index: 1;
}

.timeline-item {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
    opacity: 0; /* For animation */
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Content Card styling */
.timeline-content {
    width: 45%;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0; /* Remove padding to let image fill */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: 0 15px 40px rgba(0,0,0,0.7);
}

/* Alternate sides */
.timeline-item:nth-child(odd) {
    flex-direction: row-reverse; /* Item on Left */
}
.timeline-item:nth-child(odd) .timeline-content {
    margin-left: 5%; /* Spacing from center */
}
.timeline-item:nth-child(even) .timeline-content {
    margin-right: 5%; /* Spacing from center */
}

/* The Center Dot */
.timeline-dot {
    position: absolute;
    right: 50%;
    transform: translateX(50%);
    width: 20px;
    height: 20px;
    background: var(--dark);
    border: 4px solid var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold);
    z-index: 3;
}

/* Date Badge */
.timeline-date {
    position: absolute;
    top: 20px;
    background: var(--gold);
    color: #000;
    padding: 0.5rem 1.5rem;
    font-weight: bold;
    border-radius: 50px 0 0 50px;
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    z-index: 10;
    right: 0; /* Anchor to right of card */
    box-shadow: -2px 2px 5px rgba(0,0,0,0.3);
}

.timeline-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 4px solid var(--gold);
    filter: brightness(0.8);
    transition: filter 0.3s;
}

.timeline-content:hover .timeline-image {
    filter: brightness(1.1);
}

.timeline-body {
    padding: 1.5rem;
}

.timeline-title-text {
    font-family: 'Kufam', serif;
    color: white;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.timeline-desc {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.8;
}

/* --- HORIZONTAL SCROLL (Same as Institution) --- */
.scroll-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2rem 2rem 4rem 2rem;
    gap: 1.5rem;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.scroll-container::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Hide scrollbar for IE, Edge and Firefox */
.scroll-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.game-card {
    flex: 0 0 260px; 
    height: 350px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    background: var(--card-bg);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}
.card-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
    filter: brightness(0.6) grayscale(30%); transition: all 0.6s ease; transform: scale(1.1);
}
.card-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 100%); z-index: 2;
}
.card-content {
    position: absolute; bottom: 0; right: 0; width: 100%; padding: 1.5rem; z-index: 3; text-align: right;
}
.card-title {
    font-family: 'Amiri', serif; font-size: 1.4rem; color: white; margin-bottom: 0.2rem;
}
.card-info { font-size: 0.9rem; color: #cbd5e1; opacity: 0.8; }

.game-card:hover {
    flex: 0 0 300px; transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 0 2px var(--gold); z-index: 10;
}
.game-card:hover .card-bg { filter: brightness(1.1) grayscale(0%); transform: scale(1); }

/* --- HERITAGE GRID --- */
.heritage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0 2rem 4rem;
}

.heritage-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    border-right: 4px solid var(--gold);
    border-top: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}
.heritage-card:hover {
    background: #253347;
    transform: translateY(-5px);
}
.heritage-card h3 {
    color: var(--gold);
    font-family: 'Kufam', serif;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}
.heritage-card p {
    color: #cbd5e1;
    font-size: 0.95rem;
}

/* --- QUOTES --- */
.quote-box {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 2rem;
    margin: 2rem;
    text-align: center;
    border-radius: 15px;
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    color: var(--gold);
}

/* --- RESPONSIVE TIMELINE --- */
@media (max-width: 768px) {
    .timeline-line { right: 20px; }
    .timeline-dot { right: 20px; transform: translateX(50%); }
    
    .timeline-item { flex-direction: column !important; margin-bottom: 3rem; align-items: flex-start; }
    .timeline-content { width: calc(100% - 60px); margin-right: 50px !important; margin-left: 0 !important; }
    
    .section-header { text-align: center; border: none; padding: 0 1rem; margin-right: 0; }
    .game-card { flex: 0 0 220px; height: 300px; }
}
