/* General Styles */
:root {
    --primary-color: #007bff; /* Vibrant Blue */
    --secondary-color: #6c757d; /* Muted Grey */
    --background-color: #f0f2f5; /* Softer Light Grey */
    --surface-color: #ffffff; /* White for cards/surfaces */
    --text-color: #212529; /* Dark Grey for text */
    --heading-color: #0056b3; /* Darker Blue for headings */
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-family-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.7; /* Increased for readability */
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 17px; /* Slightly larger base font */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    background: var(--surface-color);
    color: var(--text-color);
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 5px var(--shadow-color);
    position: sticky; /* Sticky header */
    top: 0;
    z-index: 1000;
}

header nav ul {
    padding: 0;
    list-style: none;
    margin: 0;
}

header nav ul li {
    display: inline;
    margin: 0 18px; /* Slightly more spacing */
}

header nav ul li a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05em;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    display: inline-block; /* For transform */
}

header nav ul li a:hover,
header nav ul li a.active {
    color: var(--primary-color);
    transform: translateY(-2px); /* Subtle lift on hover */
}

main {
    padding: 40px 20px; /* More padding */
    max-width: 1100px; /* Wider content area */
    margin: 40px auto;
    background: transparent; /* Main background will be body's */
}

section {
    position: relative; /* Ensure section establishes a clear positioning context */
    margin-bottom: 40px;
    padding: 30px;
    background: var(--surface-color);
    border-radius: 12px; /* More rounded corners */
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px); /* Lift section on hover */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Enhanced shadow on hover */
}


section:last-child {
    border-bottom: none;
}

h1, h2, h3, h4 {
    color: var(--heading-color);
    font-weight: 600;
    margin-top: 0; /* Remove default top margin */
}

h1 { /* For Hero Section primarily */
    text-align: center;
    margin-bottom: 0.5em;
    font-size: 3em;
    color: var(--primary-color);
}

h2 { /* Section titles */
    padding-bottom: 0.5em;
    margin-bottom: 1em;
    font-size: 2.4em;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block; /* So border only spans text width */
}

h3 { /* Sub-section or item titles */
    font-size: 1.9em;
    color: var(--text-color);
    margin-bottom: 0.7em;
}

h4 { /* Further details */
    font-size: 1.3em;
    color: var(--secondary-color);
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1.3em;
    text-align: left; /* Default to left, justify can be hard to read */
}

ul {
    margin-bottom: 1.3em;
    padding-left: 20px; /* Standard padding */
}

ul li {
    margin-bottom: 0.6em;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 30px auto;
    border-radius: 8px;
    box-shadow: 0 6px 12px var(--shadow-color);
}

footer {
    text-align: center;
    padding: 30px 20px;
    background: #343a40; /* Keeping dark footer for contrast */
    color: #f8f9fa;
    margin-top: 40px;
    font-size: 0.95em;
}

footer p {
    margin-bottom: 0.5em;
    text-align: center;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #0056b3; /* Darker blue on hover */
    text-decoration: underline;
}

/* Hero Section on Index Page */
#hero {
    text-align: center;
    padding: 80px 30px; /* More padding */
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%); /* Gradient background */
    color: var(--surface-color);
    border-radius: 12px;
    margin-bottom: 40px;
}

#hero h1 {
    font-size: 3.5em;
    margin-bottom: 0.3em;
    color: var(--surface-color); /* White text on gradient */
    font-weight: 700; /* Bolder for hero */
}

#hero p {
    font-size: 1.5em;
    color: rgba(255, 255, 255, 0.85); /* Slightly transparent white */
    margin-bottom: 0;
    text-align: center;
    font-weight: 300; /* Lighter weight for subtitle */
}

/* Projects Page Specifics */
#projects h2 { /* "My Projects" title */
    text-align: center;
    display: block; /* Allow centering */
    margin-bottom: 1.5em; /* More space below title */
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Responsive grid */
    gap: 30px; /* Space between project items */
}

.project-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* Use flexbox for internal alignment */
    flex-direction: column; /* Stack content vertically */
    height: 100%; /* Make cards in a row equal height if needed by content */
}

.project-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* Adjusted shadow: less blur, slightly more defined */
    z-index: 10; /* Ensure hovered item is visually on top */
}

.project-item h3 { /* Project Title */
    font-size: 1.7em; /* Slightly larger */
    color: var(--primary-color);
    margin-bottom: 0.6em;
}

.project-item h4 { /* "Key Features", "Summary" */
    font-size: 1.15em;
    color: var(--heading-color);
    margin-top: 1em;
    margin-bottom: 0.4em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

.project-item p.project-description,
.project-item p.project-summary,
.project-item p.project-tech-stack {
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 1em;
    flex-grow: 1; /* Allow text to take available space, pushing buttons down */
}

.project-item ul {
    font-size: 0.9em;
    margin-bottom: 1.2em;
    padding-left: 18px; /* Slightly less indent */
    flex-grow: 1; /* Allow lists to take available space */
}

.project-item ul li {
    margin-bottom: 0.4em;
}

.btn-project-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--surface-color) !important; /* Ensure text is white */
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    margin-top: auto; /* Push button to the bottom of the card */
}

