/* assets/css/style.css */
:root {
    --primary-color: #d32f2f; /* Deep red */
    --secondary-color: #333; /* Dark grey for text */
    --bg-color: #ffffff;
    --card-bg: #f7f9fc; /* Light blue-grey card background */
    --shadow: 0 5px 15px rgba(0,0,0,0.08);
    --border-radius: 8px;
}
body {
    font-family: 'Georgia', 'Times New Roman', serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--secondary-color);
    line-height: 1.7;
}
.container {
    max-width: 900px; /* Optimized for single-column readability */
    margin: 0 auto;
    padding: 20px;
}
.sans-serif-font {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
main { padding: 2rem 0; }
.main-header {
    background-color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
nav { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.logo { font-size: 1.8rem; font-weight: 700; color: var(--secondary-color); text-decoration: none; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 2rem; }
.nav-links a { color: #555; text-decoration: none; font-weight: bold; transition: color 0.3s ease; padding-bottom: 5px; border-bottom: 2px solid transparent;}
.nav-links a:hover { color: var(--primary-color); }
.nav-links a.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.page-hero {
    background: linear-gradient(45deg, var(--primary-color), #c62828);
    color: white;
    text-align: center;
    padding: 4rem 1rem;
    margin-bottom: 2rem;
}
.page-hero h1 { margin: 0; font-size: 3rem; }

/* Vertical Timeline Design */
.timeline-container-vertical { position: relative; padding: 2rem 0; margin-left: 1rem; }
.timeline-container-vertical::before { content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 4px; background: #e0e0e0; border-radius: 2px; }
.timeline-item { position: relative; margin-bottom: 2rem; padding-left: 50px; }
.timeline-item-content { background: var(--card-bg); padding: 20px 25px; border-radius: var(--border-radius); box-shadow: var(--shadow); position: relative; border: 1px solid #e8e8e8; cursor: pointer; transition: all 0.3s ease; }
.timeline-item-content:hover { transform: translateX(10px); border-color: var(--primary-color); }
.timeline-item-content::before { content: ''; position: absolute; left: -40px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; background-color: white; border: 4px solid var(--primary-color); border-radius: 50%; z-index: 1; }
.timeline-item-content h3 { margin: 0 0 5px 0; color: var(--secondary-color); font-size: 1.4rem; }
.timeline-item-content .date { font-size: 1rem; font-weight: bold; color: var(--primary-color); margin: 0; padding-bottom: 10px; }
.era-tag { position: absolute; top: 20px; right: 20px; background-color: var(--primary-color); color: white; padding: 3px 10px; border-radius: 15px; font-size: 0.8rem; }

/* NEW: Beautiful UI for Figures and Dynasties */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}
.figure-card, .dynasty-card {
    background: var(--card-bg);
    border: 1px solid #e8e8e8;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    transition: all 0.3s ease;
    border-top: 5px solid var(--primary-color);
}
.figure-card:hover, .dynasty-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}
.figure-card { cursor: pointer; }
.figure-card h3 { margin-top: 0; font-size: 1.5rem; }
.dynasty-card h3 { margin-top: 0; font-size: 1.5rem; border-bottom: 1px solid #ddd; padding-bottom: 10px; margin-bottom: 15px; }
.dynasty-card ul { list-style: none; padding: 0; margin: 0; }
.dynasty-card li { padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.dynasty-card li:last-child { border-bottom: none; }
.dynasty-card .ruler-item { cursor: pointer; transition: background-color 0.2s; }
.dynasty-card .ruler-item:hover { background-color: #e8f0f8; }

/* Modal Styles */
.modal { display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); }
.modal-content { background-color: #fefefe; margin: 5% auto; padding: 30px; border: 1px solid #888; width: 80%; max-width: 800px; border-radius: var(--border-radius); }
.close-btn { color: #aaa; position: absolute; top: 10px; right: 25px; font-size: 35px; font-weight: bold; cursor: pointer; }
.modal-content h2 { color: var(--primary-color); border-bottom: 2px solid #eee; padding-bottom: 10px; }
.footer { text-align: center; padding: 20px; margin-top: 40px; background-color: #333; color: white; }
@media screen and (max-width: 600px) { .nav-links { display: none; } .timeline-container-vertical { margin-left: 0; } .timeline-item { padding-left: 40px; } .timeline-item-content::before { left: -30px; } .era-tag { display: none; } }