/* --- Global Styles & Variables --- */
:root {
    --primary-color: #00adb5; /* A vibrant teal/blue */
    --secondary-color: #393e46; /* Darker shade for accents/backgrounds */
    --background-color: #222831; /* Dark background */
    --text-color: #eeeeee; /* Light text */
    --card-background: #2d343e; /* Original card background */
    --border-color: #4a5361; /* Border color - now used for timeline box background */
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
    --header-height: 70px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size */
}

body {
    font-family: var(--font-secondary);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6; /* Default line height */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    color: var(--primary-color); /* Keep headings blue */
    margin-bottom: 0.8em;
    line-height: 1.2;
}

h1 { font-size: 3.2rem; margin-bottom: 0.3em; color: #fff; } /* Hero H1 specific */
h2 { font-size: 2.2rem; text-align: center; padding-bottom: 20px; position: relative; }
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
}
h3 { font-size: 1.5rem;} /* Removed conflicting color rule */

p { margin-bottom: 1em; line-height: 1.6; } /* Default paragraph spacing */
a { color: var(--primary-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: #00cdd7; }
ul { list-style: none; }

.container { width: 90%; max-width: 1100px; margin: 0 auto; padding: 0 15px; }
.content-section { padding: 80px 0; }
.alt-bg { background-color: var(--secondary-color); }

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}
.cta-button:hover { background-color: #007a7f; color: #ffffff; transform: translateY(-2px); }

/* --- Header & Navigation --- */
header {
    background-color: rgba(34, 40, 49, 0.95);
    position: fixed; width: 100%; top: 0; left: 0; z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2); height: var(--header-height);
}
nav {
    display: flex; justify-content: space-between; align-items: center;
    height: 100%; padding: 0 20px; max-width: 1200px; margin: 0 auto;
}
nav .logo { font-size: 1.5rem; font-weight: bold; color: var(--primary-color); }
nav ul { display: flex; list-style: none; }
nav ul li { margin-left: 25px; }
nav ul li a {
    color: var(--text-color); text-decoration: none; font-weight: 500;
    padding: 5px 0; position: relative; transition: color 0.3s ease;
}
nav ul li a::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background-color: var(--primary-color); transition: width 0.3s ease;
}
nav ul li a:hover::after, nav ul li a.active::after { width: 100%; }
nav ul li a:hover, nav ul li a.active { color: var(--primary-color); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; }
.hamburger { display: block; width: 25px; height: 3px; background-color: var(--text-color); position: relative; transition: background-color 0.3s ease; }
.hamburger::before, .hamburger::after {
    content: ''; position: absolute; width: 25px; height: 3px;
    background-color: var(--text-color); left: 0;
    transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

/* --- Hero Section --- */
.hero-section {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; min-height: 100vh; padding-top: var(--header-height);
    background: linear-gradient(rgba(34, 40, 49, 0.85), rgba(34, 40, 49, 0.85)), url('../assets/images/hero-bg-placeholder.jpg') no-repeat center center/cover;
}
.hero-content {} /* Container for hero text if needed */
.hero-overview { /* New class for the overview paragraph */
    font-size: 1.25rem;
    margin-top: 15px;
    margin-bottom: 1.5em;
    max-width: 750px;
    color: #ddd;
    line-height: 1.7;
}

.scroll-down-indicator { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); }
.scroll-down-indicator a { font-size: 2rem; color: var(--primary-color); animation: bounce 2s infinite; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-10px);} 60% {transform: translateY(-5px);} }

/* --- About Section --- */
.about-content { display: flex; gap: 30px; align-items: flex-start; }
.about-text { flex: 1.8; } /* Default flex for text column */
.about-image-and-leadership { flex: 1.2; display: flex; flex-direction: column; align-items: center; } /* Default flex for image/leadership column */

