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

body {
    font-family: 'Orbitron', sans-serif;
    color: #FFFFFF;
    background-color: #0D0D0D;
    overflow-x: hidden;
}

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

/* Navigation Styles */
nav {
    background: rgba(13, 13, 13, 0.95);
    padding: 1em 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

nav.scrolled {
    background-color: rgba(13, 13, 13, 1);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    width: 100%;
    padding: 0 1em;
}

/* Logo Section */
.nav-left {
    flex: none;
    display: flex;
    align-items: center;
}

.nav-left img {
    height: 50px;
    width: auto;
    cursor: pointer;
    transition: height 0.3s ease;
}

/* Title Section */
.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s ease;
    z-index: 1;
}

.nav-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5em;
    color: #00FFFF;
    text-shadow: 0 0 5px #00FFFF;
    cursor: pointer;
    white-space: nowrap;
}

/* Navigation Links */
.nav-right {
    flex: none;
    display: flex;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.nav-links li {
    margin-left: 2em;
    position: relative;
}

/* Added separators between nav items */
.nav-links li::after {
    content: '';
    position: absolute;
    height: 60%;
    width: 1px;
    background-color: #00FFFF;
    right: -1em;
    top: 20%;
}

.nav-links li:last-child::after {
    display: none;
}

.nav-links a {
    color: #00FFFF;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #FFFFFF;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    font-size: 2em;
    color: #00FFFF;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    transition: transform 0.3s ease;
    z-index: 2;
}

.menu-toggle.open {
    transform: rotate(90deg);
}

/* Adjust breakpoint based on when the navigation links start to overlap the title */
@media (max-width: 1300px) {
    .nav-links {
        opacity: 0;
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        background: rgba(13, 13, 13, 0.95);
        flex-direction: column;
        transform: translateY(-20px);
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    }

    .nav-active .nav-links {
        opacity: 1;
        transform: translateY(0);
    }

    .menu-toggle {
        display: block;
    }

    .nav-center {
        transition: opacity 0.3s ease;
        left: 50%;
        transform: translateX(-50%);
    }

    .nav-active .nav-title {
        opacity: 0;
    }

    .nav-links li {
        margin: 1em 0;
    }

    .nav-links li::after {
        display: none;
    }

    .nav-links a {
        display: block;
        padding: 1em;
        color: #00FFFF;
        text-decoration: none;
        font-weight: bold;
        transition: color 0.3s;
    }

    .nav-links a:hover {
        color: #FFFFFF;
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Adjust content to prevent overlap with fixed nav */
header, section, footer {
    margin-top: 80px;
}

/* Hero Section */
header {
    position: relative;
    height: 100vh;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

/* Canvas Background */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0D0D0D;
    z-index: 0;
}

.hero {
    position: relative;
    z-index: 1;
    padding: 0 2em;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards 0.5s;
    margin-top: -150px; /* Increased negative margin for desktop */
}

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

.hero h1 {
    font-size: 3em;
    margin-bottom: 0.5em;
    text-shadow: 0 0 10px #00FFFF;
}

.hero p {
    font-size: 1.2em;
    margin-bottom: 2em;
    color: #B3FFFF;
}

/* Responsive adjustment for smaller screens */
@media (max-width: 768px) {
    .hero {
        margin-top: -250px; /* Less negative margin on smaller screens */
    }
}

/* Section Styles */
section {
    padding: 4em 0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
    scroll-margin-top: calc(50vh - 100px);
}

section:nth-of-type(even) {
    background-color: #1A1A1A;
}

.container {
    width: 85%;
    margin: 0 auto;
}

section h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 1em;
    color: #00FFFF;
    text-shadow: 0 0 5px #00FFFF;
}

section p {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 2em;
    color: #B3FFFF;
}

/* Team Section */
.team-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.team-member {
    flex: 1 1 calc(33.333% - 2em);
    margin: 1em;
    text-align: center;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
}

.team-member:nth-child(1) {
    animation-delay: 0.5s;
}

.team-member:nth-child(2) {
    animation-delay: 0.7s;
}

.team-member:nth-child(3) {
    animation-delay: 0.9s;
}

.team-member-photo {
    position: relative;
    display: inline-block;
}

.team-member-photo::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 180px;
    background: rgba(0, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.team-member-photo:hover::before {
    opacity: 1;
}

.team-member-photo img {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s, box-shadow 0.3s;
}

.team-member-photo img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px #00FFFF;
}

.team-member h3 {
    margin-top: 1em;
    color: #00FFFF;
    text-shadow: 0 0 5px #00FFFF;
}

.team-member p {
    margin-top: 0.5em;
    color: #B3FFFF;
}

/* Responsive adjustments for team section */
@media (max-width: 768px) {
    .team-member {
        flex: 1 1 100%;
    }
}

/* Mission Section - New Design */
#mission {
    background-color: #151515;
    padding: 5em 0;
}

.mission-container {
    display: flex;
    flex-direction: column;
    gap: 3em;
}

.mission-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4em;
    flex-wrap: wrap;
}

.mission-text {
    flex: 1;
    min-width: 300px;
}

.mission-text h3 {
    color: #00FFFF;
    font-size: 1.8em;
    margin-bottom: 1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mission-text p {
    color: #B3FFFF;
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 2em;
    text-align: left;
}

.mission-values {
    list-style: none;
    padding: 0;
}

.mission-values li {
    margin: 1em 0;
    color: #FFFFFF;
    display: flex;
    align-items: center;
}

.mission-values li::before {
    content: '▹';
    color: #00FFFF;
    margin-right: 10px;
    font-size: 1.2em;
}

.mission-values span {
    color: #00FFFF;
    font-weight: bold;
    margin-right: 5px;
}

/* Clean mission image design */
.mission-image {
    flex: 1;
    min-width: 300px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 500px;
    padding: 10px;
}

.mission-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.15);
    transition: all 0.4s ease;
    object-fit: cover;
    max-height: 350px;
    position: relative;
    z-index: 2;
}

