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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    overflow-x: hidden; /* Helps prevent accidental horizontal scroll */
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
    padding: 0 20px;
}

/* Navigation */
nav {
    background: #333;
    color: #fff;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1.logo-text {
    color: #fff;
    margin: 0;
    font-size: 1.5rem;
}

/* Styles for the UL on desktop */
nav ul#primary-navigation {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Horizontal layout on desktop */
    align-items: center;
}

nav ul#primary-navigation li {
    margin-left: 20px; /* Spacing for desktop */
}

nav ul#primary-navigation li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav ul#primary-navigation li a:hover {
    color: #00aaff;
}

/* Hamburger Menu Button Styles */
.nav-toggle {
    display: none; /* Hidden on desktop by default */
    background: transparent;
    border: 0;
    padding: 0.5em;
    cursor: pointer;
    z-index: 1001; /* Ensure it's clickable */
}

.hamburger {
    display: block;
    position: relative;
    width: 1.75em; /* Size of the hamburger icon */
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s ease-in-out, top 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.hamburger::before {
    top: -7px; /* Spacing of lines */
}

.hamburger::after {
    top: 7px;
}

/* Hamburger animation to X when .is-active class is added by JS */
.nav-toggle.is-active .hamburger {
    background-color: transparent; /* Middle line fades out */
}

.nav-toggle.is-active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle.is-active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}


/* Language Switcher Styling (remains largely the same) */
#lang-switcher {
    cursor: pointer;
}
 #lang-switcher a {
     border: 1px solid #00aaff;
     padding: 5px 10px;
     border-radius: 4px;
     font-size: 0.9rem;
     transition: background-color 0.3s ease, color 0.3s ease;
 }
 #lang-switcher a:hover {
     background-color: #00aaff;
     color: #333;
 }


/* Cover Section */
#cover {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
    background-color: #2c3e50;
    box-sizing: border-box;
}

#cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.cover-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2c3e50;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: 0;
}

#cover .content {
    position: relative;
    z-index: 2;
    padding: 20px;
}

#cover h2 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

#cover p {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.btn {
    display: inline-block;
    background: #00aaff;
    color: #fff;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #0077cc;
    transform: translateY(-2px);
}

/* General Section Styling */
section {
    padding: 80px 0;
    margin-top: 0;
    box-sizing: border-box;
}
.project-detail-section {
    padding-top: 100px;
    padding-bottom: 80px;
}

section:nth-of-type(odd) { background: #f4f4f4; }
section:nth-of-type(even) { background: #e9e9e9; }
#about { background: #fff; }

section h2.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #333;
    position: relative;
    padding-bottom: 10px;
}

section h2.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #00aaff;
    border-radius: 2px;
}

/* About Section */
#about .container-flex { display: flex; flex-wrap: wrap; gap: 30px; align-items: center; }
#about .about-content { flex: 2; min-width: 300px; }
#about .about-image-placeholder {
    flex: 1; min-width: 250px; height: 350px; background-color: #ccc;
    background-position: center center; background-size: cover; background-repeat: no-repeat;
    border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
#about h3 { font-size: 1.8rem; color: #00aaff; margin-top: 20px; margin-bottom: 15px; }
#about .about-content p { margin-bottom: 10px; font-size: 1.1rem; }
#about ul { list-style: none; padding-left: 0; }
#about ul li {
    background: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2300aaff" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>') no-repeat left center;
    padding-left: 30px; margin-bottom: 8px; font-size: 1.1rem;
}

