/* FILE LOCATION: portfolio_website/css/style.css */

/* General Body & Typography */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8; /* Default background for sections other than hero */
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

h1 { font-size: 2.8em; }
h2 { font-size: 2.2em; text-align: center; margin-bottom: 40px; }
h3 { font-size: 1.8em; }

p { margin-bottom: 15px; }

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: #0056b3;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}
.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    margin-left: 15px;
}
.btn-secondary:hover {
    background-color: #5a6268;
}

/* Navbar */
.navbar {
    background-color: #2c3e50;
    color: #fff;
    padding: 15px 0; /* Ensures consistent vertical padding */
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, padding 0.3s ease; /* Smooth transition for scrolled state */
}

/* Navbar Scrolled State (applied by JS) */
.navbar.scrolled {
    background-color: rgba(44, 62, 80, 0.95); /* Slightly transparent when scrolled */
    padding: 10px 0; /* Shrink padding when scrolled */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navbar Logo Container (now always contains text, optionally image) */
.navbar .logo {
    font-size: 1.8em; /* Base font size for the text part */
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    display: flex; /* Aligns content inside horizontally */
    align-items: center; /* Vertically centers items inside the logo link */
    gap: 12px; /* Space between logo image and text */
    transition: font-size 0.3s ease; /* Smooth transition for font size change */
}

/* Specific styling for the actual Logo Image */
.navbar .logo .site-logo-img {
    max-height: 45px; /* Taller logo image */
    max-width: 280px; /* Wider logo image */
    height: auto;
    width: auto;
    display: block;
    margin: 0;
    vertical-align: middle;
    transition: max-height 0.3s ease, max-width 0.3s ease; /* Smooth transition for image size change */
}

/* Adjust logo size when navbar is scrolled */
.navbar.scrolled .logo {
    font-size: 1.5em; /* Smaller text when scrolled */
}
.navbar.scrolled .logo .site-logo-img {
    max-height: 35px; /* Smaller image when scrolled */
    max-width: 220px;
}

/* Styling for the Brand Name text */
.navbar .logo .site-logo-text {
    color: #fff;
    white-space: nowrap; /* Prevents text from wrapping */
}

/* Navigation Links */
.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-links li {
    margin-left: 25px; /* Adjusted spacing */
}

.nav-links a {
    color: #fff;
    font-weight: 500;
    padding: 5px 0; /* Add padding for clickable area */
    transition: color 0.3s ease, transform 0.2s ease;
}
.nav-links a:hover {
    color: #a7d9ff;
    transform: translateY(-2px); /* Subtle hover effect */
}

/* Mobile Navigation Toggle (Hamburger Icon) */
.nav-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001; /* Above mobile menu */
}

.nav-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #fff;
    transition: all 0.3s ease-in-out;
}

/* Hamburger icon animation when active */
.nav-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* Hero Section */
.hero-section {
    background-color: transparent; /* Transparent background for hero content */
    color: #fff;
    padding: 150px 0 100px;
    text-align: center;
    display: flex;
    flex-direction: column; /* Stack content vertically */
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
    position: relative; /* Parent for absolute positioning of background/profile pic */
    z-index: 10; /* Ensure hero content is above floating images */
    overflow: hidden; /* Hide any overflow from floating images or profile pic */
}

/* Floating Background Images Wrapper - ABSOLUTE WITHIN HERO SECTION */
.floating-background-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;   /* Puts it behind all other hero content */
    pointer-events: none; /* Allows clicks/interactions to pass through */
    background-color: #34495e; /* Hero background color */
}

/* Individual Floating Background Image */
.floating-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Stretch to cover its container, potentially cropping */
    opacity: 0; /* Initially hidden */
    transition: opacity 1s ease-in-out; /* Smooth fade in/out */
    will-change: transform, opacity; /* Performance optimization */
}

/* Class for the currently active image */
.floating-background-image.active {
    opacity: 0.1; /* Adjust the overall transparency of the floating images when active */
    /* Animation applied by JavaScript */
}

