/* --- Global Styles & Variables --- */
:root {
    --primary-color: #007bff; /* Blue */
    --secondary-color: #6c757d; /* Gray */
    --background-color: #f8f9fa; /* Light gray */
    --text-color: #333;
    --heading-font: 'Arial', sans-serif; /* Choose appropriate fonts */
    --body-font: 'Georgia', serif;
    --nav-link-color: #eee;
    --nav-hover-color: #fff;
    --header-bg: #343a40; /* Dark Gray */
    --footer-bg: #343a40;
    --border-radius: 5px;
    --box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --primary-color-dark: #0056b3; /* Darker shade of primary color for hover states */
}

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

html {
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure footer stays at bottom */
}

main {
    flex-grow: 1; /* Allow main content to take up available space */
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem; /* Add padding on sides */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; color: var(--primary-color); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

p {
    margin-bottom: 1rem;
}

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

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none; /* Remove default bullets */
    padding-left: 0; /* Remove default padding */
}

img {
    max-width: 100%; /* Make images responsive */
    height: auto;
    display: block; /* Remove extra space below images */
}

/* --- Header & Navigation --- */
.site-header {
    background-color: rgba(52, 58, 64, 0.9); /* Semi-transparent header */
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(5px); /* Adds a blur effect to content behind the header */
    -webkit-backdrop-filter: blur(5px); /* For Safari support */
}

.site-header.scrolled {
    background-color: rgba(52, 58, 64, 0.95); /* More opaque when scrolled */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Space between logo image and text */
}

.logo img {
    max-width: 40px; /* Reduce the image size */
    height: auto; /* Maintain aspect ratio */
    border-radius: var(--border-radius);
}

.logo h1 {
    margin: 0;
    font-size: 1.5rem; /* Reduce the text size */
}

.logo h1 a {
    color: #fff;
    text-decoration: none;
}
.logo h1 a:hover {
    text-decoration: none;
    opacity: 0.9;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-left: 0.8rem;
}

.main-nav a {
    color: var(--nav-link-color);
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 20px;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: var(--primary-color);
    color: white;
    border-bottom-color: transparent;
}

.menu-toggle { /* Hamburger Button */
    display: none; /* Hidden by default on larger screens */
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
}


/* --- Hero Section (Homepage) --- */
.hero {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2)), 
                url('iitgimage.jpg') no-repeat center center/cover;
    filter: brightness(1.5); /* Darken the image */
    color: #fff;
    text-align: center;
    padding: 6rem 1rem;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-blend-mode: multiply; /* Optional: Darken the background image */
    background-color: rgba(0, 0, 0, 0.5); /* Dark overlay */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Add text shadow for better readability */
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #fff; /* Override default h2 color */
    letter-spacing: 2px; /* Add spacing between letters */
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
}

.cta-button {
    display: inline-block;
    background-color: #fff;
    color: var(--primary-color);
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 2px solid var(--primary-color);
}

.cta-button:hover {
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

/* --- General Content Sections --- */
.content-section {
    padding: 3rem 0;
    border-bottom: 1px solid #eee; /* Separator */
}
.content-section:last-child {
    border-bottom: none;
}

.content-section.testimonials {
    margin-top: 50px;
}

/* Enhanced Page Title for all pages - Adjust spacing */
.page-title {
    text-align: center;
    padding: 2.5rem 0 1.5rem 0;
    margin-bottom: 2rem;
    margin-top: 5px;
    position: relative;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.page-title h2 {
    margin-bottom: 0.8rem;
    font-size: 2.4rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 1px;
}

.page-title p {
    max-width: 600px;
    margin: 0 auto;
    color: var(--secondary-color);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Section headings for events page */
#upcoming h2, #past-events h2 {
    position: relative;
    display: inline-block;
    margin-bottom: 1.8rem;
    font-size: 1.8rem;
    padding-bottom: 0.5rem;
}

#upcoming h2::after, #past-events h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 1.5px;
}

#past-events {
    padding-top: 40px;
    padding-bottom: 40px;
}

/* --- Specific Page Sections --- */

/* Events Page */
.event-item {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
    overflow-wrap: break-word; /* Ensures text wraps instead of overflowing */
    word-wrap: break-word;
    word-break: break-word; /* Allows breaking of long words */
    max-width: 100%; /* Ensure it doesn't exceed its container */
}