.btn-project-link:hover {
    background-color: var(--heading-color);
    transform: translateY(-2px);
    color: var(--surface-color) !important;
}

/* If multiple buttons, add some space */
.project-item a.btn-project-link + a.btn-project-link {
    margin-top: 10px;
}


/* CV Page Specifics */
#cv .cv-section {
    margin-bottom: 15px; /* Further reduced */
    padding: 15px; /* Further reduced */
}

#cv h2 { /* "Curriculum Vitae" title */
    margin-bottom: 1em; /* Standardized */
    text-align: center;
    display: block;
}

#cv article h3 { /* Bio, Experience, Education etc. */
    margin-top: 0.8em; /* Further reduced */
    margin-bottom: 0.6em; /* Further reduced */
    font-size: 1.4em; /* Further reduced */
}

#cv .job-entry, 
#cv .education-entry {
    margin-bottom: 0.8em; /* Further reduced */
}

#cv article h4 { /* Job titles, Degree names, Certifications, MOOCs */
    margin-top: 0.4em; /* Further reduced */
    margin-bottom: 0.2em; /* Further reduced */
    font-size: 1.05em; /* Further reduced */
}

#cv .job-details, 
#cv .education-details {
    font-size: 0.9em; /* Further reduced */
    margin-bottom: 0.4em; /* Further reduced */
    line-height: 1.3; /* Tighter line height */
}

#cv p {
    margin-bottom: 0.6em; /* Further reduced */
    font-size: 0.9em; /* Further reduced */
    line-height: 1.4; /* Tighter line height for paragraphs */
}

#cv ul {
    margin-top: 0.2em; /* Reduce space above lists */
    margin-bottom: 0.6em; /* Further reduced */
    padding-left: 16px; /* Further reduced indent */
    line-height: 1.3; /* Tighter line height for list items */
}

#cv ul li {
    margin-bottom: 0.2em; /* Further reduced */
    font-size: 0.88em; /* Further reduced */
}

/* Specific styling for multi-column lists */
#cv .education-entry ul#mooc-list,
#cv .cv-section#skills div#skills-list {
    column-count: 2;
    column-gap: 20px;
    margin-top: 0.5em;
}

#cv .education-entry ul#mooc-list li,
#cv .cv-section#skills div#skills-list p {
    font-size: 0.85em; /* Even smaller for multi-column items */
    margin-bottom: 0.3em; /* Tighter for multi-column */
    -webkit-column-break-inside: avoid; /* Avoid breaking list items across columns */
    page-break-inside: avoid;
    break-inside: avoid;
}

#cv .cv-section#skills h3 {
    margin-bottom: 0.5em; /* Space before skills list */
}

#cv .cv-section#skills div#skills-list p strong {
    font-weight: 500; /* Ensure skill categories are readable */
}


#cv .cv-section#awards ul li {
    font-size: 0.9em; /* Keep awards readable */
}

/* CV Download Button Container */
.cv-download-container {
    text-align: center; /* Center the button */
    margin-bottom: 25px; /* Space below the button */
}

/* CV Download Button Styling */
.btn-cv-download {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--surface-color);
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1.1em;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-cv-download:hover {
    background-color: var(--heading-color); /* Darker shade on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}


/* Responsive Design */
@media (max-width: 992px) { /* Tablet */
    main {
        padding: 30px 15px;
        margin: 30px auto;
    }
    h1 { font-size: 2.5em; }
    h2 { font-size: 2em; }
    h3 { font-size: 1.6em; }
    #hero h1 { font-size: 3em; }
    #hero p { font-size: 1.3em; }
}

@media (max-width: 768px) { /* Large Mobile / Small Tablet */
    body { font-size: 16px; }
    header nav ul li {
        display: block;
        margin: 12px 0;
        text-align: center;
    }
    header { position: static; } /* Remove sticky header on mobile for better UX */

    section {
        padding: 20px;
    }
    section:hover { /* Disable hover lift on touch devices if it feels odd */
        transform: none;
        box-shadow: 0 5px 15px var(--shadow-color);
    }

    .projects-grid {
        grid-template-columns: 1fr; /* Stack projects on mobile */
    }
    #hero { padding: 60px 20px; }
    #hero h1 { font-size: 2.5em; }
    #hero p { font-size: 1.2em; }
}

@media (max-width: 480px) { /* Small Mobile */
    h1 { font-size: 2.2em; }
    h2 { font-size: 1.8em; }
    h3 { font-size: 1.4em; }
    #hero h1 { font-size: 2.2em; }
    #hero p { font-size: 1.1em; }
}
