/* =========================================================
   GLOBAL STYLES
   These styles apply to the entire website
   ========================================================= */

/* The asterisk (*) targets ALL elements on the page */
* {
    margin: 0; /* Remove outer spacing (space outside elements) */
    padding: 0; /* Remove inner spacing (space inside elements) */
    box-sizing: border-box; /* Include borders and padding in width/height calculations */
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Style the entire page background and default text */
body {
    background-color: #e5e5e5; /* Light gray background color for the whole page */
    font-family: Arial, Helvetica, sans-serif; /* Font style for all text (Arial is simple and clean) */
    line-height: 1.6; /* Space between lines of text (1.6 means 1.6 times the text height) */
}

/* Container class keeps content centered and readable on large screens */
.container {
    width: 90%; /* Take up 90% of the screen width */
    max-width: 1200px; /* But never get wider than 1200 pixels */
    margin: auto; /* Center the container horizontally */
}

/* =========================================================
   HEADER
   The top bar that appears on every page
   ========================================================= */

/* Style the header (top bar) of the page */
header {
    background-color: #002454; /* Dark navy blue background */
}

/* Navbar container - holds logo and navigation links in a row */
.navbar {
    display: flex; /* Display items in a horizontal row */
    align-items: center; /* Vertically center items in the header */
    justify-content: space-between; /* Spread items to opposite ends (logo left, nav right) */
    padding: 15px 0; /* Add 15 pixels of space above and below the navbar */
}

/* Logo image styling */
.logo {
    height: 80px; /* Make logo 80 pixels tall */
}

/* Navigation links list styling */
.nav-links {
    list-style: none; /* Remove bullet points from the list */
    display: flex; /* Display links in a horizontal row */
    gap: 40px; /* Add 40 pixels of space between each navigation link */
}

/* Individual navigation link styling */
.nav-links a {
    text-decoration: none; /* Remove underlines from links */
    color: white; /* Make text white */
    font-weight: 500; /* Make text slightly bold */
}

/* Style when hovering mouse over a navigation link */
.nav-links a:hover {
    color: white !important; /* Keep white text when hovering */
    text-decoration: underline; /* Underline the link when hovering */
    text-decoration-color: #fac01a; /* Make the underline gold */
}

/* Style for the current/active page link */
.active {
    color: #fac01a !important; /* Make active page link gold color */
}

/* Hamburger menu button (three horizontal lines) - hidden on desktop */
.hamburger {
    display: none; /* Don't show on desktop (shown on mobile) */
    flex-direction: column; /* Stack the three lines vertically */
    cursor: pointer; /* Change cursor to pointer when hovering */
    padding: 5px; /* Add small space around the button */
}

/* Each line in the hamburger menu */
.hamburger .bar {
    width: 25px; /* Width of each line */
    height: 3px; /* Thickness of each line */
    background-color: white; /* Color of the lines */
    margin: 3px 0; /* Space between each line (3 pixels above and below) */
    transition: 0.3s; /* Smooth animation when menu opens/closes (0.3 seconds) */
}

/* Side navigation panel that slides in from the left on mobile */
.side-panel {
    position: fixed; /* Stay in place even when scrolling */
    top: 0; /* Align to top of screen */
    left: -300px; /* Start off-screen to the left (hidden) */
    width: 300px; /* Width of the panel */
    height: 100%; /* Full height of the screen */
    background-color: #002454; /* Dark navy blue background */
    transition: left 0.3s ease; /* Smooth slide animation (0.3 seconds) */
    z-index: 1000; /* Stay on top of other elements */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3); /* Shadow on the right edge */
}

/* Side panel when it's open */
.side-panel.open {
    left: 0; /* Slide into view (left edge at 0) */
}

/* Content inside the side panel */
.side-panel-content {
    padding: 80px 20px 20px 20px; /* Space around content (extra space at top for under header) */
}

/* Mobile navigation links list */
.mobile-nav-links {
    list-style: none; /* Remove bullet points */
    padding: 0; /* Remove default padding */
    margin: 0; /* Remove default margin */
}

