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

:root {
    --primary-color: #603311;
    --primary-light: #8B4B1A;
    --primary-dark: #462408;
    --text-dark: #333333;
    --text-light: #666666;
    --background-light: #faf6f3;
    --white: #ffffff;
    --border-radius: 12px;
    --border-radius-pill: 50px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --max-width: 1200px;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
    overflow-x: hidden;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
header {
    position: fixed;
    width: 100%;
    top: 1rem;
    z-index: 1000;
    padding: 0 1rem;
}

.nav-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-pill);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.nav-wrapper.scrolled {
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-0.5rem);
}

.nav-left {
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-dark);
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-pill);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 80%;
}

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

.contact-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
    color: var(--white) !important;
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius-pill);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(96, 51, 17, 0.2);
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
}

.mobile-only {
    display: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    transition: all 0.3s ease;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    bottom: -6px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    header {
        top: 0.5rem;
        padding: 0 0.5rem;
    }

    .nav-wrapper {
        padding: 0.75rem 1rem;
    }

    .mobile-menu-btn {
        display: block;
        margin-left: auto;
    }

    .nav-right {
        gap: 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-md);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn.active .hamburger {
        background: transparent;
    }

    .mobile-menu-btn.active .hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }

    .mobile-menu-btn.active .hamburger::after {
        transform: rotate(-45deg);
        bottom: 0;
    }

    .mobile-only {
        display: block;
    }

    .hide-on-mobile {
        display: none;
    }
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 80px; /* Account for navbar */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
    z-index: -1;
}

.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Darken the background image */
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 0 2rem;
    text-align: center;
}

.glass-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: var(--white);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.primary-btn, .secondary-btn {
    padding: 0.8rem 2rem;
    border-radius: var(--border-radius-pill);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.primary-btn {
    background: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
}

.primary-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(96, 51, 17, 0.3);
}

.secondary-btn {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .hero {
        padding-top: 60px;
    }

    .glass-container {
        padding: 2rem 1rem;
        margin: 0 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .primary-btn, .secondary-btn {
        width: 100%;
        text-align: center;
    }
}

/* Sections */
section:not(.hero):not(.team) {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 5rem 2rem;
}

h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-color);
    border-radius: var(--border-radius-pill);
}

/* Team Section */
.team {
    background-color: var(--primary-dark);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 4rem 2rem;
    color: var(--white);
    position: relative;
    box-sizing: border-box;
}

.team h2 {
    color: var(--white);
    text-align: center;
}

.team-content {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.team-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.team-text h3 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.team-gallery {
    display: flex;
    justify-content: center;
}

.gallery-item {
    position: relative;
    width: 100%;
    max-width: 600px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.1s ease;
}

.gallery-item img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 2rem;
    color: var(--white);
    text-align: center;
}

.gallery-overlay span {
    font-size: 1.2rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .team {
        padding: 3rem 1rem;
    }
    
    .gallery-item {
        transform: none !important;
    }
    
    .gallery-item img {
        height: 300px;
    }
}

/* About Section */
.about .content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about .text {
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Robot Section */
.robot-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.robot-image img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.robot-description {
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Contact Section */
.contact {
    padding: 5rem 2rem;
    text-align: center;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.contact-text {
    margin-bottom: 2rem;
}

.contact-text h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--background-light);
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

.social-link i {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .contact-content {
        padding: 2rem 1rem;
    }
    
    .social-links {
        gap: 1rem;
    }
}

/* Footer */
footer {
    background: var(--primary-color);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 1rem;
        flex-direction: column;
    }

    nav ul li {
        margin: 0.5rem 0;
    }

    .about .content,
    .robot-showcase {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 3rem 1rem;
    }
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

img:hover {
    transform: scale(1.02);
}

.footer-content {
    color: var(--background-light);
}

/* Scroll to Top Button */
#scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1000;
}

#scroll-to-top:hover {
    transform: translateY(-3px);
    background: var(--primary-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#scroll-to-top.visible {
    display: flex;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section Improvements */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Card Hover Effects */
.team-member, .robot-description, .contact-content {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-member:hover, .robot-description:hover, .contact-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

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

/* Improved Footer */
footer {
    background: var(--primary-color);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    color: var(--background-light);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-content:hover {
    opacity: 1;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    #scroll-to-top {
        bottom: 10px;
        right: 10px;
    }

    .section-header {
        margin-bottom: 2rem;
    }
}

/* Accessibility Improvements */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-color);
    color: var(--white);
    padding: 10px;
    z-index: 1001;
    transition: top 0.3s ease;
}

.skip-to-main:focus {
    top: 0;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

body.loaded .preloader {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.gear-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.gear-outer {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 8px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 4s linear infinite;
}

.gear-outer::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -8px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    transform: translateX(-50%);
    border-radius: 6px;
}

.gear-outer::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    transform: translateX(-50%);
    border-radius: 6px;
}

.gear-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 8px solid var(--primary-light);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin-reverse 2s linear infinite;
}

.gear-inner::before,
.gear-inner::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--primary-light);
    border-radius: 4px;
}

.gear-inner::before {
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
}

.gear-inner::after {
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
}

.loading-text {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes spin-reverse {
    to {
        transform: translate(-50%, -50%) rotate(-360deg);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

/* Hide content while loading */
body.loading .content-wrapper {
    opacity: 0;
}

.content-wrapper {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}