:root {
    --primary-color: #1DA1F2;
    --text-color-light: #0f1419;
    --text-color-dark: #d9d9d9;
    --bg-color-light: #fff;
    --bg-color-dark: #15202b;
    --header-height: 50px;
}

#portfolio-list {
    display: none;
}

#maintenance-message {
    display: block;
    text-align: center;
    padding: 20px;
    background-color: #f2f2f2;
    margin: 20px 0;
}

#themeToggle {
    margin-right: 20px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color-light);
    color: var(--text-color-light);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

body.drawer-open {
    overflow: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    transition: background-color 0.3s, box-shadow 0.3s;
    z-index: 100;
    box-sizing: border-box;
}

header,
main {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Inner wrapper for header content to match the main content width */
.header-inner {
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header.scrolled {
    background-color: var(--bg-color-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.dark-mode header.scrolled {
    background-color: var(--bg-color-dark);
}

header:not(.scrolled) {
    visibility: hidden;
    opacity: 0;
}

main {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    padding-top: calc(var(--header-height) + 10px);
    padding-right: 20px;
    padding-left: 20px;
    max-width: 1200px;
    margin: auto;
}

@media (max-width: 768px) {
    header {
        padding: 5px;
    }

    .drawer-menu {
        width: 200px;
    }

    main {
        padding: 5px;
        padding-top: 55px;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    h1,
    h2,
    h3,
    p {
        font-size: smaller;
    }

    .icon-button {
        font-size: 20px;
    }

    /* Adjust the carousel for smaller screens */
    .carousel-item {
        width: 90%;
    }

    .timeline-event {
        padding-left: 25px;
    }

    .timeline-event-icon {
        width: 15px;
        height: 15px;
    }

    .timeline-event-content {
        margin-left: 5px;
    }
}

.drawer-menu {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background: var(--primary-color);
    box-shadow: 2px 0px 5px rgba(0, 0, 0, 0.5);
    transition: left 0.3s;
    padding-top: 60px;
    overflow: hidden;
    z-index: 1000;
}

.drawer-menu a {
    padding: 12px 16px;
    text-decoration: none;
    font-size: 16px;
    color: white;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, margin 0.3s ease, padding-left 0.3s ease;
}

.drawer-menu a i {
    margin-right: 16px;
}

html {
    scroll-behavior: smooth;
}

.drawer-menu a:hover {
    background-color: #ddd;
    color: black;
    border-radius: 24px;
    margin: 4px 0;
    padding-left: 28px;
}

#closeDrawer {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: white;
    padding: 20px;
    font-size: 24px;
    cursor: pointer;
}

.open {
    left: 0;
}

.carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.carousel-item {
    flex: 0 0 auto;
    margin-right: 16px;
    scroll-snap-align: start;
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
}

.carousel-item img {
    width: 100%;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.dark-mode {
    background-color: var(--bg-color-dark);
    color: var(--text-color-dark);
}

.icon-button {
    background: none;
    border: none;
    color: inherit;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.icon-button i {
    transition: transform 0.3s ease;
}

.dark-mode .icon-button i {
    transform: rotate(180deg);
}

#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    padding: 0.5em;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
}

#backToTop:hover {
    background-color: #000;
    color: #fff;
}

.dark-mode #backToTop {
    background-color: var(--text-color-dark);
    color: var(--bg-color-dark);
}

.dark-mode header {
    color: var(--text-color-dark);
}

.dark-mode #backToTop:hover {
    background-color: #fff;
    color: #000;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#overlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

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

.timeline-event {
    position: relative;
    padding-left: 40px;
    margin-bottom: 20px;
}

.timeline-event-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
}

.timeline-event-content {
    padding: 10px;
    border-left: 3px solid var(--primary-color);
    margin-left: 10px;
}

.timeline-date {
    font-weight: bold;
    color: var(--primary-color);
}

body {
    background-color: #fff;
    padding: 5px;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}


.loading-text {
    font-size: 18px;
    font-weight: bold;
    color: #000;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


.loading-text::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 200%;
    height: 200%;
    background: linear-gradient(-45deg, rgba(0, 0, 0, 0), rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0));
    animation: lightShine 3s ease-in-out infinite;
}

@keyframes lightShine {
    0% {
        left: -150%;
    }

    50% {
        left: -25%;
    }

    100% {
        left: 100%;
    }
}

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #fff; /* atau warna gelap sesuai tema */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.loading {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important; /* cegah mobile scroll/zoom saat loading */
    width: 100vw !important;
}