/* Individual mobile navigation list items */
.mobile-nav-links li {
    margin: 20px 0; /* Space between each link */
}

/* Mobile navigation links styling */
.mobile-nav-links a {
    color: white; /* White text */
    text-decoration: none; /* Remove underlines */
    font-size: 18px; /* Larger text for easier tapping */
    font-weight: 500; /* Slightly bold */
    display: block; /* Take up full width */
    padding: 10px 0; /* Space around link */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Light line under each link */
}

/* Mobile link hover effect */
.mobile-nav-links a:hover {
    color: white !important; /* Keep white text */
    text-decoration: underline; /* Underline on hover */
    text-decoration-color: #fac01a; /* Gold underline */
}

/* Active page link on mobile */
.mobile-nav-links a.active {
    color: #fac01a !important; /* Gold text for current page */
}

/* Hide desktop menu on mobile, show hamburger button instead */
@media (max-width: 768px) {
    /* Show hamburger menu on mobile */
    .hamburger {
        display: flex; /* Make hamburger visible on mobile */
    }
    
    /* Hide desktop navigation on mobile */
    .nav-links {
        display: none; /* Hide the desktop navigation menu */
    }
}

/* =========================================================
   TITLE SECTION
   ========================================================= */

.page-title {
    font-family: "IBM Plex Serif", serif;
    font-size: 56px;
    text-align: center;
    color: #002454;
    margin-top: 60px;
    padding: 0 20px;
    margin-bottom: 40px;
}

/* Desktop-only width limit so long titles wrap instead of becoming one long line */
@media (min-width: 601px) {
    .page-title {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }
}

.project-overview {
    font-family: "IBM Plex Serif", serif;
    font-size: 24px;
    color: #002454;
    margin-top: 0;
    margin-bottom: 14px;
    padding: 0;
}

/* Responsive title */
@media (max-width: 600px) {
    .page-title {
        font-size: 34px;
    }
}

/* =========================================================
   DESCRIPTION TEXT
   ========================================================= */

.description {
    max-width: 850px;
    margin: 30px auto;
    text-align: center;
    font-size: 18px;
}

/* Homepage split layout */
.home-hero {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 28px;
    align-items: start;
    margin: 30px auto 70px;
}

.home-left {
    min-width: 0;
    margin-top: 30px;
}

.home-title {
    text-align: left;
    margin-top: 0;
    margin-bottom: 14px;
    padding: 0;
    font-size: 40px;
    line-height: 1.08;
}

.home-description {
    max-width: none;
    margin: 28px 0 0;
    text-align: left;
    font-size: 17px;
    background: #ffffff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.home-description:hover {
    box-shadow: 0 0 20px rgba(250, 192, 26, 0.4);
}

.home-description p + p {
    margin-top: 14px;
}

.home-more-inline,
.home-more-block {
    display: none;
}

.home-description.expanded .home-more-inline {
    display: inline;
}

.home-description.expanded .home-more-block {
    display: block;
    margin-top: 14px;
}

.keep-reading {
    background: none;
    border: none;
    padding: 0;
    margin-left: 6px;
    color: #7a7a7a;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
}

.keep-reading:hover {
    text-decoration: underline;
}

.home-description.expanded .keep-reading {
    display: none;
}

.home-description.expanded .collapse-reading {
    display: inline;
    margin-top: 8px;
}

.collapse-reading {
    display: none;
}

.home-video {
    margin: 0;
    align-items: stretch;
}

.home-video .video-container {
    width: 100%;
    max-width: 760px;
    margin-left: auto;
}

.home-video .video-caption {
    text-align: center;
    margin-left: auto;
    width: 100%;
    max-width: 1080px;
}