.about-image { text-align: center; margin-bottom: 25px; }
.about-image img { max-width: 280px; width: 100%; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); border: 3px solid var(--primary-color); }
.skills-list { list-style: none; padding: 0; columns: 2; gap: 10px; }
.skills-list li { margin-bottom: 10px; font-size: 0.95rem; display: flex; align-items: center; line-height: 1.2 !important; } /* Ensure 1.2 line height */
.skills-list li i { color: var(--primary-color); margin-right: 10px; font-size: 1.1rem; width: 20px; text-align: center; }
.technical-skills-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tech-skill-tag { background-color: var(--secondary-color); color: var(--primary-color); padding: 6px 12px; border-radius: 4px; font-size: 0.85rem; line-height: 1.2 !important; } /* Ensure 1.2 line height */
.leadership-organizations { width: 100%; background-color: var(--card-background); padding: 20px; border-radius: 6px; box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
.leadership-organizations h3 { text-align: center; margin-bottom: 15px; color: var(--primary-color); line-height: 1.2 !important;} /* Ensure 1.2 line height */
.leadership-organizations ul li { margin-bottom: 8px; font-size: 0.9rem; line-height: 1.2 !important; } /* Ensure 1.2 line height */

/* --- Experience Section (Vertical Timeline, with Horizontal "Chip" Bullet Points Inside) --- */
.timeline {
    position: relative;
    max-width: 1000px; /* Keep original max-width for the container */
    margin: 0 auto;
}

.timeline::after { /* The central line */
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%; /* Each item takes half the width of the .timeline container by default */
    margin-bottom: 30px;
}
.timeline-item:nth-child(odd) {
    left: 0;
}
.timeline-item:nth-child(even) {
    left: 50%;
}
.timeline-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    right: -25px;
    background-color: var(--background-color);
    border: 3px solid var(--primary-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}
.timeline-item:nth-child(even) .timeline-icon {
    left: -25px;
}
.timeline-content {
    padding: 20px; /* Padding inside the content box */
    background-color: var(--card-background);
    position: relative;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    /* Width is determined by parent .timeline-item */
}

/* Arrow for timeline items (Original ::before implementation - used for desktop default and mobile) */
.timeline-item:nth-child(odd) .timeline-content::before {
    content: " "; height: 0; position: absolute; top: 22px; width: 0; z-index: 1;
    right: 30px; border: medium solid var(--card-background);
    border-width: 10px 0 10px 10px; border-color: transparent transparent transparent var(--card-background);
}
.timeline-item:nth-child(even) .timeline-content::before {
    content: " "; height: 0; position: absolute; top: 22px; width: 0; z-index: 1;
    left: 30px; border: medium solid var(--card-background);
    border-width: 10px 10px 10px 0; border-color: transparent var(--card-background) transparent transparent;
}


.timeline-content h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.3rem;
}
.company-date {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 15px;
    line-height: 1.2 !important; /* Ensure 1.2 line height */
}

.experience-details-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 0;
    margin-bottom: 10px;
    list-style-type: none;
}
.experience-details-list li {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 16px; /* Pill shape */
    font-size: 0.85rem;
    line-height: 1.2 !important; /* Ensure 1.2 line height */
    border: 1px solid var(--border-color);
}
.tech-tags {
    display: block;
    margin-top: 15px;
    font-size: 0.85rem;
    color: #ccc;
    font-style: italic;
    line-height: 1.2 !important; /* Ensure 1.2 line height */
}

/* --- Projects Section --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.project-card {
    background-color: var(--card-background); border-radius: 8px; overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.project-card img { width: 100%; height: 200px; object-fit: cover; }
.project-info { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.project-info h3 { margin-top: 0; color: var(--primary-color); line-height: 1.2 !important; } /* Ensure 1.2 line height */
.project-tags { margin-top: 15px; margin-bottom: 15px; }
.project-tags span {
    display: inline-block; background-color: var(--secondary-color); color: var(--primary-color);
    padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; margin-right: 5px; margin-bottom: 5px; line-height: 1.2 !important;
}
.project-link { display: inline-block; margin-top: auto; font-weight: bold; font-size: 0.9rem; line-height: 1.2 !important;}
.project-link:hover { text-decoration: underline; }
.project-info p { line-height: 1.2 !important; } /* Ensure 1.2 line height for project paragraphs */


