/* Global Styles */
:root {
    --primary-color: #D91B5C;
    /* Rotaract Cranberry */
    --secondary-color: #333333;
    --text-color: #555555;
    --light-bg: #f9f9f9;
    --dark-bg: #222222;
    --white: #ffffff;
    --transition: all 0.3s ease;

    /* Material Design Spacing (8px baseline) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    --space-section: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--secondary-color);
    margin-bottom: var(--space-md);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-section) 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xxl);
    position: relative;
    padding-bottom: var(--space-md);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    border-radius: 5px;
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
}

.primary-btn:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.secondary-btn {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.secondary-btn:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Spacing between logos */
}

.logo-secondary {
    height: 40px;
    /* Protocol logos smaller */
    width: auto;
    opacity: 0.9;
    transition: var(--transition);
}

.logo-secondary:hover {
    opacity: 1;
}

.logo-shakti {
    height: 70px;
    /* Larger size for Shakti as requested */
    width: auto;
}

.logo-primary {
    height: 55px;
    /* Club logo prominent */
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: var(--transition);
}

.logo-main:hover .logo-primary {
    transform: scale(1.05);
}

/* Specific adjustments for mobile if needed, added below media queries usually */

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-left: 30px;
    color: var(--secondary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.highlight {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 15px;
    border-radius: 4px;
}

.nav-link.highlight.active,
.nav-link.highlight:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: var(--transition);
    background-color: var(--secondary-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/hero.png');
    background-size: cover, contain;
    /* Gradient covers, Image contains */
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-top: 80px;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--white);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 40px;
    font-weight: 300;
}

.hero-buttons .btn {
    margin: 0 10px;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

.about-text {
    font-size: 1.1rem;
    color: #666;
}

.about-text p {
    margin-bottom: 20px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    text-align: center;
}

.stat-card {
    padding: var(--space-xl);
    background-color: var(--light-bg);
    border-radius: 10px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.stat-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* Jubilee Section */
.jubilee-section {
    background-color: #fff8fc;
    padding-top: var(--space-xl);
    /* Reduce Space 1: Minimize gap above 'Celebrating 50 Years' */
}

.jubilee-header {
    text-align: center;
    margin-bottom: var(--space-md);
}

.jubilee-header .section-title {
    margin-bottom: var(--space-sm);
    /* Reduce Space 2: Minimize gap below line */
    padding-bottom: var(--space-sm);
}

.jubilee-header .subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 2px;
}

/* Master-Detail Timeline Styles */

/* 1. Master Display Area */
.timeline-display {
    max-width: 900px;
    margin: 0 auto 10px;
    /* Highly compressed bottom gap (Space 2) */
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    border: 1px solid #eee;
}

.display-content {
    display: flex;
    flex-direction: column;
}

.display-img-wrapper {
    position: relative;
    width: 100%;
    height: 310px;
    /* Compromise: bigger than original 280, small enough to fit scrubber */
    overflow: hidden;
    background: #000;
    /* Dark background for letterboxed images */
}

.display-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure full image is visible */
    transition: transform 0.5s ease;
}

.display-year-label {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 4rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    font-family: 'Montserrat', sans-serif;
}

.display-text {
    padding: var(--space-xs) 20px var(--space-sm);
    /* Severely reduced padding to give height back to image (Space 1) */
    text-align: center;
}

.display-text h3 {
    font-size: 2rem;
    margin-bottom: var(--space-xs);
    /* Reduce Space 4: Minimal gap below Year text */
    color: var(--primary-color);
}

.display-text p {
    font-size: 1.1rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
}

/* 2. Timeline Scrubber Container */
.timeline-container {
    max-width: 100%;
    margin: -40px auto 0;
    /* Pull the scrubber UP by 40px into the white space above it */
    position: relative;
    padding: 0;
    /* Removed top/bottom padding to pull scrubber up */
    background: transparent;
}

/* Scroll Area */
.timeline-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    /* CRITICAL FIX: allow upper circles to burst outside the top boundary without adding height padding */
    padding: 40px 0 50px;
    /* The 40px top padding gives the circles room to draw. The -40px margin on the parent cancels out the visual gap. */
    scrollbar-width: thin;
    scrollbar-color: #333 #eaeaea;
}

/* Flex Wrapper */
.timeline-content {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 20px;
    /* Allow items to reach closer to edge */
    width: 100%;
    /* Changed from max-content to fill and squeeze to fit screen */
    min-width: 100%;
}

/* Infinite Horizontal Line */
.timeline-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    background: #000;
    transform: translateY(-50%);
    z-index: 1;
    width: 100%;
}

/* Item Wrapper (The Tick Area) */
.timeline-item {
    position: relative;
    margin: 0;
    /* Squeeze items horizontally */
    flex: 1;
    /* Stretch items evenly across 100% width */
    min-width: 14px;
    /* Ensure they don't crush too much on extremely small mobile */
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    height: 120px;
    /* Reduced height to fit viewport */
    cursor: pointer;
}

/* The Vertical Tick */
.timeline-tick {
    position: absolute;
    width: 2px;
    height: 20px;
    /* Shortened */
    background-color: #000;
    transition: all 0.3s ease;
}

/* Alternating Ticks */
.timeline-item.top .timeline-tick {
    bottom: 50%;
    transform-origin: bottom center;
}

.timeline-item.bottom .timeline-tick {
    top: 50%;
    transform-origin: top center;
}

/* The Circle (Default Small Dot) */
.timeline-tick::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #000;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 1;
    transition: all 0.3s ease;
}

.timeline-item.top .timeline-tick::after {
    top: -3px;
}

.timeline-item.bottom .timeline-tick::after {
    bottom: -3px;
}