/* Keyframe for sliding across and fading */
@keyframes slideAcrossAndFade {
    0% { transform: translateX(100%); opacity: 0; }
    10% { transform: translateX(0%); opacity: 1; }
    90% { transform: translateX(0%); opacity: 1; }
    100% { transform: translateX(-100%); opacity: 0; }
}


/* Profile Image Styling (hero-profile-pic) */
.hero-profile-pic {
    position: absolute;
    top: 50px;
    right: 50px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #007bff;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5), 0 0 30px rgba(0, 123, 255, 0.2);
    z-index: 100;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: floatPulse 5s ease-in-out infinite alternate;
}

/* Animation for the Profile Image */
@keyframes floatPulse {
    0% { transform: scale(1) translateY(0px); }
    50% { transform: scale(1.02) translateY(-5px); }
    100% { transform: scale(1) translateY(0px); }
}

/* Hero Content alignment within the flex container */
.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 20;
}


/* Common Section Styles */
.common-section {
    padding: 80px 0;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}
.common-section:nth-of-type(even) {
    background-color: #fdfdfd;
}

.section-description {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
    font-size: 1.1em;
    color: #555;
}

/* About Me Section */
.about-section .about-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 50px;
}

.skills-section {
    background-color: #f4f4f4;
    padding: 40px;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.skills-section h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #34495e;
}

