:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #333;
    --light-text-color: #7f8c8d;
    --background-color: #f4f6f8;
    --card-background: #ffffff;
    --border-color: #e0e0e0;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --spacing-unit: 1rem;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #ecf0f1;
        --secondary-color: #bdc3c7;
        --accent-color: #3498db;
        --text-color: #ecf0f1;
        --light-text-color: #bdc3c7;
        --background-color: #1a1a1a;
        --card-background: #2c2c2c;
        --border-color: #444;
        --shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    }
}

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

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    font-size: 16px;
}

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

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Wrapper for the whole page content */
.main-wrapper {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    object-fit: cover;
    box-shadow: var(--shadow);
}

header .profile-info h1 {
    margin-bottom: 0.25rem;
    color: var(--primary-color);
}

header .profile-info p {
    color: var(--light-text-color);
    font-size: 1.1em;
}

header .contact-info {
    text-align: right;
    font-size: 0.9em;
}

header .contact-info a {
    display: block;
    margin-bottom: 0.25rem;
}

/* Full width section styles */
.full-width {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Introduction Paragraph content layout */
#introduction p {
    margin-bottom: 1rem;
}

#introduction p:last-child {
    margin-bottom: 0;
}

/* The grid below the intro */
.content-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    /* Sidebar fixed width, Main flexible */
    gap: 2rem;
    align-items: start;
}

aside {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

section {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Aside specific adjustments */
aside section {
    box-shadow: none;
    padding: 0;
    margin-bottom: 2rem;
}

aside section:last-child {
    margin-bottom: 0;
}

h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

h3 {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.job {
    margin-bottom: 2rem;
}

.job:last-child {
    margin-bottom: 0;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.job-title {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1em;
}

.company {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.date-location {
    font-size: 0.9em;
    color: var(--light-text-color);
    font-style: italic;
    white-space: nowrap;
}

ul {
    list-style-type: none;
    padding-left: 0;
}

.job ul li,
#awards ul li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
}

.job ul li::before,
#awards ul li::before {
    content: "•";
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Aside list styling */
aside ul li {
    margin-bottom: 0.5rem;
    font-size: 0.95em;
    padding-left: 1rem;
    position: relative;
}

aside ul li::before {
    content: "›";
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background-color: var(--background-color);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85em;
    border: 1px solid var(--border-color);
}

.education-item {
    margin-bottom: 1.5rem;
}

.education-item:last-child {
    margin-bottom: 0;
}

footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--light-text-color);
    font-size: 0.9em;
    border-top: 1px solid var(--border-color);
}

.print-only {
    display: none;
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    aside {
        position: static;
        order: 2;
        /* Put sidebar after main content on mobile */
    }

    main {
        order: 1;
    }

    header {
        flex-direction: column;
        text-align: center;
    }

    .header-left {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    header .contact-info {
        text-align: center;
    }
}

@media print {
    body {
        background-color: white;
        color: black;
        font-size: 11pt;
        /* Slightly smaller for print to fit more */
    }

    .main-wrapper {
        display: block;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    header,
    .full-width,
    aside,
    section,
    footer,
    .content-grid {
        box-shadow: none;
        background-color: transparent !important;
        padding: 0;
        margin: 0;
        display: block;
    }

    .content-grid {
        display: block;
        /* Stack linearly for print usually better, or keep grid if it fits */
    }

    aside {
        display: none;
        /* Often resumes put skills at bottom or top, sidebar in print is tricky. Let's hide sidebar? No, usually not desired */
    }

    /* Let's try to keep 2-column if possible, but usually linear is safer for page breaks */
    .content-grid {
        display: grid;
        grid-template-columns: 28% 70%;
        gap: 2%;
    }

    aside {
        display: block;
        position: static;
        border-right: 1px solid #eee;
        padding-right: 1rem;
    }

    header {
        margin-bottom: 1.5rem;
        border-bottom: 1px solid #ccc;
        padding-bottom: 1rem;
    }

    a {
        text-decoration: none;
        color: black;
    }

    .no-print {
        display: none;
    }

    section {
        margin-bottom: 2rem;
        page-break-inside: avoid;
    }

    h2 {
        border-bottom: 1px solid #000;
        margin-top: 0;
    }
}