/* ======= CSS Reset & Base ======= */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: #545E6C;
    background: #f5f5f5;
    font-size: 16px;
    padding: 30px;
    padding-top: 80px;
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin: 0;
}

a {
    color: #666666;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: #3a3a3a;
}

p {
    margin: 0 0 15px 0;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ======= Navbar ======= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f5f5f5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0 15px;
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    font-weight: 500;
    font-size: 18px;
    color: #545E6C;
}

.nav-brand:hover {
    text-decoration: none;
    color: #3a3a3a;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #545E6C;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-menu {
    display: flex;
    gap: 5px;
}

.nav-menu li {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 8px 12px;
    color: #545E6C;
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.3s ease, color 0.3s ease;
}

.nav-link:hover {
    background: #e8e8e8;
    text-decoration: none;
    color: #3a3a3a;
}

.nav-link.active {
    background: #727272;
    color: #fff;
}

/* ======= Wrapper Layout ======= */
.wrapper {
    background: #727272;
    max-width: 960px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
}

/* ======= Sidebar ======= */
.sidebar-wrapper {
    background: #727272;
    position: sticky;
    top: 56px;
    width: 250px;
    height: calc(100vh - 56px);
    min-height: 80px;
    color: #fff;
    flex-shrink: 0;
    align-self: flex-start;
    overflow-y: auto;
}

.sidebar-wrapper a {
    color: #fff;
}

.profile-container {
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
}

.sidebar-wrapper .name {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    color: #fff;
}

.sidebar-wrapper .tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.contact-container {
    padding: 30px;
}

.contact-list li {
    margin-bottom: 15px;
    font-size: 14px;
}

.contact-list li:last-child {
    margin-bottom: 0;
}

.contact-list i {
    margin-right: 8px;
    width: 18px;
    text-align: center;
}

/* ======= Main Content ======= */
.main-wrapper {
    background: #fff;
    padding: 60px;
    flex: 1;
    min-width: 0;
}

.section {
    margin-bottom: 50px;
    scroll-margin-top: 70px;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    text-transform: uppercase;
    font-size: 20px;
    font-weight: 500;
    color: #666666;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 50%;
    background: #666666;
    font-size: 14px;
}

/* ======= Items (Certs, Education, Links) ======= */
.item {
    margin-bottom: 25px;
}

.item:last-child {
    margin-bottom: 0;
}

.upper-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 5px;
}

.time {
    color: #97AAC3;
    font-size: 14px;
    white-space: nowrap;
}

.cert-title, .edu-title {
    color: #3F4650;
    font-size: 16px;
    font-weight: 600;
}

.cert-id, .edu-location {
    color: #97AAC3;
    font-size: 14px;
    margin-bottom: 5px;
}

.cert-link {
    font-size: 14px;
    margin-bottom: 10px;
}

.cert-details, .edu-details {
    color: #545E6C;
    font-size: 15px;
}

.links-title {
    font-weight: 500;
    color: #3F4650;
}

/* ======= Job Details Page ======= */
.job-detail-item {
    margin-bottom: 35px;
    padding-bottom: 35px;
    border-bottom: 1px solid #e8e8e8;
}

.job-detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.job-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 5px;
}

.job-detail-item .job-title {
    color: #3F4650;
    font-size: 18px;
    font-weight: 600;
}

.job-detail-item .company {
    color: #97AAC3;
    font-size: 15px;
    margin-bottom: 15px;
}

.job-detail-content ul {
    list-style: disc;
    padding-left: 25px;
    margin-bottom: 15px;
}

.job-detail-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.job-detail-content p {
    margin-bottom: 10px;
}

/* ======= Accordion ======= */
.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.3s ease;
}

.accordion-header:hover {
    background: #f0f0f0;
}

.accordion-header[aria-expanded="true"] {
    background: #f0f0f0;
    border-bottom: 1px solid #e0e0e0;
}

.job-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 15px;
    margin-right: 15px;
}

.job-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.job-title {
    color: #3F4650;
    font-size: 16px;
    font-weight: 600;
}

.job-header .company {
    color: #97AAC3;
    font-size: 14px;
}

.job-header .time {
    color: #97AAC3;
    font-size: 14px;
    white-space: nowrap;
}

.accordion-icon {
    color: #97AAC3;
    font-size: 12px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.accordion-content.open {
    max-height: 2000px;
}

.accordion-body {
    padding: 20px;
}

.accordion-body p {
    margin-bottom: 15px;
    text-align: justify;
}

.accordion-body ul {
    list-style: disc;
    padding-left: 25px;
    margin-bottom: 15px;
}

.accordion-body li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.accordion-body p:last-child,
.accordion-body ul:last-child {
    margin-bottom: 0;
}

/* ======= Skills Section ======= */
.skillset {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.level-title {
    font-size: 14px;
    font-weight: 500;
    color: #3F4650;
    min-width: 120px;
    margin: 0;
}

.level-bar {
    flex: 1;
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.level-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #888 0%, #aaa 100%);
    border-radius: 6px;
    width: 0;
    transition: width 0.8s ease-out;
}

/* ======= Footer ======= */
.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: #f5f5f5;
    padding: 8px 15px;
    z-index: 1000;
    border-top: 1px solid #e0e0e0;
}

.footer-content {
    max-width: 960px;
    margin: 0 auto;
}

.copyright {
    color: #545E6C;
    font-size: 13px;
}

/* ======= Back to Top Button ======= */
#myBtn {
    display: none;
    position: fixed;
    bottom: 50px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #727272;
    color: white;
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#myBtn:hover {
    background-color: #555;
    transform: translateY(-2px);
}

/* ======= Responsive Styles ======= */

/* Tablet and below */
@media (max-width: 900px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #f5f5f5;
        flex-direction: column;
        padding: 15px;
        gap: 5px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        padding: 12px 15px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    body {
        padding: 15px;
        padding-top: 70px;
    }

    .wrapper {
        flex-direction: column;
    }

    .sidebar-wrapper {
        position: static;
        width: 100%;
        height: auto;
    }

    .main-wrapper {
        padding: 30px;
    }

    .upper-row {
        flex-direction: column;
        gap: 5px;
    }

    .time {
        order: -1;
    }

    .job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .accordion-header {
        padding: 15px;
    }

    .skill-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .level-title {
        min-width: auto;
    }

    .level-bar {
        width: 100%;
    }

    #myBtn {
        bottom: 60px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

/* Large screens */
@media (min-width: 992px) {
    .skill-item {
        flex-direction: row;
    }

    .level-title {
        width: 150px;
        flex-shrink: 0;
    }
}
