/* General Styling */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

h1, h2, h3 {
    font-weight: 600;
}

a {
    color: #007BFF;
    text-decoration: none;
}

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

section {
    padding: 60px 20px;
    /* FIX: Increased max-width for better desktop view */
    max-width: 1300px; 
    margin: 0 auto;
}

/* Navbar */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    /* FIX: Increased max-width for navbar content */
    max-width: 1300px; 
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

.nav-logo {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-item a {
    color: #555;
    font-weight: 400;
    transition: color 0.3s ease;
}

.nav-item a:hover {
    color: #007BFF;
}

/* About Section */
.about-section {
    text-align: center;
}

.about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    text-align: left;
}

.profile-pic {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.about-text {
    flex: 1;
}

/* ======== REVISED EDUCATION SECTION CSS ======== */
.education-section {
    background-color: #fff;
}

.education-grid {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: center;    /* Center the items horizontally */
    gap: 30px;
    margin-top: 30px;
}

.education-item {
    width: 100%;
    max-width: 900px; /* Control the max width for a clean look */
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    text-align: center; /* Center text inside the cards */
}

.education-item h3 {
    margin-top: 0;
    font-size: 1.3em;
    color: #333;
}

.education-item .university {
    font-weight: 600;
    color: #555;
    margin: 5px 0;
}

.education-item .dates {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 20px;
}

.degree-split {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    margin: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 20px 0;
    gap: 20px;
}

.degree-item {
    text-align: center;
}

.degree-item h4 {
    margin-bottom: 5px;
}

.degree-item p {
    margin: 0;
}

.diploma-links-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* This is the fix for overlapping buttons */
    gap: 15px; /* Adds space between buttons */
    margin-top: 20px;
}

.diploma-link {
    display: inline-block;
    background-color: #007BFF;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.diploma-link:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    color: #fff;
}

/* Projects Section */
.projects-section {
    text-align: center;
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.project-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: left;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card img {
    border-radius: 5px;
    margin-bottom: 15px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.project-card h3 {
    margin-top: 0;
}

.tech-stack {
    font-size: 0.9em;
    color: #666;
    margin-top: auto; /* Pushes links to the bottom */
    padding-top: 10px;
}

.project-links {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.project-links a {
    font-weight: 600;
}


/* Skills Section */
.skills-section {
    text-align: center;
}
.skills-container {
    display: flex;
    justify-content: space-around;
    text-align: left;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.skills-category {
    flex: 1;
    min-width: 200px;
}

.skills-category h3 {
    border-bottom: 2px solid #007BFF;
    padding-bottom: 5px;
}

.skills-category ul {
    list-style: none;
    padding: 0;
}

.skills-category li {
    margin-bottom: 10px;
}

/* Contact Section */
.contact-section {
    text-align: center;
}
.contact-links {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.contact-button {
    display: inline-block;
    background-color: #007BFF;
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.contact-button:hover {
    background-color: #0056b3;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: #fff;
    font-size: 0.9em;
}


/* --- Styles for Project Subpages --- */

.star-summary-box {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: 5px solid #007BFF;
    padding: 20px;
    margin: 40px 0;
    border-radius: 8px;
}

.star-summary-box h2 {
    margin-top: 0;
}

.star-summary-box ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.project-detail-header {
    background-color: #fff;
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
    margin-top: -60px; /* Pull it up to sit below the navbar */
}

.project-tagline {
    font-size: 1.2em;
    color: #555;
    max-width: 800px;
    margin: 10px auto 0 auto;
}

.project-detail-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

.project-banner-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.project-detail-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 40px;
    text-align: left;
}

.project-detail-text h2, .project-detail-text h3, .project-detail-text h4 {
    border-bottom: 2px solid #007BFF;
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 15px;
}
.project-detail-text ul {
    padding-left: 20px;
}
.project-detail-text ol {
    padding-left: 20px;
}

.project-detail-sidebar {
    background-color: #fcfcfc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
    height: fit-content;
    position: sticky;
    top: 100px; /* 60px navbar + 40px spacing */
}

.project-detail-sidebar h3 {
    margin-top: 0;
}

.tech-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-list li {
    background-color: #e9ecef;
    color: #495057;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
}

.sidebar-links {
    margin-top: 20px;
}

.sidebar-links .details-button {
    display: block;
    margin-bottom: 10px;
}

code {
    background-color: #e9ecef;
    color: #c7254e;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.details-button {
    display: inline-block;
    background-color: #28a745;
    color: #fff;
    padding: 8px 18px;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease;
}

.details-button:hover {
    background-color: #218838;
    color: #fff;
}

/* Pinned Project Styling */
.project-card.pinned {
    position: relative; /* Needed for absolute positioning of the pin */
    overflow: hidden; /* Ensure pin doesn't overflow rounded corners */
}

.project-card.pinned::before {
    content: "\f08d"; /* Font Awesome pin icon code */
    font-family: "Font Awesome 6 Free"; /* Specify Font Awesome font */
    font-weight: 900; /* Use solid icon style */
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff; /* White pin */
    background-color: #e67e22; /* A striking color for the pin's background */
    padding: 5px 8px;
    border-radius: 50%; /* Make it circular */
    font-size: 1.2em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10; /* Ensure it's above image */
}

/* --- FINAL CORRECTED LOGO STYLES V2 --- */
.program-logo-small {
    max-height: 40px;  /* Reduced JEMARO logo size */
    width: auto;
    margin: 10px 0;
}

.uni-logo {
    display: block; /* Helps with margin and centering */
    margin: 15px auto 5px auto; /* Centers the logo horizontally */
    object-fit: contain; /* Ensures no distortion */
    width: auto; /* Maintains aspect ratio */
}

/* Base height for normally proportioned logos */
#ecn-logo {
    max-height: 50px;
}

/* Target Keio logo specifically to reduce its size */
#keio-logo {
    max-height: 55px;
    max-width: 130px; /* Constrain its width to prevent it feeling too big */
}

/* Target Unige logo specifically to make it appear larger */
/* This works by allowing it more height, compensating for the whitespace */
#unige-logo {
    max-height: 60px;
    max-width: 240px;
}
/* --- END FINAL LOGO STYLES --- */

/* Styling for Responsive YouTube Video Embed */
.video-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio (divides 9 by 16) */
    margin-bottom: 40px; /* Adds space below the video */
    border-radius: 8px; /* Optional: adds rounded corners like your images */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Optional: adds a subtle shadow */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
}

/* Styling for the Cropped & Resized Project GIF */
.gif-banner {
    max-width: 300px; /* Controls the smaller size of the GIF. You can adjust this value. */
    margin: 0 auto 40px auto; /* Centers the container and adds space below */
    aspect-ratio: 1 / 1; /* This forces the container to be a perfect square */
    
    background-image: url('images/ros2-demo.gif'); /* Sets your GIF as the background */
    background-size: cover; /* Zooms the GIF to fill the square, cropping the sides */
    background-position: center center; /* Ensures the cropping is centered */
    
    border-radius: 8px; /* Optional: adds rounded corners */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Optional: adds a subtle shadow */
}

/* Responsive adjustments for logos on smaller screens */
@media (max-width: 480px) {
    .education-header {
        flex-direction: column;
        text-align: center;
    }
}


/* --- Responsive Design --- */
@media (max-width: 900px) {
    .project-detail-grid {
        grid-template-columns: 1fr;
    }
    .project-detail-sidebar {
        position: static;
        margin-top: 40px;
    }
}


@media (max-width: 768px) {
    .about-container {
        flex-direction: column;
        text-align: center;
    }
}