@media (max-width: 900px) {
    .home-hero {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .home-title {
        font-size: 34px;
    }

    .home-video .video-container,
    .home-video .video-caption {
        max-width: 100%;
        margin-left: 0;
    }

    .home-description {
        margin-top: 0;
    }
}

@media (max-width: 600px) {
    .home-title {
        font-size: 28px;
    }

    .home-description {
        font-size: 16px;
        padding: 18px;
    }
}

/* =========================================================
   SYSTEM CONCEPT SECTION
   Styles for system concept and control method overview
   ========================================================= */

/* Main system concept container */
.system-concept {
    margin: 60px auto; /* Vertical spacing */
}

/* Section subtitle */
.section-subtitle {
    font-family: "IBM Plex Serif", serif; /* Serif font */
    color: #002454; /* Navy blue */
    font-size: 36px; /* Large heading */
    margin-bottom: 20px; /* Space below */
    text-align: center; /* Center align */
}

/* Intro text outside the box */
.concept-intro {
    color: #333; /* Dark text */
    font-size: 16px; /* Regular text */
    line-height: 1.6; /* Line spacing */
    margin-bottom: 30px; /* Space below */
    text-align: center; /* Center align */
    max-width: 900px; /* Limit width for readability */
    margin-left: auto; /* Center horizontally */
    margin-right: auto; /* Center horizontally */
}

/* Pros and cons grid layout */
.pros-cons-grid {
    display: grid; /* Grid layout */
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 30px; /* Space between columns */
    margin: 30px 0; /* Vertical spacing */
}

/* Individual concept subsections */
.concept-subsection {
    margin-bottom: 30px; /* Space between subsections */
    padding: 30px; /* Internal spacing */
    background: white; /* White background */
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    transition: box-shadow 0.3s ease; /* Smooth glow animation */
}

.concept-subsection:hover {
    box-shadow: 0 0 20px rgba(250, 192, 26, 0.4); /* Gold backlight */
}

/* Pros box with green backlight */
.pros-box {
    background: white;
}

.pros-box:hover {
    box-shadow: 0 0 20px rgba(34, 139, 34, 0.5); /* Dark green backlight */
}

/* Cons box with red backlight */
.cons-box {
    background: white;
}

.cons-box:hover {
    box-shadow: 0 0 20px rgba(178, 34, 34, 0.5); /* Dark red backlight */
}

.concept-subsection h3 {
    color: #002454; /* Navy blue */
    font-size: 24px; /* Heading size */
    margin-bottom: 12px; /* Space below heading */
}

/* Center pros and cons headings */
.pros-box h3,
.cons-box h3 {
    text-align: center;
}

.concept-subsection p {
    color: #333; /* Dark text */
    font-size: 16px; /* Regular text */
    line-height: 1.6; /* Line spacing */
    margin-bottom: 12px; /* Space between paragraphs */
}

.concept-subsection ul {
    margin-left: 20px; /* Indent list */
    margin-bottom: 12px; /* Space below list */
}

.concept-subsection li {
    color: #333; /* Dark text */
    font-size: 16px; /* Regular text */
    line-height: 1.6; /* Line spacing */
    margin-bottom: 8px; /* Space between items */
}

.small-gray-link {
    color: #777; /* Small gray helper link */
    font-size: 12px;
    text-decoration: none;
}

.small-gray-link:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .system-concept {
        padding: 0; /* Remove padding on mobile */
    }

    .section-subtitle {
        font-size: 24px; /* Smaller heading */
    }

    .concept-intro {
        font-size: 15px; /* Smaller text */
        padding: 0 15px; /* Add horizontal padding */
    }

    .pros-cons-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px; /* Smaller gap */
    }

    .concept-subsection {
        padding: 20px; /* Reduce padding on mobile */
    }
}

/* =========================================================
   IMAGE SECTION
   ========================================================= */

.image-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 60px auto;
}

.image-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-5px);
}

.image-card img {
    width: 100%;
    display: block;
}

.image-text {
    padding: 15px;
}