/* --- Education Section --- */
.education-list .education-item {
    background-color: var(--card-background);
    padding: 10px 20px; /* Adjusted padding */
    border-radius: 6px;
    margin-bottom: 10px; /* Adjusted margin between items */
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    line-height: 1.2 !important; /* Ensure 1.2 line height for the item container */
}

.education-list .education-item h3 {
    margin-bottom: 0; /* Removed margin below heading */
    line-height: 1.2 !important; /* Ensure 1.2 line height */
}

.education-list .education-item p {
    margin-top: 0; /* Removed top margin */
    margin-bottom: 0; /* Removed bottom margin */
    line-height: 1.2 !important; /* Set 1.2 line height */
}

.institution-date {
    font-size: 0.9rem;
    color: #aaa; /* Set color to match original date color */
    margin-bottom: 0; /* Removed margin */
    line-height: 1.2 !important; /* Ensure 1.2 line height */
}

.education-item p em {
    color: #ccc;
    font-style: italic;
    line-height: 1.2 !important; /* Ensure 1.2 line height */
}

/* Style adjustments for the Certifications list */
.cert-grid {
    display: block; /* Stack certification lines vertically */
    margin-top: 20px;
    line-height: 1.2 !important; /* Ensure 1.2 line height for the grid container */
}

/* Style the p tags within cert-grid to look like education items */
.cert-grid p {
    background-color: var(--card-background); /* Match card background */
    padding: 10px 20px; /* Add padding, match education-item */
    border-radius: 6px; /* Match border radius */
    margin-bottom: 10px; /* Add space between certification lines, match education-item */
    box-shadow: 0 3px 10px rgba(0,0,0,0.15); /* Match shadow */
    line-height: 1.2 !important; /* Ensure 1.2 line height for the entire line */
    color: #aaa; /* Set color for the entity and "-" to match original date color */
    font-size: 1rem; /* Ensure consistent font size */
}

/* Style the certification name span to be blue */
.cert-grid p .cert-name {
    color: var(--primary-color); /* Set color to primary blue */
    font-weight: bold; /* Make the name bold to stand out */
    line-height: 1.2 !important; /* Ensure 1.2 line height */
}


/* --- Contact Section --- */
.social-links.contact-links-prominent {
    text-align: center; margin-top: 30px; display: flex;
    justify-content: center; gap: 20px; flex-wrap: wrap;
}
.contact-cta-button {
    display: inline-flex; align-items: center; background-color: var(--primary-color);
    color: #ffffff; padding: 12px 20px; border-radius: 5px; text-decoration: none;
    font-weight: bold; transition: background-color 0.3s ease, transform 0.2s ease;
    border: none; cursor: pointer; font-size: 1rem;
}
.contact-cta-button i { margin-right: 8px; font-size: 1.2rem; }
.contact-cta-button:hover { background-color: #007a7f; color: #ffffff; transform: translateY(-2px); }

/* --- Footer --- */
footer {
    text-align: center; padding: 30px 0; background-color: var(--secondary-color);
    border-top: 1px solid var(--border-color); font-size: 0.9rem;
}
footer .fa-heart { color: red; }
footer .fa-code { color: var(--primary-color); }

/* --- Animations on Scroll --- */
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }


/* --- Responsive Design --- */
@media (max-width: 992px) {
    .skills-list { columns: 1; }
    .about-content { flex-direction: column; }
    .about-image-and-leadership { width: 100%; max-width: 400px; margin: 30px auto 0; }
    .about-image img { max-width: 250px; }
    .hero-content h1 { font-size: 2.8rem; }
}

/* Adjust About Me flex layout on screens wider than 993px */
@media (min-width: 993px) {
    .about-text { flex: 1.5; } /* Adjust flex to give equal space */
    .about-image-and-leadership { flex: 1.5; } /* Adjust flex to give equal space */
}


