/* Base Variables & Reset */
:root {
    --droid-blue: #0055A4;
    --droid-silver: #E0E0E0;
    --text-dark: #333333;
    --bg-white: #FFFFFF;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--text-dark);
    color: var(--bg-white);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--bg-white);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--droid-blue);
}

/* Hero Section Layout Adjustments */
.hero {
    /* Slightly increased height to make room for the new graphic element */
    min-height: 70vh; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--bg-white);
    padding: 3rem 20px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center aligns the logo, h1, text, and button */
    max-width: 800px;
}

/* Large Hero Logo Graphic */
.hero-logo {
    width: 100%;
    max-width: 180px; /* Limits maximum size on desktop */
    height: auto;
    margin-bottom: 1.5rem; /* Pushes the title down cleanly */
    filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.3)); /* Adds a slight pop over the background image */
    object-fit: contain;
}

/* Responsive adjustment for small devices */
@media (max-width: 480px) {
    .hero-logo {
        max-width: 130px;
        margin-bottom: 1rem;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.hero p {
    color: var(--text-dark);
}

.btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: var(--droid-blue);
    color: var(--bg-white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn:hover {
    background-color: #003d7a;
}

/* General Layout */
.content-section {
    padding: 4rem 5%;
    text-align: center;
}

.content-section p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
}

.bg-light {
    background-color: #f4f4f4;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.photo-card {
    background: var(--bg-white);
    border: 1px solid var(--droid-silver);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.photo-card img {
    width: 100%;
    height: auto; /* Allows the box height to adjust naturally to the image's shape */
    display: block;
}

.photo-card h3 {
    padding: 1rem;
    font-size: 1.2rem;
}

/* Footer */
footer {
    background-color: var(--text-dark);
    color: var(--bg-white);
    text-align: center;
    padding: 2rem 5%;
}

footer a {
    color: var(--droid-blue);
}

/* Form Layout Style Adjustments */
.form-container {
    max-width: 600px;
    margin: 2rem auto 0;
    text-align: left;
    background: #fdfdfd;
    padding: 2.5rem;
    border: 1px solid var(--droid-silver);
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.form-textarea {
    height: 150px;
    resize: vertical;
}

.form-error {
    color: #cc0000;
    font-size: 0.85rem;
}

/* Flash Messages Messaging Alert Banners */
.flash-banner {
    max-width: 600px;
    margin: 1rem auto;
    padding: 10px;
    border-radius: 4px;
    font-weight: bold;
}
.flash-banner.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-banner.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }


/* Resources Grid Layout */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    max-width: 1000px;
    margin: 3rem auto 0;
    text-align: left;
}

.resource-card {
    background: #ffffff;
    border: 1px solid var(--droid-silver);
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.resource-card h3 {
    margin: 0.5rem 0;
    color: var(--text-dark);
}

.resource-card p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.resource-link {
    color: var(--droid-blue);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
}

.resource-link:hover {
    text-decoration: underline;
}

/* Category Badges */
.resource-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 3px;
    color: #fff;
}
.documentation { background-color: #28a745; }
.threed-files { background-color: #6f42c1; }
.electronics { background-color: #fd7e14; }

/* Resource Categorization Overrides */
.resource-category-section {
    margin-top: 3.5rem;
    text-align: left;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.category-heading {
    font-size: 1.4rem;
    color: var(--text-dark);
    border-bottom: 2px solid var(--droid-silver);
    padding-bottom: 0.6rem;
    margin-bottom: 1.5rem;
}

/* Tighten grid spacing under category headings */
.resource-category-section .resources-grid {
    margin-top: 0;
}

/* Additional Badge Color */
.club-hub { background-color: #0055A4; }

/* Navigation Logo + Text Layout */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px; /* Adds space between the logo image and the text */
    text-decoration: none;
    color: var(--bg-white); /* Keeps the text white */
}

.nav-logo {
    height: 40px; /* Slightly smaller height to fit well alongside text */
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-weight: bold;
    font-size: 1.25rem;
    white-space: nowrap; /* Prevents the text from wrapping onto a second line */
}

/* Responsive Google Calendar Container */
.calendar-container {
    max-width: 900px;
    margin: 2rem auto;
    position: relative;
    padding-bottom: 75%; /* Aspect ratio (Height / Width) */
    height: 0;
    overflow: hidden;
    border: 1px solid var(--droid-silver);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    background-color: var(--bg-white);
}

.calendar-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* On larger desktop screens, limit the height so it doesn't stretch infinitely */
@media (min-width: 800px) {
    .calendar-container {
        padding-bottom: 600px; /* Fixed height for desktops */
    }
}

/* Smooth transition for the whole page */
body {
    background-color: var(--bg-white);
    color: var(--text-dark);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode Variable Overrides */
body.dark-mode {
    --bg-white: #121212;       /* Makes backgrounds dark grey/black */
    --text-dark: #e0e0e0;      /* Makes text light */
    --droid-silver: #333333;   /* Darkens borders */
    --droid-blue: #4da6ff;     /* Slightly brightens the blue for better contrast */
}

/* Fixes for elements that shouldn't invert perfectly */
body.dark-mode .navbar, 
body.dark-mode footer {
    background-color: #000000; /* Keeps the nav/footer dark */
    border-bottom: 1px solid #333;
}
body.dark-mode footer p{
    color: #ffffff;
}

body.dark-mode .bg-light {
    background-color: #1a1a1a; /* Darkens the light-grey gallery background */
}

body.dark-mode .nav-links a {
    color: #ffffff; 
}

body.dark-mode .logo-text {
    color: #ffffff; 
}

/* Resource Cards */
body.dark-mode .resource-card,
body.dark-mode .form-container 
{
    background-color: #262626; /* Sleek dark grey */
    border: 1px solid #444;    /* Softens the border edge */
}

body.dark-mode .resource-card p
{
    color: #ffffff
}

/* Contact Form Inputs & Textareas */
body.dark-mode input,
body.dark-mode textarea {
    background-color: #262626; 
    color: #ffffff;            /* Ensures typed text is visible */
    border: 1px solid #555;
}

/* Lighten the placeholder text so it doesn't vanish */
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #bbbbbb; 
}


/* Style for the toggle button itself */
.theme-btn {
    margin-right: 20px; /* Pushes the nav links to the right */
    margin-left: 0;     /* Removes the old left margin */
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.theme-btn:hover {
    transform: scale(1.1);
}

/* --- MOBILE RESPONSIVENESS --- */

/* Hamburger Button Base Style (Hidden on Desktop) */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 101; /* Keeps it above the menu */
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: var(--bg-white);
    transition: all 0.3s ease-in-out;
    border-radius: 3px;
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    /* Show the hamburger menu icon */
    .hamburger {
        display: flex;
    }

    /* Convert the horizontal navbar into a vertical dropdown */
    .nav-links {
        position: absolute;
        top: 100%; /* Automatically attaches directly under the navbar */
        left: 0;
        right: 0;
        background-color: var(--text-dark);
        flex-direction: column;
        width: 100%;
        text-align: center;
        padding: 1rem 0;
        
        /* The animation starting state */
        transform: translateY(-20px); 
        opacity: 0;
        pointer-events: none; /* Prevents invisible clicks */
        transition: all 0.3s ease-in-out;
        box-shadow: 0 10px 15px rgba(0,0,0,0.5);
        border-top: 1px solid #444; /* Adds a visual separation line */
    }

    /* The JS adds this class to reveal the menu */
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    /* Hamburger to X Animation */
    .hamburger.toggle .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.toggle .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.toggle .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    * Make sections take up less vertical space on phones */
    .content-section {
        padding: 2rem 5%;
    }

    /* Force grids to become single columns on small phones */
    .photo-grid, 
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Shrink the Hero text slightly */
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}
