/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', serif;
    line-height: 1.6;
    color: #2c3e50;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease; /* For theme toggle */
}

body.dark-mode {
    background-color: #1e272e;
    color: #f5f5f5;
}

body.dark-mode .navbar {
    background: rgba(30, 39, 46, 0.95);
    color: #f5f5f5;
}

body.dark-mode .nav-menu a {
    color: #f5f5f5;
}

body.dark-mode .nav-menu a:hover {
    color: var(--secondary-color);
}

body.dark-mode .nav-menu a::after {
    background: var(--secondary-color);
}

body.dark-mode .map-section {
    background: #2c3e50;
}

body.dark-mode .map-section h2 {
    color: var(--gold-color);
}

body.dark-mode .map-tooltip {
    background: rgba(255, 255, 255, 0.8);
    color: #2c3e50;
}

body.dark-mode .era-section {
    color: #f5f5f5;
}

body.dark-mode .timeline::before {
    background: var(--secondary-color);
}

body.dark-mode .timeline-marker {
    background: var(--secondary-color);
    border-color: #1e272e;
}

body.dark-mode .timeline-content {
    background: rgba(30, 39, 46, 0.9);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

body.dark-mode .timeline-content h3 {
    color: var(--gold-color);
}

body.dark-mode .event-card {
    background: rgba(30, 39, 46, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .event-card:hover {
    background: rgba(30, 39, 46, 0.7);
}

body.dark-mode .leader-profile {
    background: rgba(30, 39, 46, 0.5);
}

body.dark-mode .leader-profile:hover {
    background: rgba(30, 39, 46, 0.7);
}

body.dark-mode .leader-achievements span {
    background: rgba(30, 39, 46, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f5f5f5;
}

body.dark-mode .nehru-speech {
    background: rgba(30, 39, 46, 0.5);
}

body.dark-mode .achievement-card {
    background: rgba(30, 39, 46, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .achievement-card:hover {
    background: rgba(30, 39, 46, 0.7);
}

body.dark-mode .modal-content {
    background-color: #2c3e50;
    color: #f5f5f5;
}

body.dark-mode .close {
    color: #f5f5f5;
}

body.dark-mode .close:hover {
    color: var(--secondary-color);
}

body.dark-mode .footer {
    background: #1e272e;
    color: #f5f5f5;
}

body.dark-mode .theme-toggle button {
    background-color: #34495e;
    color: #f5f5f5;
    border-color: #f5f5f5;
}

body.dark-mode .theme-toggle button:hover {
    background-color: #4a6984;
}

/* Custom Properties */
:root {
    --primary-color: #ff6b35;
    --secondary-color: #4a90e2;
    --accent-color: #50c878;
    --gold-color: #ffd700;
    --deep-red: #8b0000;
    --cream: #f5f5dc;
    --sepia: rgba(139, 69, 19, 0.1);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.ashoka-chakra {
    width: 40px;
    height: 40px;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Hero Section with Parallax */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.layer-1 {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    opacity: 0.8;
}

.layer-2 {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="paisley" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M10,2 Q15,2 18,8 Q18,15 10,15 Q2,15 2,8 Q2,2 10,2 Z" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23paisley)"/></svg>');
    animation: float 30s ease-in-out infinite;
}

.layer-3 {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.3)"/><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.2)"/><circle cx="80" cy="30" r="1.5" fill="rgba(255,255,255,0.2)"/></svg>');
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    25% { transform: translateY(-20px) translateX(10px); }
    50% { transform: translateY(-10px) translateX(-10px); }
    75% { transform: translateY(-15px) translateX(5px); }
}

.hero-content {
    text-align: center;
    z-index: 2;
    color: white;
    animation: fadeInUp 2s ease-out;
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 20px rgba(255,255,255,0.3); }
    to { text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 30px rgba(255,255,255,0.5); }
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.hero-years {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gold-color);
    margin-bottom: 2rem;
}

.scroll-indicator {
    width: 30px;
    height: 30px;
    color: white;
    animation: bounce 2s infinite;
    cursor: pointer;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Map Section */
.map-section {
    padding: 4rem 2rem;
    background: var(--cream);
    text-align: center;
}

.map-section h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--deep-red);
}

.map-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.india-map {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
}

.map-region {
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-region:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.city {
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { r: 4; opacity: 1; }
    50% { r: 6; opacity: 0.7; }
    100% { r: 4; opacity: 1; }
}

.map-tooltip {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

/* Era Sections */
.era-section {
    min-height: 100vh;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.era-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
}

.era-title.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Mughal Era Styles */
.mughal-era {
    background: linear-gradient(135deg, #8b4513, #deb887);
}

.floating-pattern {
    position: absolute;
    width: 100px;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M25,5 Q35,15 25,25 Q15,15 25,5 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: floatPattern 15s ease-in-out infinite;
}

.pattern-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.pattern-2 {
    top: 60%;
    right: 15%;
    animation-delay: 5s;
}

@keyframes floatPattern {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -20px) rotate(90deg); }
    50% { transform: translate(-10px, -30px) rotate(180deg); }
    75% { transform: translate(-20px, 10px) rotate(270deg); }
}

/* Timeline Styles */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gold-color);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 3rem 0;
    opacity: 0;
    transform: translateX(-50px);
    transition: all 1s ease;
}

.timeline-item.animate {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item:nth-child(even) {
    transform: translateX(50px);
}

.timeline-item.animate:nth-child(even) {
    transform: translateX(0);
}

.timeline-marker {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 20px;
    background: var(--gold-color);
    border: 4px solid white;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: markerPulse 2s infinite;
}

@keyframes markerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
}

.timeline-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 10px;
    margin-left: 60px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 0;
    margin-right: 60px;
}

.timeline-content h3 {
    color: var(--deep-red);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.leader-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.leader-card:hover {
    transform: scale(1.05);
}

.leader-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    background-size: cover;
    background-position: center;
}

.monument-icon {
    width: 60px;
    height: 60px;
    margin-top: 1rem;
    background-size: contain;
    background-repeat: no-repeat;
}

.taj-mahal {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="40" y="60" width="20" height="30" fill="%23f5f5dc"/><circle cx="50" cy="40" r="20" fill="%23f5f5dc"/><polygon points="30,60 70,60 60,40 40,40" fill="%23f5f5dc"/></svg>');
}

/* British Era Styles */
.british-era {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
}

.colonial-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><rect x="10" y="10" width="80" height="80" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/><rect x="20" y="20" width="60" height="60" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></svg>');
    animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.event-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.5s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(50px);
}

.event-card.animate {
    opacity: 1;
    transform: translateY(0);
}

.event-card:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

.event-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.revolt-icon {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="45" y="10" width="10" height="60" fill="%23ff6b35"/><polygon points="50,10 40,25 60,25" fill="%23ff6b35"/><circle cx="50" cy="80" r="10" fill="%23ff6b35"/></svg>');
}

.event-year {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold-color);
    margin-top: 1rem;
}

/* Freedom Era Styles */
.freedom-era {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    position: relative;
}

.flag-animation {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 150px;
    height: 90px;
    animation: wave 3s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(2deg); }
    75% { transform: rotate(-2deg); }
}