.skill-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.skill-category {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.skill-category h4 {
    text-align: center;
    color: #007bff;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.skill-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-category ul li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 10px; /* Space between icon and text */
}
.skill-category ul li:last-child {
    border-bottom: none;
}

/* Project Grid Styles */
.project-filter {
    text-align: center;
    margin-bottom: 40px;
}

.filter-btn {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
    padding: 10px 20px;
    margin: 0 8px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.filter-btn:hover {
    background-color: #dee2e6;
    border-color: #adb5bd;
}

.filter-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}
.filter-btn.active:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: #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;
    justify-content: space-between; /* Pushes button to bottom */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-card img {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover; /* Crop images to fit */
    border-bottom: 1px solid #eee;
}

.project-card .card-content {
    padding: 20px;
    flex-grow: 1; /* Allow content to grow */
}

.project-card h3 {
    margin-top: 0;
    font-size: 1.4em;
    color: #34495e;
}

.project-card p {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 15px;
}

.project-card .project-link {
    display: block;
    width: calc(100% - 40px); /* Adjust for padding */
    margin: 0 20px 20px; /* Bottom padding for the card */
    padding: 10px 15px;
    background-color: #007bff;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.project-card .project-link:hover {
    background-color: #0056b3;
}

.loading-message {
    grid-column: 1 / -1; /* Span across all columns */
    text-align: center;
    color: #777;
    font-style: italic;
    padding: 50px 0;
}


/* Contact Section */
.contact-section .container {
    max-width: 800px;
}

#contact-form {
    background-color: #f4f4f4;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 50px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group select,
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-group input[type="number"]:focus,
.form-group input[type="url"]:focus,
.form-group input[type="file"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-group textarea {
    resize: vertical;
}

#contact-form button {
    width: auto;
    padding: 12px 30px;
    font-size: 1.1em;
}

.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    display: none; /* Hidden by default */
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.contact-info {
    text-align: center;
    margin-top: 50px;
}

.contact-info h3 {
    margin-bottom: 20px;
    color: #34495e;
}

.contact-info p {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.social-links {
    margin-top: 25px;
}

.social-links a {
    display: inline-block;
    margin: 0 15px;
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-5px);
}

.social-links img {
    width: 45px;
    height: 45px;
    filter: grayscale(80%); /* Optional: Make icons less colorful */
    transition: filter 0.3s ease;
}

.social-links img:hover {
    filter: grayscale(0%); /* Full color on hover */
}


/* Footer */
footer {
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 30px 0;
    font-size: 0.9em;
}


/* Resume Page Styles (for the dynamic HTML resume) */
.resume-page-container {
    padding: 40px 20px;
    background-color: #f0f2f5; /* A slightly different background for the resume page */
}

.cv-wrapper {
    background-color: #ffffff;
    max-width: 900px; /* Max width of the CV content */
    margin: 20px auto;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden; /* Contains floats if any */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #444;
}

.cv-header {
    background-color: #007bff; /* Blue header background */
    color: #fff;
    padding: 20px 40px;
    text-align: center;
    position: relative; /* For the profile image positioning */
    overflow: hidden; /* To contain potential header decorations */
}

.cv-header .cv-title {
    font-size: 1.2em;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cv-header h1 {
    font-size: 2.5em;
    margin-top: 0;
    margin-bottom: 0;
    color: #fff; /* Ensure name is white */
}

/* Profile Photo Container in Header */
.profile-photo-container {
    position: absolute;
    top: 20px; /* Adjusted to be within the blue header */
    left: 40px;
    width: 120px; /* Size of the circular image */
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid #fff; /* White border around the image */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1; /* Ensure it's above other header content */
}

.profile-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image fills the circle */
}


/* Main Content - Columns */
.cv-main-content {
    display: flex;
    flex-wrap: wrap; /* Allows columns to wrap on smaller screens */
    padding: 40px 0; /* Vertical padding for the whole content area */
    position: relative; /* For the vertical separator */
}

/* Vertical Separator Line */
.cv-main-content::before {
    content: '';
    position: absolute;
    left: 30%; /* Position the line between columns (adjust if column widths change) */
    top: 0;
    bottom: 0;
    width: 1px; /* Thickness of the line */
    background-color: #eee; /* Color of the line */
}

.cv-left-column,
.cv-right-column {
    padding: 0 20px; /* Horizontal padding within columns */
    box-sizing: border-box; /* Include padding in width calculations */
}

.cv-left-column {
    flex-basis: 30%; /* Narrower left column */
    max-width: 30%;
    text-align: left;
    padding-left: 40px; /* More padding on the left side */
}

.cv-right-column {
    flex-basis: 70%; /* Wider right column */
    max-width: 70%;
    text-align: left;
    padding-right: 40px; /* More padding on the right side */
}

/* Section Headings */
.section h2 {
    font-size: 1.5em;
    color: #007bff; /* Blue color for section headings */
    text-transform: uppercase;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 2px solid #007bff; /* Blue underline */
    padding-bottom: 5px;
    text-align: left;
}

/* Common List Styles */
.section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section ul li {
    margin-bottom: 10px;
}

/* Profile Section Specifics */
.profile-section ul li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px; /* Space between label and value */
}
.profile-section ul li:first-child {
    margin-top: 20px; /* Space from photo to first profile item */
}
.profile-section ul li strong {
    white-space: nowrap; /* Prevent labels from wrapping */
}
.profile-section ul li span {
    flex-grow: 1; /* Allows the value to take up remaining space */
    text-align: right; /* Aligns value to the right */
    position: relative;
    padding-left: 10px; /* Space for dashed line */
}
.profile-section ul li span::before {
    content: '-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'; /* Long string of dashes */
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
    color: #ccc; /* Color of dashes */
    z-index: -1; /* Behind the text */
    font-size: 0.8em; /* Make dashes smaller */
    transform: translateY(-50%);
}


/* Contact and Hobbies Icons */
.contact-section ul li,
.hobbies-section ul li {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between icon and text */
}

.contact-section ul li i {
    color: #007bff; /* Blue color for icons */
    font-size: 1.2em;
    width: 20px; /* Fixed width for icon alignment */
    text-align: center;
}

/* Experience Section specifics */
.experience-section .job-entry {
    margin-bottom: 25px;
}

.experience-section h3 {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 5px;
    color: #333;
}

.experience-section .job-dates {
    font-style: italic;
    color: #666;
    margin-bottom: 10px;
}

.experience-section .responsibilities li {
    list-style-type: disc; /* Default bullet point */
    margin-left: 20px;
    margin-bottom: 5px;
}

/* Education Section specifics */
.education-section .edu-entry {
    margin-bottom: 20px;
}
.education-section h3 {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 5px;
    color: #333;
}
.education-section .details {
    margin-left: 20px;
    color: #555;
    font-size: 0.95em;
}