/* Projects Section (Main Page) */
#projects { background-color: #e9e9e9; }
.project-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 769px) { .project-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; } }
.project-item {
    background: #fff; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
}
.project-item:hover { transform: translateY(-5px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.project-image-placeholder {
    width: 100%; aspect-ratio: 1 / 1; background-color: #ddd;
    display: flex; align-items: center; justify-content: center; color: #fff;
    font-size: 1.1rem; text-align: center; background-size: cover;
    background-position: center; background-repeat: no-repeat;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.project-info { padding: 20px; flex-grow: 1; }
.project-info h3 { font-size: 1.3rem; color: #00aaff; margin-bottom: 10px; }
.project-info p {
    font-size: 0.9rem; margin-bottom: 10px; display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
}
.project-info ul { list-style: none; padding-left: 0; font-size: 0.9rem; }
.project-info ul li { margin-bottom: 5px; padding-left: 20px; position: relative; font-size: 0.9rem; }
.project-info ul li::before {
    content: '•'; color: #00aaff; font-weight: bold;
    display: inline-block; position: absolute; left: 0; top: -1px;
}

/* Project Detail Page Specific Styles */
.project-detail-content { max-width: 900px; margin: auto; padding: 0 20px; text-align: center; }
.project-detail-content h2 { font-size: 2.5rem; margin-bottom: 30px; color: #333; }
.carousel-container {
    position: relative; width: 100%; max-width: 800px; margin: 20px auto 30px auto;
    overflow: hidden; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    aspect-ratio: 16 / 9; background-color: #eee;
}
.carousel-slides { display: flex; width: 100%; height: 100%; transition: transform 0.5s ease-in-out; }
.carousel-slide {
    min-width: 100%; height: 100%; background-size: contain; background-position: center;
    background-repeat: no-repeat; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 2em; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); cursor: pointer;
}
.carousel-slide img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.project-detail-description { margin-top: 30px; text-align: left; font-size: 1.1rem; line-height: 1.8; }
.project-detail-description h3 { font-size: 1.6rem; color: #00aaff; margin-bottom: 15px; text-align: center; }
.project-detail-description p { margin-bottom: 15px; }
.project-detail-description ul { list-style: disc; padding-left: 20px; margin-bottom: 15px; }

/* Contact Section */
#contact {
    background-color: #f4f4f4;
    text-align: center; /* Center the content of the contact section */
}

#contact .container {
    max-width: 700px;
}

#contact p.contact-intro {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 40px; /* Increased margin */
    color: #555;
    line-height: 1.7;
}

.contact-options {
    display: flex;
    justify-content: center; /* Center the buttons */
    gap: 20px; /* Space between buttons */
    margin-bottom: 30px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.contact-option {
    display: inline-flex; /* Align icon and text nicely */
    align-items: center;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
    border: 2px solid transparent; /* For a nice hover/focus effect */
    min-width: 220px; /* Ensure buttons have a decent minimum width */
    justify-content: center; /* Center content within the button */
}

.contact-icon {
    width: 24px; /* Adjust size as needed */
    height: 24px;
    margin-right: 10px;
}

.contact-option.linkedin {
    background-color: #0077B5; /* LinkedIn blue */
    color: #fff;
}
.contact-option.linkedin:hover,
.contact-option.linkedin:focus {
    background-color: #005e8e;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 119, 181, 0.3);
}

.contact-option.email {
    background-color: #555; /* A neutral dark grey */
    color: #fff;
}
.contact-option.email:hover,
.contact-option.email:focus {
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(85, 85, 85, 0.3);
}

/* For accessibility: better focus styles */
.contact-option:focus {
    outline: none;
    border-color: #00aaff; /* Your accent color */
}

p.contact-email-direct {
    margin-top: 40px;
    font-size: 1rem;
    color: #666;
}
p.contact-email-address {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0077cc; /* Make email address stand out */
    margin-top: 5px;
    word-break: break-all; /* Prevent overflow on small screens */
}


/* Responsive adjustments for contact options if needed */
@media (max-width: 520px) { /* Breakpoint when buttons might get too squeezed */
    .contact-options {
        flex-direction: column; /* Stack buttons vertically */
        align-items: center; /* Center stacked buttons */
    }
    .contact-option {
        width: 100%; /* Make buttons take full available width */
        max-width: 300px; /* But not too wide on slightly larger small screens */
        margin-bottom: 15px; /* Space between stacked buttons */
    }
    .contact-option:last-child {
        margin-bottom: 0;
    }
}

/* Footer */
footer { background: #333; color: #fff; text-align: center; padding: 1.5rem 0; }
footer p { margin: 0; font-size: 0.9rem; }
footer p:last-child { margin-top: 5px; font-size: 0.8rem; opacity: 0.8; }

/* Modal Styles */
.modal {
    position: fixed; z-index: 2000; padding-top: 20px; left: 0; top: 0;
    width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.9);
    display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.modal-content {
    margin: auto; display: block; width: 95%; height: 95%;
    max-width: 95%; max-height: 95vh; object-fit: contain;
}
#caption {
    margin: 10px auto 0; display: block; width: 95%; max-width: 95%;
    text-align: center; color: #ccc; padding: 10px 0; height: auto;
}
.close-modal {
    position: absolute; top: 15px; right: 35px; color: #f1f1f1;
    font-size: 40px; font-weight: bold; transition: 0.3s; z-index: 2002;
}
.close-modal:hover, .close-modal:focus { color: #bbb; text-decoration: none; cursor: pointer; }
.prev-modal, .next-modal {
    cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px;
    margin-top: 0; transform: translateY(-50%); color: white; font-weight: bold;
    font-size: 24px; transition: 0.3s ease; border-radius: 0 3px 3px 0;
    user-select: none; -webkit-user-select: none; background-color: rgba(0,0,0,0.3); z-index: 2001;
}
.next-modal { right: 10px; border-radius: 3px 0 0 3px; }
.prev-modal { left: 10px; border-radius: 3px 0 0 3px; }
.prev-modal:hover, .next-modal:hover { background-color: rgba(0,0,0,0.8); }
.modal-content, #caption { animation: zoom 0.6s; }
@keyframes zoom { from {transform:scale(0)} to {transform:scale(1)} }

/* Smooth Scroll & Nav Offset */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px; /* Default for desktop nav height */
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        /* Height of the COLLAPSED mobile nav (logo + hamburger) */
        /* ADJUST THIS VALUE after inspecting your page: e.g., 60px, 70px, 80px */
        --mobile-nav-height: 70px;
    }

    html {
        scroll-padding-top: var(--mobile-nav-height);
    }

    nav .container {
        /* flex-direction: row; /* Default, good */
        /* justify-content: space-between; /* Default, good */
        /* align-items: center; /* Default, good */
    }
    nav h1.logo-text {
        font-size: 1.3rem; /* Slightly larger for better presence */
        margin-bottom: 0; /* No margin if items are aligned with flex */
    }

    .nav-toggle {
        display: block; /* Show hamburger on mobile */
    }

    nav ul#primary-navigation {
        display: none; /* Hidden by default */
        position: absolute;
        top: 100%; /* Position below the main nav bar */
        left: 0;
        width: 100%;
        background: #333; /* Match nav background */
        flex-direction: column;
        align-items: center; /* Center nav items */
        padding: 0.5rem 0; /* Padding for the dropdown */
        box-shadow: 0 3px 5px rgba(0,0,0,0.2); /* Add a subtle shadow */
        z-index: 999; /* Below main nav but above page content if needed */
    }

    nav ul#primary-navigation.nav-ul-active {
        display: flex; /* Show when active class is present */
    }

    nav ul#primary-navigation li {
        margin: 0; /* Reset margin for vertical layout */
        width: 100%; /* Make list items take full width */
    }

    nav ul#primary-navigation li a {
        display: block; /* Make entire area clickable */
        padding: 0.75rem 1rem; /* Generous padding for touch targets */
        text-align: center;
        font-size: 1rem;
        border-bottom: 1px solid #444; /* Separator */
    }
    nav ul#primary-navigation li:last-child a {
        border-bottom: none; /* No border for the last item */
    }
    #lang-switcher {
        width: 100%; /* Ensure lang switcher also takes full width if inside ul */
    }
    #lang-switcher a {
         border: none; /* Remove border specific to desktop */
         padding: 0.75rem 1rem; /* Match other mobile nav links */
         /* background-color transparent and color white are inherited */
    }
     #lang-switcher a:hover {
         background-color: #00aaff; /* Keep hover consistent */
         color: #333;
     }


    /* Adjust #cover and other sections for the new, shorter mobile nav height */
    #cover {
        height: auto;
        min-height: 100vh; /* Still aim to fill viewport */
        padding-top: var(--mobile-nav-height); /* Space for collapsed nav */
        padding-bottom: 40px;
    }
    #cover h2 { font-size: 1.8rem; }
    #cover p { font-size: 1rem; }

    .container { width: 90%; }
    section { padding: 40px 0; }
    .project-detail-section {
        padding-top: calc(var(--mobile-nav-height) + 20px); /* Nav height + buffer */
        padding-bottom: 40px;
    }
    main > section:first-child:not(#cover) { /* If a page starts with a regular section */
        padding-top: calc(var(--mobile-nav-height) + 20px);
    }

    section h2.section-title { font-size: 1.8rem; margin-bottom: 20px; }
    #about .container-flex {
        flex-direction: column; /* This is correct for stacking content and image */
        align-items: center;   /* This will center the items in the column, including the image */
    }

    #about .about-content {
        order: 2; /* Optional: Puts text content below the image on mobile if desired */
        text-align: center; /* Optional: Center text content on mobile */
    }

    #about .about-image-placeholder {
        display: block; /* Ensure it's a block-level element */
        order: 1; /* Optional: Puts image above the text content on mobile */
        width: 80%;     /* Use a percentage for better responsiveness within its container */
        max-width: 280px; /* Max size, adjust as you like */
        height: auto;     /* Let height be determined by width and aspect ratio */
        aspect-ratio: 1 / 1; /* Make it square, adjust if your image is different (e.g., 4/3) */
        margin: 0 auto 30px auto; /* Center it horizontally and add bottom margin */

        /* Background image properties (should be set inline, but good to have fallbacks/ensure they are not overridden) */
        background-color: #ccc; /* Fallback color */
        background-position: center center;
        background-size: cover;
        background-repeat: no-repeat;
        border-radius: 8px; /* Consistent with desktop */
        box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Consistent with desktop */
        visibility: visible !important; /* Force visibility if something else is hiding it, use with caution */
        opacity: 1 !important; /* Force opacity if something else is making it transparent, use with caution */
    }

    #about h3 { /* Adjust heading alignment if text is centered */
        text-align: center;
    }
    #about ul { /* Adjust list alignment if text is centered */
       display: inline-block; /* Allows text-align center on parent to work for block element */
       text-align: left; /* Keep list items left-aligned within the centered block */
       padding-left: 0; /* Reset padding if using inline-block approach */
    }

    .project-info h3 { font-size: 1.2rem; }
    .project-info p, .project-info ul, .project-info ul li { font-size: 0.85rem; }
    .project-detail-content h2 { font-size: 2rem; margin-bottom: 20px; }
    .project-detail-description { font-size: 1rem; }
    .project-detail-description h3 { font-size: 1.4rem; }

    .modal-content { width: 95%; max-width: 95%; }
    .prev-modal, .next-modal {
        font-size: 18px; padding: 12px; transform: translateY(-50%);
    }
    .next-modal { right: 5px; }
    .prev-modal { left: 5px; }
}