/* Hover Effects: Extend Tick and Z-Index Fix */
.timeline-item:hover,
.timeline-item.active {
    z-index: 20;
    /* Fixes stacking context clipping (circles cutting in half) */
}

.timeline-item:hover .timeline-tick,
.timeline-item.active .timeline-tick {
    height: 40px;
    /* Reduced extension */
    width: 2px;
}

/* Hide small dot on hover as it's replaced by the big year circle */
.timeline-item:hover .timeline-tick::after,
.timeline-item.active .timeline-tick::after {
    opacity: 0;
}

/* Year Label (The Large Circle on Hover) */
.year-label {
    position: absolute;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    background-color: var(--primary-color);
    width: 45px;
    /* Large enough for text */
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateX(-50%) scale(0);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy pop-in */
    pointer-events: none;
    z-index: 10;
    left: 50%;
    box-shadow: 0 4px 10px rgba(217, 27, 92, 0.4);
}

/* Positioning the Circle at the tip of the extended tick */
.timeline-item.top .year-label {
    bottom: calc(50% + 45px);
    /* Adjusted for new height */
}

.timeline-item.bottom .year-label {
    top: calc(50% + 45px);
}

/* Show Year Label on Hover/Active */
.timeline-item:hover .year-label,
.timeline-item.active .year-label {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Adjust top/bottom positioning for specific hover state */
.timeline-item.top:hover .year-label,
.timeline-item.top.active .year-label {
    bottom: calc(50% + 35px);
    /* Perfect overlap */
}

.timeline-item.bottom:hover .year-label,
.timeline-item.bottom.active .year-label {
    top: calc(50% + 35px);
}

/* Custom Scrollbar for Scrubber */
.timeline-scroll::-webkit-scrollbar {
    height: 8px;
}

.timeline-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.timeline-scroll::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.timeline-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

/* Year Highlight in Box */
.jubilee-cta {
    text-align: center;
    margin-top: 60px;
}

.date-box {
    display: inline-block;
    padding: 20px;
    border: 3px solid var(--primary-color);
    margin: 20px 0;
    border-radius: 10px;
}

.date-box span {
    display: block;
    font-weight: 700;
    line-height: 1.2;
}

.date-box .day {
    font-size: 3rem;
    color: var(--primary-color);
}

.date-box .month {
    font-size: 1.5rem;
    text-transform: uppercase;
}

.date-box .year {
    font-size: 1.5rem;
    color: #777;
}

/* Events Section */
.bg-light {
    background-color: var(--light-bg);
}

.events-wrapper {
    margin-bottom: var(--space-xxl);
}

.events-wrapper h3 {
    margin-bottom: var(--space-xl);
    font-size: 1.5rem;
    border-left: 5px solid var(--primary-color);
    padding-left: var(--space-md);
}

.event-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    transition: var(--transition);
}

.event-card.featured {
    border: 1px solid rgba(217, 27, 92, 0.2);
}

.event-date {
    background: var(--primary-color);
    color: var(--white);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 100px;
    text-align: center;
}

.event-date span:first-child {
    font-size: 1.8rem;
    font-weight: 700;
}

.event-details {
    padding: var(--space-xl);
}

.event-details h4 {
    font-size: 1.3rem;
    margin-bottom: var(--space-sm);
}

.event-details p {
    color: #777;
    margin-bottom: var(--space-xs);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    transition: var(--transition);
}

.gallery-item img:hover {
    transform: scale(1.02);
}

/* Members Section */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.member-card {
    padding: 20px;
}

.member-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.member-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-card h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.member-card .role {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Contact Section */
.bg-dark {
    background-color: var(--dark-bg);
    color: var(--white);
}

.text-white {
    color: var(--white);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xxl);
}

.contact-info p {
    font-size: 1.1rem;
    margin-bottom: var(--space-lg);
    color: #ccc;
    display: flex;
    align-items: center;
}

.contact-info i {
    color: var(--primary-color);
    margin-right: 15px;
    width: 20px;
}

.social-links {
    margin-top: 30px;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 50%;
    margin-right: 15px;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
}

.contact-form input,
.contact-form textarea {
    padding: 15px;
    margin-bottom: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 5px;
    font-family: inherit;
}

.contact-form button {
    align-self: flex-start;
}

/* Footer */
footer {
    background-color: #111;
    color: #777;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        gap: 0;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    }

    /* Adjust Logos for Mobile */
    .logo-secondary {
        height: 30px;
        /* Smaller on mobile */
        gap: 8px;
    }

    .logo-primary {
        height: 45px;
    }

    .logo-group {
        gap: 10px;
    }



    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        margin: 20px 0;
        display: block;
    }

    /* Interactive Timeline Responsiveness */
    .timeline-container {
        width: 100%;
        padding: 10px;
    }

    .timeline-card {
        width: 250px;
        /* Smaller card on mobile */
        padding: 10px;
    }

    @media (max-width: 600px) {
        .timeline-line {
            left: 20px;
            transform: none;
        }

        .timeline-node {
            left: -50%;
            transform: translateX(12px);
        }

        .timeline-row {
            justify-content: flex-start;
            padding-left: 50px;
        }

        .timeline-card.left,
        .timeline-card.right {
            position: relative;
            left: auto;
            right: auto;
            margin: 0;
            text-align: left;
            width: 100%;
            max-width: 300px;
        }

        .timeline-card.left::before,
        .timeline-card.right::before {
            left: -10px;
            right: auto;
            border-width: 10px 10px 10px 0;
            border-color: transparent #000 transparent transparent;
        }

        .timeline-card.left::after,
        .timeline-card.right::after {
            left: -8px;
            right: auto;
            border-width: 9px 9px 9px 0;
            border-color: transparent #fff transparent transparent;
        }
    }
}