/* References Section specifics */
.references-section .reference-entry {
    margin-bottom: 15px;
}
.references-section .ref-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.references-section .ref-detail {
    margin-left: 10px;
    color: #555;
    font-size: 0.9em;
}
.references-section .ref-name i {
    color: #007bff;
    font-size: 1em;
}


/* Responsive Design */
@media (max-width: 992px) { /* Tablets and smaller laptops */
    .navbar {
        padding: 10px 0; /* Shrink padding on smaller screens by default */
    }
    .navbar.scrolled { /* Keep it same size if already scrolled */
        padding: 10px 0;
    }
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar .logo {
        margin-bottom: 15px; /* Space below logo when stacked */
        font-size: 1.5em; /* Smaller text for mobile */
        gap: 8px; /* Slightly less gap */
    }
    .navbar .logo .site-logo-img {
        max-height: 35px; /* Smaller logo height */
        max-width: 180px; /* Smaller logo width */
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        /* Mobile menu hidden by default, shown by JS */
        display: none;
        background-color: #34495e;
        position: absolute; /* Position relative to body/viewport */
        top: 60px; /* Below navbar, adjust if navbar height changes */
        left: 0;
        padding: 15px 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
        z-index: 999; /* Below navbar, above content */
    }
    .nav-links.active {
        display: flex; /* Show mobile menu */
    }
    .nav-links li {
        margin: 0;
        text-align: center;
        width: 100%;
    }
    .nav-links a {
        display: block;
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .nav-links li:last-child a {
        border-bottom: none;
    }

    .nav-toggle {
        display: block; /* Show hamburger on mobile */
    }

    .hero-section {
        padding: 120px 0 80px; /* Less top padding for fixed navbar, adjust as needed */
        min-height: 80vh; /* Make it 80% viewport height on smaller screens */
        flex-direction: column; /* Ensure content stacks properly with static profile pic */
        justify-content: flex-start; /* Align from top */
        align-items: center; /* Center horizontally */
    }

    .hero-profile-pic {
        position: static; /* Remove absolute positioning on very small screens */
        margin: 20px auto; /* Center it horizontally if static */
        order: -1; /* Place it before hero-content if using flex on hero */
        width: 150px; /* Or adjust size as needed */
        height: 150px;
        animation: none; /* Remove animation for performance on mobile */
        transform: none !important; /* Ensure no transforms from animation */
        box-shadow: none; /* Remove demanding shadow */
        border: 3px solid #007bff; /* Keep a simple border */
    }
    .hero-content {
        max-width: 100%; /* Reset max-width if profile pic isn't taking space */
        margin-right: auto; /* Reset margin */
        order: 0; /* Normal order */
    }
    .floating-background-image-wrapper {
        opacity: 0.05; /* More subtle background images on mobile */
    }
    /* Keyframes for mobile specific animation if needed, or remove them from JS */
    @keyframes slideAcrossAndFade {
        0% { transform: translateX(100%); opacity: 0; }
        15% { transform: translateX(0%); opacity: 0.8; }
        85% { transform: translateX(0%); opacity: 0.8; }
        100% { transform: translateX(-100%); opacity: 0; }
    }


    /* Resume Page Styles for Mobile */
    .resume-page-container {
        padding: 20px;
    }
    .cv-wrapper {
        margin: 10px;
        border-radius: 0; /* Remove border-radius on small screens */
        box-shadow: none; /* Remove shadow on small screens */
    }

    .cv-header {
        padding: 20px;
        height: auto; /* Allow height to adjust */
    }
    .cv-header .cv-title {
        font-size: 1em;
    }
    .cv-header h1 {
        font-size: 2em;
    }

    /* Profile photo static on small screens */
    .profile-photo-container {
        position: static;
        width: 100px;
        height: 100px;
        margin: 0 auto 20px; /* Center it below the name */
        order: -1; /* Place it first in flex container */
    }
    .cv-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Columns stack vertically */
    .cv-main-content {
        flex-direction: column;
        padding: 20px 0;
    }
    .cv-left-column,
    .cv-right-column {
        flex-basis: 100%;
        max-width: 100%;
        padding: 0 20px; /* Uniform padding */
        border-left: none; /* Remove vertical line */
    }

    .cv-main-content::before {
        display: none; /* Hide separator line on mobile */
    }

    /* Adjust padding for sections in mobile */
    .cv-left-column .section,
    .cv-right-column .section {
        padding-bottom: 20px;
        border-bottom: 1px solid #eee; /* Add horizontal separator between sections */
        margin-bottom: 20px;
    }
    .cv-left-column .section:last-of-type,
    .cv-right-column .section:last-of-type {
        border-bottom: none;
        margin-bottom: 0;
    }

    .profile-section ul li span::before {
        display: none; /* Hide dashed lines on small screens */
    }
    .profile-section ul li strong, .profile-section ul li span {
        text-align: left; /* Align all text left */
        flex-basis: 100%; /* Take full width */
    }
    .profile-section ul li {
        flex-direction: column; /* Stack label and value */
        align-items: flex-start;
        gap: 0;
        margin-bottom: 5px;
    }
    .profile-section ul li strong {
        margin-bottom: 2px;
    }

    .contact-section ul li,
    .hobbies-section ul li {
        align-items: flex-start; /* Align icons to the top of text if it wraps */
    }
}

@media (max-width: 600px) { /* Smaller phones */
    h1 { font-size: 2.2em; }
    h2 { font-size: 1.8em; }
    .hero-section p { font-size: 1em; }
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    .btn {
        width: 80%;
        margin: 10px 0 !important;
    }
    .contact-info {
        padding: 0 10px;
    }
    .social-links a {
        margin: 0 8px;
    }
}


/* --- Print Styles --- */
/* This media query ensures specific styles apply ONLY when the page is printed */
@media print {
    /* CRITICAL: Ensure colors and backgrounds print exactly as they appear on screen */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        background-color: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    /* Reset margins/padding on body and html to allow full print area usage */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Hide everything NOT part of the resume */
    body > *:not(.common-section.resume-page-container) {
        display: none !important;
    }

    /* Make the resume container take the full print page */
    .resume-page-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        min-height: auto !important;
        background-color: #fff !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .cv-wrapper {
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 auto !important;
        /* Use a max-width close to standard paper width for consistent sizing */
        max-width: 200mm !important; /* Approx. 7.87 inches, for A4 paper with margins */
        height: 297mm !important; /* A4 paper height, approx. 11.69 inches */
        width: 100% !important; /* Ensure it respects the max-width */
        overflow: hidden !important; /* Crucial to prevent content overflow beyond one page */
        position: relative; /* For absolute positioning of inner elements */
        padding: 10mm 0 !important; /* Add some overall padding to the printed content */
    }

    /* General font size adjustment for print readability on smaller paper */
    .cv-wrapper {
        font-size: 8.5pt !important; /* Adjust as needed for density */
        line-height: 1.15 !important; /* Tighter line height */
    }

    /* Adjust header and profile image for print */
    .cv-header {
        padding: 5mm 15mm !important; /* Smaller header padding for print */
        height: auto !important;
        display: block !important;
        text-align: left !important;
        background-color: #007bff !important; /* Keep blue header */
        color: #fff !important; /* Keep white text */
    }
    .cv-header .cv-title {
        text-align: left !important;
        font-size: 0.9em !important; /* Smaller print size */
        margin-bottom: 1mm !important;
        letter-spacing: 1px !important;
    }
    .cv-header h1 {
        text-align: left !important;
        font-size: 2em !important; /* Adjust print size */
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        color: #fff !important;
    }
    .profile-photo-container {
        position: absolute !important;
        top: 5mm !important; /* Position from top of printed header */
        right: 15mm !important; /* Position from right edge of printed header */
        width: 60px !important; /* Smaller size for print */
        height: 60px !important;
        border: 2px solid #fff !important; /* Simpler white border */
        box-shadow: none !important; /* Remove shadow */
        z-index: 1 !important;
        float: none !important; /* Ensure no floating issues */
        margin: 0 !important;
    }
    /* Adjust main content positioning to account for header image */
    .cv-header .cv-title,
    .cv-header h1 {
        /* Add right padding/margin to make space for the absolutely positioned profile photo */
        padding-right: 80mm !important; /* Adjust based on photo width + spacing */
        margin-right: 80mm !important; /* For text flow */
    }


    /* Column layout for print */
    .cv-main-content {
        display: flex; /* Keep flexbox */
        flex-direction: row; /* Ensure row layout */
        flex-wrap: nowrap; /* Prevent wrapping */
        page-break-inside: avoid; /* Try to keep the entire content area together if possible */
        padding: 5mm 0 !important; /* Reduced vertical padding for content area */
    }
    .cv-main-content::before {
        display: block !important; /* Re-enable vertical line */
        left: 30% !important; /* Position correctly */
        background-color: #eee !important; /* Keep light gray line */
    }

    .cv-left-column,
    .cv-right-column {
        padding: 0 4mm !important; /* Consistent padding within columns */
        box-sizing: border-box !important;
        flex-basis: auto; /* Allow sizing based on content */
        width: auto;
        max-width: none;
        float: none !important; /* Remove any unexpected floats */
    }
    /* Set column widths precisely for print */
    .cv-left-column {
        flex-basis: 30% !important;
        width: 30% !important;
    }
    .cv-right-column {
        flex-basis: 70% !important;
        width: 70% !important;
    }


    /* Section Headings for print */
    .section h2 {
        font-size: 1.1em !important; /* Smaller headings */
        margin-top: 5mm !important; /* Reduced spacing */
        margin-bottom: 3mm !important;
        border-color: #007bff !important; /* Keep blue underline */
        color: #007bff !important; /* Keep blue color */
        padding-bottom: 1mm !important;
    }

    /* General text and list items for print */
    p, li {
        font-size: 0.9em !important; /* Base font size for body text (relative to 8.5pt on wrapper) */
        margin-bottom: 0.3em !important; /* Very tight line spacing */
    }
    .section ul li {
        margin-bottom: 1.5mm !important; /* Smaller vertical spacing between list items */
    }

    /* Profile Section Specifics for print */
    .profile-section ul li {
        margin-bottom: 1mm !important;
    }
    .profile-section ul li:first-child {
        margin-top: 2mm !important;
    }
    .profile-section ul li strong {
        margin-bottom: 0 !important;
    }
    .profile-section ul li span::before {
        display: block !important; /* Show dashed lines */
        color: #ccc !important; /* Dashed lines color */
    }

    /* Contact and Hobbies Icons for print */
    .contact-section ul li,
    .hobbies-section ul li {
        gap: 5px !important;
        margin-bottom: 1mm !important;
    }
    .contact-section ul li i,
    .hobbies-section ul li i,
    .references-section .ref-name i {
        color: #007bff !important; /* Keep blue icons */
        font-size: 1em !important;
        width: 15px !important; /* Adjust fixed width */
    }

    /* Experience, Education, References details for print */
    .experience-section .job-entry,
    .education-section .edu-entry,
    .references-section .reference-entry {
        margin-bottom: 4mm !important; /* Smaller spacing between entries */
    }
    .experience-section h3, .education-section h3 {
        font-size: 1em !important;
        margin-bottom: 2mm !important;
    }
    .experience-section .job-dates {
        margin-bottom: 2mm !important;
    }
    .experience-section .responsibilities li, .education-section .details, .references-section .ref-detail {
        margin-left: 5mm !important; /* Indentation */
    }
    .experience-section .responsibilities li {
        margin-bottom: 1mm !important;
    }
    .references-section .ref-name {
        margin-bottom: 1mm !important;
    }

    /* Page break control for single page */
    .section, .job-entry, .edu-entry, .reference-entry,
    .cv-left-column, .cv-right-column, .cv-main-content, .cv-wrapper {
        page-break-inside: avoid !important; /* Crucial to prevent breaks within these elements */
        page-break-after: auto !important; /* Allow breaks after if absolutely necessary (but hopefully not) */
        page-break-before: auto !important;
    }
}