/* --- Global Styles & Variables --- */
:root {
    --sidebar-bg: #1e293b; /* Dark blue-gray */
    --main-bg: #f8fafc; /* Very light gray */
    --text-light: #cbd5e1; /* Light gray for sidebar text */
    --text-dark: #334155; /* Dark gray for main content text */
    --accent-color: #f59e0b; /* Amber/Yellow */
    --border-color: #334155; /* Slightly darker than sidebar bg for borders */
    --card-bg: #ffffff; /* White for cards/entries */
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --sidebar-width: 300px;
    --transition-speed: 0.3s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--main-bg);
}

.page-container {
    display: flex;
    min-height: 100vh;
}

a {
    text-decoration: none;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
}

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

.button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: var(--accent-color);
    color: var(--sidebar-bg);
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.button:hover {
    background-color: #d97706; /* Darker accent */
    color: #fff;
}

/* --- Duplicated Mobile Profile Header (Hidden by Default) --- */
.mobile-profile-header {
    display: none;
}

/* --- Mobile Menu Toggle/Close Buttons --- */
.mobile-menu-toggle {
    display: none; /* Hidden by default on desktop */
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001; /* Above sidebar when hidden */
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sidebar-close-button {
    display: none; /* Hidden by default */
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10; /* Ensure it's above scrollable content */
}

/* --- Sidebar Styles --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    /* overflow-y: auto; Removed, scrolling handled by inner div */
    display: flex; /* Use flexbox to position elements */
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.sidebar-content {
    /* This div might not be strictly necessary anymore but harmless */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure it fills sidebar */
}

.profile {
    text-align: center;
    margin-bottom: 0; /* Remove bottom margin */
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 1.5rem 1.5rem 1.5rem; /* Keep padding here */
    flex-shrink: 0; /* Prevent profile from shrinking */
}

.profile .headshot {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    margin: 0 auto 1rem auto;
    opacity: 0.7;
}

.profile .name {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.3rem;
}

.profile .title {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: normal;
    margin-bottom: 1rem;
}

.profile small {
    font-size: 0.8rem;
    color: var(--text-light);
    opacity: 0.7;
}

.sidebar-scrollable-content {
    flex-grow: 1; /* Take remaining vertical space */
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 1.5rem 1.5rem 2rem 1.5rem; /* Add padding (top, sides, bottom) */
    display: flex;
    flex-direction: column; /* Stack elements inside */
}

.sidebar-nav {
    margin-bottom: 2rem;
}

.sidebar-nav ul li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    color: var(--text-light);
    display: block;
    padding: 0.5rem 0;
    font-size: 1.1rem;
    border-left: 3px solid transparent;
    padding-left: 10px;
    transition: color var(--transition-speed), border-color var(--transition-speed), background-color var(--transition-speed);
}

