body {
    font-family: 'Roboto', sans-serif;
    margin: 0 auto; /* Center the body content */
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
    max-width: 960px; /* Limit content width on larger screens */
    line-height: 1.6; /* Increased default line height for better readability */
}

header {
    text-align: center;
    margin-bottom: 30px; /* Increased margin for better separation */
}

h1 {
    font-size: 2.5em;
    margin: 0;
}

h2 {
    font-size: 1.6em; /* Slightly increased for more prominence */
    margin: 15px 0 10px; /* Adjusted margin for H2 */
    padding-bottom: 5px; /* Small padding to lift content slightly */
    border-bottom: 1px solid #eee; /* Subtle separator for clear section start */
}

h3 {
    font-size: 1.3em; /* Slightly increased for better hierarchy */
    margin: 15px 0 5px; /* Adjusted margin for H3 */
}

section {
    background: white;
    padding: 20px 25px; /* Increased padding (top/bottom and left/right) for more breathing room */
    margin-bottom: 25px; /* Increased bottom margin between sections for better separation */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Improved list readability */
ul {
    list-style-type: disc; /* standard bullet points */
    padding-left: 25px; /* Increased indentation for clarity */
    margin-top: 10px; /* Adjusted margin top for ul */
    margin-bottom: 10px; /* Adjusted margin bottom for ul */
    line-height: 1.6; /* Ensured consistent line height for list items */
}

li {
    margin: 8px 0; /* Slightly increased space between list items */
    line-height: 1.6; /* Explicitly set line height for list items */
}

p {
    margin-bottom: 1em; /* Consistent bottom margin for paragraphs */
    line-height: 1.6; /* Explicitly set line height for paragraphs */
}

/* Contact info */
.contact-info {
    margin-bottom: 25px; /* Increased margin for better separation from professional summary */
    line-height: 1.6; /* Consistent line height for contact info */
}

/* These sections already have default block behavior, so they stack well */
.skills,
.professional-skills,
.experience,
.education,
.certifications {
    /* margin-bottom is now handled by the general 'section' rule */
}

.footer {
    text-align: center;
    margin-top: 30px; /* Increased margin for better separation */
    font-size: 0.9em;
    color: #777;
    padding-top: 10px; /* Added padding to lift text from bottom edge of footer visually */
}

.icon {
    margin-right: 8px;
    color: #007bff;
    vertical-align: middle; /* Ensures icons align vertically with text */
}

a {
    text-decoration: none;
    color: #007bff;
    vertical-align: middle; /* Ensures links align vertically with icons/text */
}

a:hover {
    text-decoration: underline;
}

/* New rule for the contact groups */
.contact-group {
    white-space: nowrap; /* PREVENTS line breaks within this span */
    display: inline-block; /* Allows margins and vertical alignment to work correctly */
    margin: 0 7px; /* Adjusted spacing for contact groups */
}

/* -------------------- Responsive Design -------------------- */

/* Media Query for screens up to 768px wide (e.g., tablets) */
@media (max-width: 768px) {
    body {
        padding: 15px; /* Reduce overall padding */
    }

    h1 {
        font-size: 2.2em; /* Slightly smaller heading on tablets */
    }

    h2 {
        font-size: 1.4em;
    }

    h3 {
        font-size: 1.15em;
    }

    section {
        padding: 18px 20px; /* Reduce section padding slightly */
        margin-bottom: 20px; /* Adjust section margin */
    }

    .contact-info p {
        line-height: 1.6; /* Slightly increase line height for better readability on smaller screens */
    }

    ul {
        padding-left: 20px; /* Adjust list indentation */
    }
}

/* Media Query for screens up to 480px wide (e.g., mobile phones) */
@media (max-width: 480px) {
    body {
        padding: 10px; /* Further reduce overall padding for small screens */
    }

    h1 {
        font-size: 1.9em; /* Smaller heading on mobile */
    }

    h2 {
        font-size: 1.3em;
    }

    h3 {
        font-size: 1.1em;
    }

    section {
        padding: 15px; /* Further reduce section padding */
        margin-bottom: 15px;
    }

    ul {
        padding-left: 18px; /* Reduce list indentation */
    }

    li {
        margin: 6px 0; /* Reduce space between list items */
    }

    .contact-info {
        font-size: 0.9em; /* Slightly smaller contact info text */
    }

    .footer {
        font-size: 0.8em; /* Smaller footer text */
    }

    /* Adjust spacing for contact items on very small screens */
    .contact-group {
        margin: 0 4px; /* Tighter spacing on small screens */
    }
}

/* -------------------- Print Specific Styles (for PDF export) -------------------- */
@media print {
    body {
        background-color: #fff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        margin: 0;
        /* Adjusted padding: 0.8cm top, 1.2cm left/right, 1cm bottom */
        padding: 0.2cm 1.2cm 1cm; 
        max-width: none;
        line-height: 1.6;
    }

    section {
        page-break-after: auto;
        margin-bottom: 0.7cm; 
        padding: 15px 20px; 
        padding-bottom: 15px; 
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
    }

    .job-entry {
        page-break-inside: avoid;
        page-break-after: auto;
        margin-bottom: 0.8em; 
        padding-bottom: 5px; 
    }

    h2 {
        page-break-after: avoid;
        margin-top: 1em; 
        margin-bottom: 0.5em; 
        border-bottom: 1px solid #eee; 
        padding-bottom: 3px;
    }

    h3 {
        page-break-after: avoid;
        margin-top: 0.8em; 
        margin-bottom: 0.3em; 
    }

    p {
        page-break-inside: avoid;
        line-height: 1.6; 
        margin-top: 0.5em;
        margin-bottom: 0.5em;
    }

    ul {
        page-break-inside: avoid;
        padding-left: 20px; 
        margin-top: 0.5em;
        margin-bottom: 0.5em;
        line-height: 1.6; 
    }
    li {
        page-break-inside: avoid;
        margin: 5px 0; 
        line-height: 1.6; 
    }

    header, .footer {
        background: white; 
        box-shadow: none; 
    }
    
    a, .icon {
        color: inherit; 
        text-decoration: none;
    }

    .contact-group {
        white-space: nowrap;
        display: inline-block;
        margin: 0 5px;
    }
    
    .footer {
        margin-top: 1cm;
        padding-top: 0;
    }
}