.leaders-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.leader-profile {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.5s ease;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: scale(0.8);
}

.leader-profile.animate {
    opacity: 1;
    transform: scale(1);
}

.leader-profile:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

.leader-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 4px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.gandhi-silhouette {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="30" r="15" fill="%23f5f5dc"/><rect x="45" y="45" width="10" height="30" fill="%23f5f5dc"/><circle cx="48" cy="25" r="2" fill="%23000"/><circle cx="52" cy="25" r="2" fill="%23000"/></svg>');
}

.leader-achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.leader-achievements span {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Independence Era Styles */
.independence-era {
    background: linear-gradient(135deg, #000080, #ff6b35, #50c878);
    color: white;
}

.independence-timeline {
    max-width: 800px;
    margin: 0 auto;
}

.independence-moment {
    text-align: center;
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
}

.independence-moment.animate {
    opacity: 1;
    transform: translateY(0);
}

.moment-time {
    font-size: 1.2rem;
    color: var(--gold-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.nehru-speech {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    margin-top: 1rem;
    font-style: italic;
    backdrop-filter: blur(10px);
}

.partition-impact {
    margin-top: 4rem;
    text-align: center;
}

.partition-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    color: var(--gold-color);
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Modern Era Styles */
.modern-era {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.5s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: rotateY(90deg);
}

.achievement-card.animate {
    opacity: 1;
    transform: rotateY(0deg);
}

.achievement-card:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

.achievement-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.agriculture-icon {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50,80 Q30,60 30,40 Q30,20 50,20 Q70,20 70,40 Q70,60 50,80 Z" fill="%2350c878"/><rect x="45" y="80" width="10" height="15" fill="%238b4513"/></svg>');
}

.achievement-year {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gold-color);
    margin-top: 1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.5s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--primary-color);
}

.modal-body {
    padding: 3rem 2rem 2rem;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

.footer-symbols {
    margin-top: 1rem;
}

.lotus {
    width: 30px;
    height: 30px;
    animation: rotate 10s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-content {
        margin-left: 40px;
    }
    
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 40px;
        margin-right: 0;
    }
    
    .timeline-marker {
        left: 20px;
    }
    
    .partition-stats {
        flex-direction: column;
        gap: 2rem;
    }
    
    .leaders-gallery {
        grid-template-columns: 1fr;
    }
    
    .era-title {
        font-size: 2rem;
    }
}

/* Scroll-triggered animations */
.fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
}

.fade-in.animate {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 1s ease;
}

.slide-in-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(100px);
    transition: all 1s ease;
}

.slide-in-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.zoom-in {
    opacity: 0;
    transform: scale(0.5);
    transition: all 1s ease;
}

.zoom-in.animate {
    opacity: 1;
    transform: scale(1);
}

/* Sepia overlay for historical feel */
.sepia-overlay {
    position: relative;
}

.sepia-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--sepia);
    pointer-events: none;
    z-index: 1;
}