.sidebar-nav a:hover,
.sidebar-nav a.active { /* Add .active class with JS later */
    color: #fff;
    border-left-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-section {
    margin-bottom: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.sidebar-section h3 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-info ul li {
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.contact-info a {
    color: var(--text-light);
}

.contact-info a:hover {
    color: var(--accent-color);
}

.download-cv {
    margin-top: 1rem;
    display: block; /* Make button full width */
}

/* Skills section removed from sidebar */
/*
.skills-info .skill-category {
    margin-bottom: 1rem;
}

.skills-info h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-style: normal;
}

.skills-list-sidebar li {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    padding-left: 1em; 
    position: relative;
}

.skills-list-sidebar li::before {
    content: "•"; 
    color: var(--accent-color);
    position: absolute;
    left: 0;
}
*/

.sidebar-footer {
    margin-top: auto; /* Push footer to bottom */
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.7;
    line-height: 1.4;
}

/* Ensure footer stays at the bottom of scrollable content */
.sidebar-scrollable-content .sidebar-footer {
    margin-top: auto; /* Push footer to bottom of this container */
}

/* --- Main Content Styles --- */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 3rem 2.5rem;
    width: calc(100% - var(--sidebar-width));
    background-color: var(--main-bg);
}

.content-section {
    background-color: var(--card-bg);
    padding: 2.5rem;
    margin-bottom: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-color);
    scroll-margin-top: 2rem; /* Offset for fixed header/nav if needed */
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-section h2 {
    font-size: 2rem;
    color: var(--sidebar-bg);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

/* --- Specific Section Styles --- */

/* About Section */
#about p {
    margin-bottom: 1rem;
}

/* Resume Section */
.resume-subsection {
    margin-bottom: 2.5rem;
}

.resume-subsection:last-child {
    margin-bottom: 0;
}

.resume-subsection h3 {
    font-size: 1.5rem;
    color: var(--sidebar-bg);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.resume-entry {
    margin-bottom: 2rem;
    padding-left: 1.5rem; /* Indent content */
    border-left: 3px solid var(--accent-color);
    position: relative;
}

.resume-entry:last-child {
    margin-bottom: 0;
}

.resume-details {
    /* Add flex display to align button and title */
    display: flex;
    align-items: baseline; /* Align button text and title baseline */
    flex-wrap: wrap; /* Allow items to wrap if needed */
}

.resume-details h4 {
    font-size: 1.2rem;
    color: var(--text-dark);
    /* margin-bottom: 0.2rem;  Removed margin, handled by flex gap */
    font-weight: bold;
    font-style: normal;
    order: 2; /* Keep h4 after the button visually */
    margin-left: 0.5rem; /* Space between button and title */
    cursor: pointer; /* Indicate it's clickable */
    flex-grow: 1; /* Allow title to take available space */
}

.resume-details h5 {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: normal;
    /* margin-bottom: 0.3rem; Removed margin, handled by flex gap */
    order: 3; /* Place company below title */
    width: 100%; /* Make it take full width on the next line */
    margin-top: 0.3rem;
}

.resume-details .date {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--sidebar-bg);
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 4px;
    /* margin-bottom: 0.8rem; Removed margin, handled by flex gap */
    font-weight: bold;
    order: 4; /* Place date below company */
     width: 100%; /* Make it take full width */
     margin-top: 0.5rem;
}

.resume-details ul {
    list-style: disc;
    padding-left: 20px;
    /* margin-top: 0.8rem; Removed - apply to .entry-bullet-points */
    /* order: 5; Removed - ul is no longer a direct child of flex container */
    /* width: 100%; Removed - apply to .entry-bullet-points */
}

.resume-details ul li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

/* Style the container for bullet points */
.entry-bullet-points {
    margin-top: 1rem; /* Space above the bullet points */
    width: 100%; /* Ensure it takes full width */
    padding-left: 10px; /* Optional: Slight indent */
}

/* Hide bullet points by default */
.entry-bullet-points.hidden {
    display: none;
}

/* Certifications Section */
/* Remove old styles */
/*
.certification-entry-main {
    padding: 1rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.certification-entry-main:last-child {
    border-bottom: none;
}

.certification-details-main h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
     font-weight: bold;
    font-style: normal;
}

.certification-details-main h5 {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: normal;
}
*/

/* New Grid Styles */
.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Responsive grid */
    gap: 1.5rem; /* Reduced space between items */
    margin-top: 1.5rem; /* Space below section title */
    align-items: start; /* Align items to the top */
}

.certification-item {
    text-align: center; /* Center image and text */
}

.certification-item img {
    max-height: 160px; /* Further increased badge height */
    width: auto; /* Maintain aspect ratio */
    margin: 0 auto 0.8rem auto; /* Center image horizontally, space below */
    object-fit: contain;
}

.certification-item p {
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.4;
}

/* Projects Section */
#projects p:first-of-type { /* Style the placeholder text */
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}

/* Contact Section */
.contact-form {
    margin-top: 2rem;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--sidebar-bg);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-family);
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    margin-top: 0.5rem;
}