.click-more {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* Mobile layout */
@media (max-width: 768px) {
    .image-section {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   VIDEO SECTION
   Styles for the video player with overlay and controls
   ========================================================= */

/* Container for the entire video section */
.video-section {
    display: flex; /* Display items in a column */
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Center items horizontally */
    margin: 60px 0; /* Space above and below the video */
}

/* Video player container */
.video-container {
    position: relative; /* Allow absolute positioning of child elements (overlay, button) */
    width: 720px; /* Default width for the video */
    max-width: 90%; /* But don't let it exceed 90% of screen width on small screens */
}

/* The actual video element */
.video-preview {
    width: 100%; /* Fill the container width */
    border-radius: 16px; /* Curved corners on the video */
    display: block; /* Remove spacing below the video */
    cursor: pointer; /* Show pointer cursor when hovering */
}

/* Semi-transparent overlay that appears over the video */
.video-overlay {
    position: absolute; /* Position it on top of the video */
    top: 0; /* Align to top */
    left: 0; /* Align to left */
    width: 100%; /* Cover entire video width */
    height: 100%; /* Cover entire video height */
    background-color: rgba(0, 0, 0, 0.5); /* Dark semi-transparent background (50% opacity black) */
    border-radius: 16px; /* Match the curved corners of the video */
    display: flex; /* Center the play button */
    flex-direction: column; /* Stack vertically */
    align-items: center; /* Center horizontally */
    justify-content: center; /* Center vertically */
    pointer-events: none; /* Don't block clicks to video */
    transition: opacity 0.3s ease; /* Fade animation */
}

/* Hide overlay when hovering over video */
.video-container:hover .video-overlay {
    opacity: 0; /* Make completely transparent */
    pointer-events: none; /* Don't interact with it */
}

/* Play button icon */
.play-button {
    width: 150px; /* Icon width */
    height: 150px; /* Icon height */
    opacity: 0.5; /* Semi-transparent */
    align-self: center; /* Center the button */
}

/* Text under the video */
.video-caption {
    text-align: center; /* Center the text */
    font-size: 14px; /* Small text size */
    color: #666; /* Gray color */
    margin-top: 10px; /* Space above caption */
    font-family: Arial, Helvetica, sans-serif; /* Sans-serif font */
    cursor: pointer; /* Pointer cursor - it's clickable */
    transition: color 0.3s ease; /* Smooth color change */
    text-decoration: none; /* Remove default link underline */
    display: block; /* Make it block level for proper spacing */
}

/* Caption hover effect */
.video-caption:hover {
    color: #007bff; /* Change to blue on hover */
    text-decoration: underline; /* Add underline */
}

/* Mute/unmute button */
.mute-button {
    position: absolute; /* Position on top of video */
    bottom: 15px; /* 15 pixels from bottom */
    right: 15px; /* 15 pixels from right */
    background-color: transparent; /* No background color */
    border: none; /* No border */
    background-size: contain; /* Icon fills the button area */
    background-repeat: no-repeat; /* Don't tile the icon */
    background-position: center; /* Center the icon */
    width: 45px; /* Button width */
    height: 45px; /* Button height */
    border-radius: 50%; /* Make it circular */
    cursor: pointer; /* Pointer cursor */

    transition: opacity 0.3s ease;
    z-index: 10;
    opacity: 0.3;
}

.mute-button:hover {
    opacity: 0.7;
}

.mute-button.muted {
    background-image: url('images/muteIcon.png');
}

.mute-button.unmuted {
    background-image: url('images/speakerIcon.png');
}

/* =========================================================
   TEAM SECTION
   Styles for displaying team member cards
   ========================================================= */

/* Container for all team member cards */
.team-list {
    display: grid; /* Grid layout */
    grid-template-columns: repeat(4, 1fr); /* 4 columns on desktop */
    gap: 30px; /* Space between cards */
    margin: 40px auto; /* Center with space around */
    max-width: 1200px; /* Maximum width */
}

/* Individual team member card */
.team-member-box {
    display: flex; /* Vertical layout */
    flex-direction: column; /* Stack photo, name, title */
    align-items: center; /* Center items horizontally */
    gap: 12px; /* Space between elements */
    background: white; /* White background */
    padding: 20px; /* Space inside the card */
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    transition: box-shadow 0.3s ease; /* Smooth shadow animation */
}

/* Team card hover effect - gold glow */
.team-member-box:hover {
    box-shadow: 0 0 20px rgba(250, 192, 26, 0.6); /* Gold glowing shadow */
}

/* Benjamin's card hover effect - navy blue glow */
.team-member-box:has(img[alt="Benjamin Mayfield headshot"]):hover {
    box-shadow: 0 0 20px rgba(0, 24, 142, 0.619); /* Navy blue glowing shadow */
}

/* Team member photo */
.member-photo {
    width: 100%; /* Full width of card */
    aspect-ratio: 1; /* Square aspect ratio */
    object-fit: cover; /* Crop photo to fit */
    border-radius: 8px; /* Rounded corners on photo */
}

/* Team member name */
.team-member-box h3 {
    color: #002454; /* Dark navy blue */
    font-size: 18px; /* Name size */
    margin: 0; /* Remove default margin */
    text-align: center; /* Center the text */
    font-weight: 600; /* Semi-bold */
}

/* Team member title */
.member-title {
    color: #666; /* Gray text */
    font-size: 14px; /* Smaller text */
    margin: 0; /* Remove default margin */
    text-align: center; /* Center the text */
    transition: opacity 0.3s ease; /* Smooth fade transition */
}

/* Title animation when toggled */
.member-title.switching {
    opacity: 0; /* Fade out */
    transition: opacity 0.15s ease; /* Quick fade */
}

/* Photo container for glasses overlay effect */
.photo-container {
    position: relative; /* Allow absolute positioning of glasses */
    width: 100%; /* Full width */
    aspect-ratio: 1; /* Square aspect ratio */
}

/* MLG Glasses overlay */
.mlg-glasses {
    position: absolute; /* Overlay on top of headshot */
    top: 35%; /* Center vertically on eyes */
    left: 55%; /* Center horizontally */
    transform: translateX(-50%) translateY(-40px); /* Center and position above eyes (raised) */
    width: 45%; /* Glasses width relative to photo */
    height: auto; /* Maintain aspect ratio */
    opacity: 0; /* Start invisible */
    pointer-events: none; /* Don't interfere with click detection */
    transition: all 0.4s ease; /* Smooth animation */
}

/* Glasses lowered state */
.mlg-glasses.active {
    opacity: 1; /* Make visible */
    transform: translateX(-50%) translateY(0); /* Lower to eye level */
}

/* =========================================================
   PROJECT MENTOR SECTION
   Styles for the mentor box with horizontal layout
   ========================================================= */

/* Mentor section container */
.mentor-section {
    margin: 40px auto 60px; /* Spacing around section */
    max-width: 800px; /* Limit width */
}

/* Mentor box with horizontal layout */
.mentor-box {
    display: flex; /* Horizontal layout */
    align-items: center; /* Center vertically */
    gap: 30px; /* Space between photo and info */
    background: white; /* White background */
    padding: 30px; /* Space inside the box */
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    transition: box-shadow 0.3s ease; /* Smooth shadow animation */
}

/* Mentor box hover effect - gold glow */
.mentor-box:hover {
    box-shadow: 0 0 20px rgba(250, 192, 26, 0.6); /* Gold glowing shadow */
}

/* Mentor photo */
.mentor-photo {
    width: 200px; /* Fixed width */
    height: 200px; /* Fixed height */
    object-fit: cover; /* Crop photo to fit */
    border-radius: 8px; /* Rounded corners */
    flex-shrink: 0; /* Don't shrink photo */
}

/* Mentor info container */
.mentor-info {
    display: flex; /* Vertical layout */
    flex-direction: column; /* Stack name, title, link */
    gap: 8px; /* Space between elements */
}

/* Project Mentor section title inside box */
.mentor-info h3.mentor-section-title {
    color: #002454; /* Dark navy blue */
    font-size: 24px; /* Title size */
    margin: 0 0 8px 0; /* Space below */
    font-weight: 600; /* Semi-bold */
    letter-spacing: 0.5px; /* Slight letter spacing */
}

/* Mentor name */
.mentor-info h3:not(.mentor-section-title) {
    color: #002454; /* Dark navy blue */
    font-size: 18px; /* Name size */
    margin: 0; /* Remove default margin */
    font-weight: 600; /* Semi-bold */
}

/* Mentor title */
.mentor-title {
    color: #666; /* Gray text */
    font-size: 16px; /* Regular text */
    margin: 0; /* Remove default margin */
}

/* =========================================================
   TESTING PAGE
   Styles for displaying test stand photos and graphs
   ========================================================= */

/* Side-by-side container for desktop layout */
.side-by-side-container {
    display: flex; /* Horizontal layout on desktop */
    gap: 30px; /* Space between items */
    margin: 60px auto; /* Vertical spacing */
    max-width: 1400px; /* Maximum container width */
    padding: 0 20px; /* Side padding */
}

/* Individual items in side-by-side layout */
.side-by-side-item {
    flex: 1; /* Equal width */
    margin: 0; /* Remove default margin */
}

/* Container for each section of content on testing page */
.testing-section {
    margin: 60px auto; /* Center with space above and below */
}

/* Grid layout for displaying images side-by-side - AFFECTS flightComputerPrototype.jpg */
.testing-images {
    display: flex; /* Use flexbox to arrange images horizontally */
    justify-content: center; /* Center the entire group of images horizontally (creates centered "invisible box") */
    align-items: flex-start; /* Align images to top if they have different heights */
    gap: 10px; /* Add 10 pixels space between the two images */
    margin-bottom: 40px; /* Add 40 pixels space below the entire container */
}

/* Images inside description boxes get different spacing - AFFECTS flightComputerPrototype.jpg */
.testing-description .testing-images {
    margin-bottom: 24px; /* Change bottom spacing to 24px when this grid is inside a testing-description white box */
}

/* Container for stacking items vertically center */
.graph-container {
    display: flex; /* Flex layout */
    flex-direction: column; /* Stack vertically */
    align-items: center; /* Center horizontally */
}

/* Test photos and graphs - APPLIES TO flightComputerPrototype.jpg ON DESKTOP */
.testing-image {
    width: 100%; /* Make image fill 100% of its container width (50% of screen in the grid) */
    border-radius: 8px; /* Add 8 pixel curved corners to the image */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Add subtle shadow around image for depth */
    display: block; /* THIS IS IMPORTANT: Change image from inline to block so margins work correctly */
}

/* Images inside description boxes - scale down to fit - CRITICAL FOR flightComputerPrototype.jpg */
.testing-description .testing-image {
    max-height: 300px; /* IMPORTANT: Limit image height to 300 pixels maximum on desktop */
    width: auto; /* IMPORTANT: Keep the image's original aspect ratio (don't stretch) - if 1200px wide, keep that proportion */
    object-fit: scale-down; /* IMPORTANT: If image is larger than container, shrink it down; if smaller, keep original size (don't zoom in) */
}

/* Caption text under images */
.image-caption {
    margin-top: 12px; /* Space above caption */
    text-align: center; /* Center the text */
    color: #666; /* Gray text */
    font-size: 14px; /* Smaller text size */
    font-style: italic; /* Italicized text */
}

/* Description and text blocks on testing page */
.testing-description,
.testing-text-block {
    background: white; /* White background */
    padding: 25px; /* Space inside the box */
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    margin-bottom: 40px; /* Space below box */
    transition: box-shadow 0.3s ease; /* Smooth shadow animation */
}

/* Gold glow effect on hover */
.testing-description:hover,
.testing-text-block:hover {
    box-shadow: 0 0 20px rgba(250, 192, 26, 0.4); /* Gold glowing shadow */
}

/* Text block with image on the side */
.testing-text-block.with-side-image {
    display: flex; /* Side-by-side layout */
    gap: 25px; /* Space between text and image */
    align-items: flex-start; /* Align items to top */
}

/* Text content area */
.text-content {
    flex: 1; /* Take remaining space */
    min-width: 0; /* Allow text to shrink */
}

/* Side image container */
.side-image {
    flex-shrink: 0; /* Don't shrink the image */
    width: 350px; /* Fixed width for image */
}

.side-image img {
    width: 100%; /* Fill container */
    height: auto; /* Maintain aspect ratio */
    border-radius: 8px; /* Rounded corners */
}

/* Text inside testing boxes */
.testing-description p,
.testing-text-block p {
    color: #555; /* Dark gray text */
    font-size: 16px; /* Regular text size */
    line-height: 1.6; /* Space between lines */
    margin: 0; /* No extra margin */
}

/* Section subtitle headings */
.testing-subtitle {
    font-family: "IBM Plex Serif", serif; /* Fancy serif font */
    color: #002454; /* Dark navy blue */
    font-size: 28px; /* Large heading size */
    margin-top: 0; /* No space above */
    margin-bottom: 16px; /* Space below heading */
}

/* Field testing heading/subtitle outside any box */
.field-testing-section .testing-subtitle {
    text-align: center;
    font-size: 36px;
}

.field-testing-intro {
    text-align: center;
    color: #000;
    font-size: 16px;
    line-height: 1.6;
    max-width: 980px;
    margin: 0 auto 30px;
}

/* Flight cards side-by-side on desktop */
.flight-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.flight-card {
    margin-bottom: 0; /* Remove inherited bottom margin in grid */
}

.flight-card .testing-image {
    margin-bottom: 16px;
}

.flight-title {
    color: #002454;
    font-size: 22px;
    margin: 0 0 14px 0;
    font-family: "IBM Plex Serif", serif;
}

/* Small labeled summary blocks */
.flight-blocks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.flight-block {
    background: #f5f5f5;
    border-left: 4px solid #fac01a;
    border-radius: 8px;
    padding: 12px 14px;
}

.flight-block h4 {
    margin: 0 0 6px 0;
    color: #002454;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.flight-block p {
    margin: 0;
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

@media (max-width: 1000px) {
    /* Stack side-by-side sections vertically on tablets/mobile */
    .side-by-side-container {
        flex-direction: column; /* Stack vertically */
        gap: 0; /* Remove gap, use margin instead */
    }

    .side-by-side-item {
        margin: 60px auto; /* Restore vertical spacing */
    }

    .testing-description .testing-images {
        flex-direction: column;
    }

    /* Stack text and side image on tablets */
    .testing-text-block.with-side-image {
        flex-direction: column; /* Stack vertically */
    }

    .side-image {
        width: 100%; /* Full width on tablets */
        max-width: 500px; /* Limit max width */
        margin: 0 auto; /* Center the image */
    }

    .flight-cards-grid {
        grid-template-columns: 1fr; /* Stack flight cards */
    }

    .flight-title {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    /* MOBILE LAYOUT - Below 768px (tablets and phones) */
    .testing-images {
        grid-template-columns: 1fr; /* Change from 2 columns to 1 column (stack images vertically) */
        gap: 16px; /* Reduce gap between images from 30px to 16px on mobile */
    }

    /* Mobile styling for testing-images grid inside white description boxes - AFFECTS flightComputerPrototype.jpg */
    .testing-description .testing-images {
        margin-bottom: 20px; /* Reduce bottom margin to 20px on mobile */
        display: block; /* IMPORTANT: Change from grid layout to block layout (turns off the grid) */
    }

    /* ALL images inside testing-description on mobile (targets every <img> tag) - AFFECTS flightComputerPrototype.jpg HERE */
    .testing-description .testing-images img {
        display: block; /* Ensure image displays as block element (takes full width) */
        margin: 0 auto 16px; /* Center image horizontally (0 left/right, auto = center), 16px bottom margin, 0 top */
        max-height: 280px; /* IMPORTANT: Mobile height limit is 280px (slightly less than desktop's 300px) */
        width: 100%; /* Image fills 100% of container width */
        max-width: 100%; /* Never exceed container width (prevents overflow) */
        object-fit: scale-down; /* IMPORTANT: Shrink image to fit 280px height while keeping aspect ratio */
    }

    /* Remove bottom margin from the second image (testBenchSchematic) - so no extra space at end */
    .testing-description .testing-images img:last-child {
        margin-bottom: 0; /* Kill the 16px bottom margin on the last image */
    }

    .testing-description,
    .testing-text-block {
        padding: 20px;
    }

    .testing-subtitle {
        font-size: 24px;
    }

    /* Team grid responsive layout */
    .team-list {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px; /* Smaller gap */
        padding: 0 20px; /* Add side padding */
    }

    .team-member-box {
        max-width: 400px; /* Limit card width on mobile */
        margin: 0 auto; /* Center the cards */
    }

    /* Mentor box responsive layout */
    .mentor-box {
        flex-direction: column; /* Stack vertically on mobile */
        text-align: center; /* Center text */
        padding: 25px; /* Reduce padding */
    }

    .mentor-photo {
        width: 150px; /* Smaller photo on mobile */
        height: 150px;
    }

    .mentor-info {
        align-items: center; /* Center info items */
    }
}

/* Tablet breakpoint for team grid */
@media (max-width: 1000px) and (min-width: 769px) {
    .team-list {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
        gap: 25px;
    }
}

/* =========================================================
   CODE POPUP MODAL
   Modal for displaying code screenshots
   ========================================================= */

/* Clickable code link */
.code-link {
    color: #002454; /* Navy blue */
    text-decoration: underline; /* Underlined */
    cursor: pointer; /* Pointer cursor */
    transition: color 0.3s ease; /* Smooth color transition */
}

.code-link:hover {
    color: #fac01a; /* Gold on hover */
}

/* Modal container - hidden by default */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed positioning */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999; /* On top of everything */
}

/* Modal is visible when it has the 'active' class */
.modal.active {
    display: flex; /* Show and center content */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

/* Dimmed background overlay */
.modal-overlay {
    position: absolute; /* Cover entire screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Dark semi-transparent */
}

/* Modal content container */
.modal-content {
    position: relative; /* For positioning close button */
    max-width: 70%; /* Smaller on desktop */
    max-height: 85vh; /* Fit screen height */
    z-index: 10000; /* Above overlay */
}

/* Modal image */
.modal-image {
    max-width: 100%; /* Fit container */
    max-height: 85vh; /* Fit screen height */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); /* Shadow */
}

/* Video modal content - larger for better viewing */
.modal-video-content {
    max-width: 90%; /* Larger for video */
    max-height: 90vh;
}

/* Video inside modal */
.modal-video-content video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Launch thumbnail should have pointer cursor */
.launch-thumbnail {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.launch-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(250, 192, 26, 0.3);
}

/* Close button */
.modal-close {
    position: absolute; /* Position in top-right */
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Circular */
    background: #fac01a; /* Gold background */
    color: #002454; /* Navy text */
    font-size: 28px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modal-close:hover {
    background: #e5b01a; /* Darker gold */
    transform: scale(1.1); /* Slightly bigger */
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 85vh;
    }

    .modal-video-content {
        max-width: 95%;
        max-height: 85vh;
    }

    .modal-video-content video {
        max-height: 85vh;
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 24px;
        top: -10px;
        right: -10px;
    }

    /* Mobile viewport backlight effects */
    .mobile-active.team-member-box {
        box-shadow: 0 0 20px rgba(250, 192, 26, 0.6) !important;
    }

    .mobile-active.team-member-box:has(img[alt="Benjamin Mayfield headshot"]) {
        box-shadow: 0 0 20px rgba(0, 24, 142, 0.619) !important;
    }

    .mobile-active.mentor-box {
        box-shadow: 0 0 20px rgba(250, 192, 26, 0.6) !important;
    }

    .mobile-active.testing-description,
    .mobile-active.testing-text-block,
    .mobile-active.flight-card {
        box-shadow: 0 0 20px rgba(250, 192, 26, 0.4) !important;
    }

    .mobile-active.home-description {
        box-shadow: 0 0 20px rgba(250, 192, 26, 0.4) !important;
    }

    .mobile-active.concept-subsection {
        box-shadow: 0 0 20px rgba(250, 192, 26, 0.4) !important;
    }

    .mobile-active.pros-box {
        box-shadow: 0 0 20px rgba(34, 139, 34, 0.5) !important;
    }

    .mobile-active.cons-box {
        box-shadow: 0 0 20px rgba(178, 34, 34, 0.5) !important;
    }
}