/* Enhanced hover effect */
.mission-image img:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 255, 255, 0.25);
}

/* Replace box outline with subtle glow effect */
.mission-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 50% 50%, 
        rgba(0, 255, 255, 0.2), 
        transparent 70%
    );
    border-radius: 15px;
    z-index: 1;
    opacity: 0.6;
    filter: blur(10px);
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        opacity: 0.4;
        transform: scale(0.95);
    }
    100% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.mission-quote {
    text-align: center;
    padding: 2em;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.05) 0%, rgba(13, 13, 13, 0.05) 100%);
    border-left: 4px solid #00FFFF;
    border-radius: 5px;
    margin-top: 2em;
}

.mission-quote blockquote {
    font-size: 1.5em;
    font-style: italic;
    color: #FFFFFF;
    margin-bottom: 0.5em;
}

.mission-quote cite {
    color: #00FFFF;
    font-style: normal;
}

/* Products Section */
#products {
    background-color: #151515;
    padding: 5em 0;
}

.products-grid {
    /* Replace the existing grid definition with a more center-friendly approach */
    display: grid;
    /* Use auto-fit instead of auto-fill for better centering */
    grid-template-columns: repeat(auto-fit, 300px);
    gap: 2em;
    margin-top: 2em;
    /* These properties ensure proper centering */
    justify-content: center;
    
    /* For browsers with limited grid support */
    margin-left: auto;
    margin-right: auto;
}

.product-card {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s, box-shadow 0.4s;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
    display: flex;
    flex-direction: column;
    height: 450px; /* Fixed height for desktop */
    width: 100%; /* Ensure it fills the grid area */
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 255, 255, 0.2);
}

.product-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(13,13,13,1) 100%);
    opacity: 0.6;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-details {
    padding: 1.5em;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-details h3 {
    color: #00FFFF;
    margin-bottom: 0.5em;
    font-size: 1.4em;
    text-shadow: 0 0 3px rgba(0, 255, 255, 0.3);
}

.product-details p {
    color: #B3FFFF;
    font-size: 0.9em;
    line-height: 1.6;
    text-align: left;
    margin-bottom: 1em;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 100px; /* Maximum height before scrolling on desktop */
}

.product-link-container {
    margin-top: auto;
    padding-top: 1em;
}

.product-link {
    display: inline-block;
    padding: 0.5em 1.5em;
    background: rgba(0, 255, 255, 0.2);
    color: #00FFFF;
    border: 1px solid #00FFFF;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: bold;
}

.product-link:hover {
    background: rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3em;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #00FFFF;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    margin-top: 1em;
    color: #00FFFF;
}

/* Error message styling */
.products-error {
    text-align: center;
    padding: 2em;
}

.products-error p {
    color: #FF6B6B;
    margin-bottom: 1em;
}

.products-error button {
    padding: 0.8em 1.5em;
    background: rgba(0, 255, 255, 0.2);
    color: #00FFFF;
    border: 1px solid #00FFFF;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s;
}

.products-error button:hover {
    background: rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Fade-in animation for products */
@keyframes productFadeIn {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer Styles */
footer {
    background-color: #0D0D0D;
    color: #FFFFFF;
    padding: 2em 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

footer p {
    margin: 0;
    color: #B3FFFF;
}

/* Footer Animation */
.footer-animation {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: radial-gradient(circle at center, #00FFFF, transparent);
    animation: rotateFooter 20s linear infinite;
    opacity: 0.1;
}

@keyframes rotateFooter {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .nav-left img {
        height: 40px;
    }

    .nav-title {
        font-size: 1.2em;
    }

    .nav-links li {
        margin-left: 1.5em;
    }

    nav {
        padding: 0.5em 0;
    }

    /* Center the nav title on mobile */
    .nav-center {
        left: 50%;
        transform: translateX(-50%);
    }

    .mission-content {
        flex-direction: column-reverse;
        gap: 2em;
    }
    
    .mission-image {
        margin: 0 auto;
    }
    
    .mission-image img {
        max-width: 100%;
    }
    
    .mission-text p,
    .mission-text h3 {
        text-align: center;
    }
    
    .mission-values li {
        justify-content: flex-start;
        padding-left: 10%;
        padding-right: 10%;
        flex-wrap: wrap;
    }
    
    .mission-values li::before {
        min-width: 20px;
        margin-right: 15px;
    }
    
    .mission-values span {
        margin-right: 5px;
        display: inline;
    }
    
    /* Mobile product card adjustments */
    .products-grid {
        grid-template-columns: minmax(280px, 90%); /* Single centered column on mobile */
        gap: 1.5em;
    }
    
    .product-card {
        height: auto; /* Auto height instead of fixed on mobile */
        max-height: none;
    }
    
    .product-image {
        height: 180px; /* Slightly smaller images on mobile */
    }
    
    .product-details p {
        max-height: none; /* Remove max-height to avoid scrolling on mobile */
        overflow-y: visible; /* No scrolling needed */
    }
    
    .product-link-container {
        margin-top: 1em; /* Less space before button on mobile */
    }
}

/* Additional breakpoint for medium-sized screens */
@media (min-width: 769px) and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 300px); /* Two fixed-width columns on medium screens */
    }
    
    .product-card {
        height: 420px; /* Slightly smaller height on medium screens */
    }
}