/* New Skills Grid Styles */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Adjust minmax for size */
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.skill-item {
    background-color: var(--main-bg); /* Light background for contrast */
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.skill-item img {
    max-height: 50px; /* Adjust logo size */
    width: auto;
    margin: 0 auto 0.7rem auto;
    object-fit: contain;
}

.skill-item p {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 250px;
    }
    .main-content {
        padding: 2rem 1.5rem;
    }
     .content-section {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .page-container {
        flex-direction: column;
    }

    .sidebar {
        width: 280px; /* Fixed width for mobile slide-out */
        position: fixed; /* Fixed position for slide-in */
        left: 0;
        top: 0;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%); /* Initially hidden */
        transition: transform 0.4s ease;
        border-right: 1px solid var(--border-color);
        border-bottom: none; /* Remove bottom border from desktop stack */
    }

    /* Hide original profile inside sidebar on mobile */
    .sidebar .profile {
        display: none;
    }

    /* Adjust scrollable content padding since profile is gone */
    .sidebar .sidebar-scrollable-content {
        padding-top: 2.5rem; /* More space at top */
    }

    /* Show and Style the Mobile Profile Header */
    .mobile-profile-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 1.5rem 1rem 1rem 1rem;
        background-color: var(--sidebar-bg);
        color: var(--text-light);
        margin-bottom: 1.5rem; /* Space before main content sections */
        border-radius: 0 0 8px 8px; /* Optional rounded bottom corners */
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    .mobile-profile-header .headshot {
        width: 100px; /* Slightly smaller */
        height: 100px;
        border-color: var(--accent-color);
        margin-bottom: 0.8rem;
        border-radius: 50%; /* Make it circular */
        object-fit: cover; /* Ensure image covers the circle */
        border-width: 3px; /* Ensure border shows */
        border-style: solid;
    }
     .mobile-profile-header .name {
        font-size: 1.5rem;
        color: #fff;
        margin-bottom: 0.2rem;
    }
    .mobile-profile-header .title {
        font-size: 1rem;
        color: var(--accent-color);
        font-weight: normal;
    }

    .sidebar.sidebar-open {
        transform: translateX(0); /* Show sidebar */
        box-shadow: 5px 0px 15px rgba(0,0,0,0.2);
    }

    /* Show mobile buttons */
    .mobile-menu-toggle {
        display: block;
    }
    .sidebar-close-button {
        display: block;
    }

    /* Push main content when sidebar is static (not open) */
    .main-content {
        /* Revert styles from static stacking */
        margin-left: 0;
        width: 100%;
        transition: filter 0.4s ease; /* Optional: dim content */
    }

     /* Optional: Dim main content when sidebar is open */
    body.sidebar-active .main-content {
         filter: brightness(0.5);
         pointer-events: none; /* Prevent interaction with main content */
    }

    body.sidebar-active .mobile-menu-toggle {
        display: none; /* Hide hamburger when sidebar is open */
    }

    .content-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .profile .headshot {
        width: 120px;
        height: 120px;
    }

    .profile .name {
        font-size: 1.6rem;
    }

    .profile .title {
        font-size: 1rem;
    }

    .content-section h2 {
        font-size: 1.6rem;
    }

     .resume-details h4 {
        font-size: 1.1rem;
    }
     .resume-details h5 {
        font-size: 0.95rem;
    }
}

/* Style the toggle button */
.details-toggle {
    /* position: absolute; */ /* Remove absolute positioning */
    /* top: 0; */
    /* right: 0; */
    background-color: var(--accent-color);
    color: var(--sidebar-bg);
    border: none;
    border-radius: 50%;
    width: 24px; /* Slightly smaller */
    height: 24px;
    font-size: 1rem; /* Adjust size */
    font-weight: bold;
    line-height: 24px; /* Center the + vertically */
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    /* margin-left: 1rem; */ /* Remove left margin, handled by h4 margin */
    flex-shrink: 0; /* Prevent button from shrinking */
    order: 1; /* Ensure button comes first visually */
}

.details-toggle:hover {
    background-color: #d97706; /* Darker accent */
     color: #fff;
}

.details-toggle[aria-expanded="true"] {
    content: "−"; /* Change to minus when expanded */
    transform: rotate(180deg); /* Optional rotation effect */
}
