.container {
    margin: 0 auto;
    max-width: 800px;
    padding: 20px;
    border: 1px solid #ddd;
    background-color: rgba(255, 255, 255, 0.432);
    border-radius: 10px;
    text-align: center;
    transition: background-color 0.3s;
    /* Added Word Wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body.dark-mode .container {
    background-color: rgba(46, 46, 46, 0.8);
}

.section {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.section img,
.combined-sections img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    margin-left: 20px;
}

.timeline-section {
    margin-bottom: 20px;
}

h2,
h3 {
    margin: 20px 0;
    font-weight: bold;
}

.timeline-section h2 {
    margin-bottom: 20px;
}

h3 {
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.timeline-entry {
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.timeline-entry.show {
    opacity: 1;
}

.timeline-entry img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    display: block;
}

.timeline-content {
    justify-content: flex-start;
    padding: 10px;
    /* Added Word Wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Optimized Dark Mode Image Toggling */
.light-theme-image {
    border: 2px solid #000;
}

.light-theme-image,
.dark-theme-image {
    display: block;
}

/* 1. Base rule: All light and dark images are block elements by default */
.light-theme-image,
.dark-theme-image {
    display: block;
}

/* 2. Specific rule to HIDE dark images in LIGHT MODE (when body does NOT have .dark-mode) */
/* This higher specificity ensures it is not overridden in light mode. */
.section .dark-theme-image,
.timeline-entry .dark-theme-image {
    display: none;
}

/* 3. Rule to SHOW dark images in DARK MODE (when body HAS .dark-mode) */
/* This rule is already specific enough to override the one above. */
body.dark-mode .dark-theme-image {
    display: block;
}

/* 4. Rule to HIDE light images in DARK MODE */
body.dark-mode .light-theme-image {
    display: none;
}

body.dark-mode .light-theme-image {
    display: none;
}

body.dark-mode .dark-theme-image {
    display: block;
}

.skills-list {
    list-style: none;
    padding: 0;
}

.skills-list li {
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.skill-title {
    font-weight: bold;
    text-align: left;
    display: block;
}

.skill-detail {
    margin-top: 5px;
    text-align: right;
    display: block;
}

.responsibilities {
    padding-left: 20px;
    list-style-type: circle;
}

.responsibilities li {
    margin-bottom: 10px;
    text-align: left;
}


/* --- Media Queries --- */

@media (min-width: 769px) {
    .skills-list li {
        /* Keep this as flex for skill list title/detail separation */
        display: flex;
        justify-content: space-between;
        align-items: baseline;
    }

    /* **NEW RULE for Timeline Entries** */
    .timeline-entry {
        /* Stack the image and content vertically */
        display: flex;
        flex-direction: column;
        /* Center all items horizontally */
        align-items: center;
        text-align: center; /* Center text within the timeline entry */
    }

    /* **NEW RULE to reset the content alignment** */
    .timeline-content {
        /* Reset content alignment to left for readability */
        text-align: left;
        /* Ensure the content takes up full width for left-alignment to work */
        width: 100%;
    }

    .skill-title {
        flex-grow: 1;
        margin-right: 10px;
    }
    .skill-detail {
        text-align: right;
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .section,
    .timeline-entry {
        display: flex;
        flex-direction: column;
        text-align: left;
        justify-content: flex-start;
    }
    .timeline-entry img {
        margin: 0 auto 20px;
    }
    /* Font Size Optimizations (Combined and Simplified) */
    body {
        font-size: 14px;
    }
    h1 {
        font-size: 2em;
    }
    h2 {
        font-size: 1.5em;
    }
    p {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    /* Font Size Optimizations (Combined and Simplified) */
    body {
        font-size: 12px;
    }
    h1 {
        font-size: 1.8em;
    }
    h2 {
        font-size: 1.2em;
    }
    p {
        font-size: 0.8em;
    }
}