/* Styles for screens up to 768px (Mobile Layout) */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .hero-content h1 { font-size: 2.5rem; }
    .hero-overview { font-size: 1.1rem; }
    h2 { font-size: 1.8rem; }

    nav ul {
        display: none; flex-direction: column; position: absolute; top: var(--header-height);
        left: 0; width: 100%; background-color: var(--secondary-color);
        padding: 10px 0; box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    }
    nav ul.nav-active { display: flex; }
    nav ul li { margin: 10px 0; text-align: center; }
    .nav-toggle { display: block; }
    .nav-toggle.active .hamburger { background-color: transparent; }
    .nav-toggle.active .hamburger::before { transform: rotate(45deg); top: 0; }
    .nav-toggle.active .hamburger::after { transform: rotate(-45deg); bottom: 0; }

    .timeline {
        max-width: 100%; /* Allow full width */
        margin: 0; /* Remove auto margins */
        padding: 0 15px; /* Add side padding */
        position: static; /* Remove relative positioning */
    }

    .timeline::after { /* Hide the central line */
        display: none;
    }

    .timeline-item {
        width: 100%; /* Full width */
        padding: 15px; /* Add consistent padding */
        margin-bottom: 20px; /* Add bottom margin for spacing */
        left: auto; /* Remove absolute positioning */
        right: auto; /* Remove absolute positioning */
        position: static; /* Change to static positioning */
        background-color: var(--card-background); /* Ensure background color */
        border-radius: 6px; /* Keep border radius */
        box-shadow: 0 3px 10px rgba(0,0,0,0.15); /* Keep shadow */
    }
    /* Remove specific left/right positioning for odd/even items on mobile */
    .timeline-item:nth-child(odd), .timeline-item:nth-child(even) {
        left: auto;
        right: auto;
    }


    .timeline-icon { /* Hide the icon on mobile */
        display: none;
    }
    /* Hide the arrows on mobile */
    .timeline-item .timeline-content::before,
    .timeline-item::after {
        display: none !important;
    }


    .timeline-content {
        padding: 0; /* Remove padding inside content box if item padding is used */
        /* Keep background, border-radius, box-shadow as they are moved to timeline-item */
        background-color: transparent; /* Make content background transparent if item has background */
        box-shadow: none; /* Remove shadow if applied to item */
    }

    /* Adjustments for text within timeline-content on mobile */
     .timeline-content h3 {
         font-size: 1.2rem; /* Slightly smaller heading on mobile */
         margin-bottom: 0.5em;
     }

     .company-date {
         font-size: 0.85rem; /* Slightly smaller date text */
         margin-bottom: 10px;
     }

     .experience-details-list li {
         font-size: 0.85rem; /* Adjust bullet point text size */
         padding: 5px 10px;
     }

     .tech-tags {
         font-size: 0.8rem; /* Adjust tech tag size */
         margin-top: 10px;
     }

    /* Mobile adjustments for Certifications list on very small screens */
     .cert-grid p { /* Apply mobile styles to p tags */
         font-size: 1rem; /* Adjust font size */
         padding: 8px 15px; /* Adjust padding */
         margin-bottom: 8px; /* Adjust bottom margin */
         line-height: 1.2 !important;
     }
    .cert-grid p .cert-name { /* Mobile style for cert name */
        font-size: 1rem; /* Ensure consistent font size */
        line-height: 1.2 !important;
     }


    .social-links.contact-links-prominent { flex-direction: column; gap: 15px; }
    .contact-cta-button { width: 100%; max-width: 300px; margin: 0 auto; justify-content: center; }
}

