/* Base Styles */
:root {
    --navy-blue: #001f3f; 
    --white: #ffffff;
    --light-bg: #f8f9fa;
    --text-dark: #333333;
    --accent: #4da6ff;
}

html {
    overflow-y: scroll; /* Forces the scrollbar to always appear to prevent layout shifting */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 80px 0 0 0; /* Creates space for the floating nav */
    color: var(--text-dark);
    background-color: var(--light-bg);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Floating Navigation Bar */
.floating-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--navy-blue);
    padding: 12px 30px;
    border-radius: 50px; /* Rounded pill shape */
    display: flex;
    gap: 30px;
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(0, 31, 63, 0.3);
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--accent);
}

/* Header (Squircle & Info) */
header {
    text-align: center;
    padding: 20px 20px 40px;
    background-color: var(--light-bg);
}

.profile-pic {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 25%; /* Squircle effect */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
}

.email-link {
    color: var(--navy-blue);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
}

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

/* Page Title Headers */
.page-title {
    text-align: center;
    padding: 20px 20px 40px;
}

/* Sections */
.bio-section, .previous-projects-section {
    padding: 60px 0;
    text-align: center;
}

.bio-section {
    background-color: var(--navy-blue);
    color: var(--white);
}

.previous-projects-section {
    background-color: var(--white);
}

.bio-section h2, .previous-projects-section h2 {
    margin-top: 0;
    font-size: 2rem;
    margin-bottom: 20px;
}

.bio-section p, .previous-projects-section p {
    font-size: 1.1rem;
    line-height: 1.7;
    max-width: 800px;
    margin: 0 auto 15px auto;
}

/* Robotics & Arduino Section (Projects Page) */
.robotics-section {
    background-color: var(--white);
    padding: 40px 0 80px;
    text-align: center;
}

.robotics-section h2 {
    margin-top: 0;
    font-size: 2rem;
    margin-bottom: 40px;
}

/* Video Gallery: Desktop Grid */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
}

iframe {
    width: 100%;
    aspect-ratio: 9/16; 
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #000;
}

/* Contact Section (Collaboration Page) */
.contact-section {
    background-color: var(--white);
    padding: 40px 0 80px;
    text-align: center;
}

.services-list {
    list-style: none;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 30px;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1.1rem;
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #001f3f 0%, #004080 100%);
    box-shadow: 0 4px 15px rgba(0, 31, 63, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 31, 63, 0.4);
}

/* Mobile Media Query */
@media (max-width: 768px) {
    .video-gallery {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 20px;
        gap: 15px;
        -ms-overflow-style: none;  
        scrollbar-width: none;  
    }
    
    .video-gallery::-webkit-scrollbar { 
        display: none; 
    }

    iframe {
        flex: 0 0 75%; 
        scroll-snap-align: center;
    }
}

/* --- Project Grid Styles --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 40px;
}

.project-card {
    background-color: var(--light-bg);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    text-align: left;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.project-card h3 {
    margin-top: 0;
    font-size: 1.3rem;
    color: var(--navy-blue);
    line-height: 1.3;
}

.project-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    flex-grow: 1; /* Ensures buttons align at the bottom */
    margin-bottom: 20px;
}

.project-card .cta-button {
    text-align: center;
    padding: 10px 15px;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
}

/* Update Mobile Media Query */
@media (max-width: 768px) {
    /* Existing video gallery code */
    .video-gallery {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 20px;
        gap: 15px;
        -ms-overflow-style: none;  
        scrollbar-width: none;  
    }
    
    .video-gallery::-webkit-scrollbar { 
        display: none; 
    }

    iframe {
        flex: 0 0 75%; 
        scroll-snap-align: center;
    }

    /* NEW: Make project grid a single column on mobile */
    .project-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Navigation Button Grid (Home Page) --- */
.button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.button-grid .cta-button {
    width: 100%;
    box-sizing: border-box;
    /* Centers text if it wraps to multiple lines */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%; 
}

/* --- Project Details List (Projects Page) --- */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 40px;
}

/* Prevents the floating nav from covering the section title when anchored */
.anchor-offset {
    scroll-margin-top: 100px; 
}

/* Update Mobile Media Query */
@media (max-width: 768px) {
    .button-grid {
        grid-template-columns: 1fr; /* Stacks buttons vertically */
    }
}