.event-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.event-item h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.event-meta {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: #6c757d;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto; /* Enables hyphenation */
    display: flex;
    gap: 1rem;
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.event-description {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.event-actions {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
}

/* Button styles for events */
.cta-button-small {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: var(--primary-color);
    color: white;
    white-space: nowrap; /* Prevent text wrapping */
    width: fit-content; /* Make button only as wide as content */
}

.cta-button-small:hover {
    background-color: var(--primary-color-dark);
    text-decoration: none;
}

/* Registration not started styling */
.registration-pending {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px dashed var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.77;
    position: relative;
}

.registration-pending:hover {
    background-color: transparent;
    text-decoration: none;
}

.registration-pending::after {
    content: '⏳';
    margin-left: 0.4rem;
}

/* Resources Page */
.resource-category {
    margin: 2rem auto;
    padding: 1.8rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 95%; /* Limit width to create spacing from screen edges */
}

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

.resource-category h2 {
    color: #2a3990;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2a3990;
}

.resource-category ul {
    list-style-type: none;
    padding-left: 0;
}

.resource-category li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.resource-category li:before {
    content: "•";
    color: #2a3990;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.resource-category a {
    color: #2a3990;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.resource-category a:hover {
    color: #ff5722;
    text-decoration: underline;
}

/* Special styling for tutorials section */
#tutorials {
    background-color: #f0f8ff;
    border-left: 4px solid #4285f4;
}

#tutorials h2 {
    color: #4285f4;
    border-bottom-color: #4285f4;
}

#tutorials li:before {
    color: #4285f4;
}

#tutorials a {
    color: #0056b3;
}

/* Special styling for tools section */
#tools {
    background-color: #f0fff4;
    border-left: 4px solid #34a853;
}

#tools h2 {
    color: #34a853;
    border-bottom-color: #34a853;
}

#tools li:before {
    color: #34a853;
}

#tools a {
    color: #1e7e34;
}

/* Special styling for communities section */
#communities {
    background-color: #fff8f0;
    border-left: 4px solid #ea4335;
}

#communities h2 {
    color: #ea4335;
    border-bottom-color: #ea4335;
}

#communities li:before {
    color: #ea4335;
}

#communities a {
    color: #c23321;
}

/* Consistent hover color for all resource links */
.resource-category a:hover {
    color: #ff5722;
    text-decoration: underline;
}

/* Members Page */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive grid */
    gap: 2rem;
    margin-top: 2rem;
}
.member-profile {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
}

.member-profile h4 {
    margin-bottom: 0.2rem;
    color: var(--primary-color);
}
.member-role {
    font-style: italic;
    color: var(--secondary-color);
    margin-bottom: 0.8rem;
    font-size: 0.9em;
    padding: 0.2rem 0.5rem;
}

.testimonials blockquote {
    background-color: #e9ecef; /* Light background for quotes */
    border-left: 5px solid var(--secondary-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    font-style: italic;
}
.testimonials footer {
    margin-top: 0.5rem;
    font-style: normal;
    font-weight: bold;
    text-align: right;
    color: var(--secondary-color);
}

.join-us {
    text-align: center;
    background-color: #e6e6e6;
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
    margin-bottom: 2rem;
    max-width: 88%; /* Set maximum width */
    margin-left: auto; /* Center the box */
    margin-right: auto; /* Center the box */
}

/* Club Leaders heading on members page */
#profiles h2 {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
    padding-bottom: 0.3rem;
}

#profiles h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 1.5px;
}

/* Quick Links Section - Increased size */
.quick-links-section {
    background-color: #f7f7f7;
    padding: 2.5rem 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 3rem auto; /* Increase margin */
    max-width: 72%;
    
}


.quick-links-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.8rem; /* More space below heading */
    padding-bottom: 0.5rem;
    border-bottom: none;
    font-size: 1.8rem; /* Slightly larger heading */
}

.quick-links-section ul {
    list-style-type: none;
    padding-left: 0.5rem;
}

.quick-links-section li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: 1rem;
    text-decoration: none;
}