/* Styles for screens wider than 768px (Desktop Layout) */
@media (min-width: 769px) {

    /* Restore timeline relative positioning for desktop */
     .timeline {
        position: relative;
     }

     /* Restore central line for desktop */
    .timeline::after {
        content: '';
        position: absolute;
        width: 3px;
        background-color: var(--primary-color);
        top: 0;
        bottom: 0;
        left: 50%;
        margin-left: -1.5px;
        display: block; /* Ensure line is displayed on desktop */
    }

    .timeline-item {
        padding: 10px 20px; /* Keep padding consistent */
        position: relative; /* Restore relative positioning */
        background-color: inherit; /* Revert background to inherit */
        box-shadow: none; /* Remove box shadow if applied to item globally */
        border-radius: 0; /* Remove border radius if applied to item globally */
    }

    /* Adjusted width and positioning for wider items on desktop */
    .timeline-item {
        width: 75%; /* Keep wider width */
    }

    .timeline-item:nth-child(odd) {
        left: -25%; /* Keep positioning */
        right: auto;
    }

    .timeline-item:nth-child(even) {
        left: 50%; /* Keep positioning */
        right: auto;
    }


    /* Icon Positioning (These are relative to the .timeline-item edge) */
    /* These values should still effectively center the icon on the main timeline line */
    .timeline-icon {
        position: absolute; /* Restore absolute positioning */
        width: 50px; /* Restore size */
        height: 50px; /* Restore size */
        background-color: var(--background-color); /* Restore background */
        border: 3px solid var(--primary-color); /* Restore border */
        top: 15px; /* Restore top positioning */
        border-radius: 50%; /* Restore rounded shape */
        z-index: 1; /* Restore z-index */
        display: flex; /* Restore display */
        justify-content: center; /* Restore centering */
        align-items: center; /* Restore centering */
        font-size: 1.5rem; /* Restore font size */
        right: -25px; /* For odd items (left side), position 25px from their right edge */
         left: auto; /* Ensure left is auto on odd */
    }

    .timeline-item:nth-child(even) .timeline-icon {
        left: -25px; /* For even items (right side), position 25px from their left edge */
        right: auto; /* Ensure right is auto on even */
    }

    /* Hide the original ::before arrows on desktop */
    .timeline-item .timeline-content::before {
        display: none;
    }


    /* Add new arrow styles using ::after on .timeline-item for desktop */
     .timeline-item::after {
        content: '';
        position: absolute;
        top: 30px; /* Adjust vertically to align with content */
        width: 0;
        height: 0;
        border: medium solid transparent;
        z-index: 1; /* Ensure arrow is above other content */
        display: block; /* Ensure the arrow is displayed on desktop */
    }

    .timeline-item:nth-child(odd)::after {
        right: 0;
        border-width: 10px 0 10px 10px;
        border-color: transparent transparent transparent var(--border-color); /* MODIFIED: Updated arrow color */
        left: auto; /* Ensure left is auto on odd */
    }

    .timeline-item:nth-child(even)::after {
        left: 0;
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--border-color) transparent transparent; /* MODIFIED: Updated arrow color */
        right: auto; /* Ensure right is auto on even */
    }

     /* Restore content box styling for desktop */
     .timeline-content {
        padding: 20px;
        background-color: var(--border-color); /* MODIFIED: Changed background color */
        position: relative;
        border-radius: 6px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.2); /* Reverted box-shadow */
     }

} /* End @media (min-width: 769px) */


@media (max-width: 480px) {
    .hero-content h1 { font-size: 2.2rem; }
    .hero-overview { font-size: 1rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .skills-list { columns: 1; }
    .technical-skills-container { justify-content: center; }
    .tech-skill-tag { font-size: 0.8rem; padding: 5px 10px;}

    /* Mobile adjustments for Certifications list on very small screens */
     .cert-grid p { /* Apply mobile styles to p tags */
         font-size: 1rem; /* Adjust font size */
         padding: 8px 15px; /* Adjust padding */
         margin-bottom: 8px; /* Adjust bottom margin */
         line-height: 1.2 !important;
     }
    .cert-grid p .cert-name { /* Mobile style for cert name */
        font-size: 1rem; /* Ensure consistent font size */
        line-height: 1.2 !important;
     }


    .social-links.contact-links-prominent { flex-direction: column; gap: 15px; }
    .contact-cta-button { width: 100%; max-width: 300px; margin: 0 auto; justify-content: center; }
}