.quick-links-section li:before {
    content: "→";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--footer-bg);
    color: #ccc;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto; /* Pushes footer to bottom */
}
.site-footer p {
    margin: 0;
    font-size: 0.9rem;
}
.social-links a {
    color: #ccc;
    margin: 0 0.5rem;
}
.social-links a:hover {
    color: #fff;
}

/* --- Responsiveness --- */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    .hero h2 { font-size: 2.5rem; }
    .hero { padding: 4rem 1rem; min-height: 50vh;}

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        width: 100%;
        margin-top: 1rem; /* Space between logo and nav */
    }

    .main-nav ul {
        display: none; /* Hide nav links by default */
        flex-direction: column;
        width: 100%;
        background-color: var(--header-bg); /* Match header background */
        position: absolute; /* Take out of flow */
        top: 100%; /* Position below header */
        left: 0;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Add shadow when open */
    }

     .main-nav ul.nav-open {
        display: flex; /* Show when toggled */
    }

    .main-nav li {
        margin: 0;
        text-align: center; /* Center nav items */
    }

    .main-nav a {
        display: block; /* Make links take full width */
        padding: 0.8rem 1rem;
        border-bottom: 1px solid #555; /* Separator for mobile */
    }
    .main-nav li:last-child a {
        border-bottom: none;
    }

    .main-nav a:hover,
    .main-nav a.active {
        background-color: #555; /* Background hover/active on mobile */
        border-bottom-color: transparent; /* Remove underline on mobile */
    }


    .menu-toggle {
        display: block; /* Show hamburger */
        position: absolute; /* Position relative to header */
        top: 1rem; /* Adjust as needed */
        right: 1.5rem; /* Align to the right */
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .event-meta {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .event-meta strong {
        display: inline-block;
        min-width: 50px;
    }
    
    /* Remove the separator on mobile */
    .event-meta span.separator {
        display: none;
    }

    .content-section {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .event-item {
        margin-left: 10px;
        margin-right: 10px;
        padding: 1.2rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .event-meta {
        font-size: 0.85rem;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .resource-category {
        padding: 1.5rem;
        margin: 1.5rem 15px;
        max-width: calc(100% - 30px);
    }
    
    .resource-category ul {
        padding-left: 1.2rem;
    }
    
    .resource-category li {
        margin-bottom: 0.8rem;
        line-height: 1.4;
    }

    .page-title {
        padding: 2rem 0 1.2rem 0; /* Reduced from 2.5rem 0 1.5rem 0 */
        margin-top: 1.5rem; /* Reduced from 2rem */
        margin-bottom: 1.5rem; /* Reduced from 2rem */
    }
    
    .page-title h2 {
        font-size: 2rem;
    }
    
    /* Also add space to section headings */
    #upcoming h2, #past-events h2, 
    #tutorials h2, #tools h2, #communities h2,
    #profiles h2 {
        margin-top: 1rem;
    }
    
    /* Add space to main content sections */
    main {
        padding-top: 1rem;
    }
}

@media (max-width: 576px) {
     h1 { font-size: 1.8rem; }
     h2 { font-size: 1.6rem; }
    .hero h2 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .cta-button { padding: 0.6rem 1.2rem; font-size: 0.9rem;}
    .container { padding: 0 1rem; }

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .resource-category {
        padding: 1.2rem;
        margin: 1.2rem 10px;
    }

    .page-title {
        padding: 1.5rem 0 1rem 0; /* Reduced from 2rem 0 1.2rem 0 */
        margin-top: 2rem; /* Reduced from 3rem */
        margin-bottom: 1.2rem; /* Reduced from 1.5rem */
    }
    
    .page-title h2 {
        font-size: 1.8rem;
    }
    
    /* Even more space for main sections on very small screens */
    main {
        padding-top: 1.5rem;
    }
}

/* --- Animations --- */
#about {
    background-color: var(--background-color); /* Light background */
    padding: 1.5rem 1.5rem;
    border-radius: var(--border-radius); /* Rounded corners */
    box-shadow: var(--box-shadow); /* Subtle shadow */
    animation: fadeInUp 1s ease-in-out; /* Keep the existing animation */
    margin-top: 2rem; /* Space from the top */
    margin-bottom: 40px;
}

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