/* --- VARIABEL CSS (DARK MODE SUPPORT) --- */
:root {
    --bg-color: #f4f7f6;
    --sidebar-bg: #002d6b;
    --sidebar-text-color: #ecf0f1;
    --sidebar-hover-bg: #00509f;
    --content-bg: #ffffff;
    --text-color: #333333;
    --header-color: #1a252f;
    --border-color: #e0e0e0;
    --code-bg: #2d2d2d;
    --code-color: #f8f8f2;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-color: #121212;
    --sidebar-bg: #1e1e1e;
    --sidebar-text-color: #b0b0b0;
    --sidebar-hover-bg: #2a2a2a;
    --content-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --header-color: #ffffff;
    --border-color: #333333;
    --code-bg: #1a1a1a;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* --- RESET & GLOBAL STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

/* --- LAYOUT UTAMA --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR STYLES --- */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text-color);
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--sidebar-hover-bg);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav .main-item>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    color: var(--sidebar-text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s;
    font-weight: 500;
}

.sidebar-nav .main-item>a:hover,
.sidebar-nav .main-item>a.active-link {
    background-color: var(--sidebar-hover-bg);
}

.sidebar-nav .submenu {
    margin-top: 5px;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.sidebar-nav .submenu.open {
    max-height: 500px;
    /* Angka yang cukup besar */
}

.sidebar-nav .submenu li a {
    display: block;
    padding: 10px 15px;
    color: var(--sidebar-text-color);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.sidebar-nav .submenu li a:hover,
.sidebar-nav .submenu li a.active-link {
    opacity: 1;
}

/* --- MAIN CONTENT STYLES --- */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 0;
    transition: margin-left 0.3s ease-in-out;
}

.top-bar {
    background-color: var(--content-bg);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-color);
    transition: background-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--bg-color);
}

.content-area {
    padding: 40px;
}

.content-section {
    display: none;
    /* Sembunyikan semua section */
}

.content-section.active {
    display: block;
    /* Tampilkan section yang aktif */
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section h1 {
    color: var(--header-color);
    margin-bottom: 20px;
}

.content-section p {
    line-height: 1.7;
    margin-bottom: 20px;
}

.content-section pre {
    background-color: var(--code-bg);
    color: var(--code-color);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.content-section code {
    font-family: "Courier New", Courier, monospace;
}

/* --- BACK TO TOP BUTTON --- */
#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text-color);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    /* Sembunyikan secara default */
    z-index: 999;
    transition: opacity 0.3s;
}

#backToTop:hover {
    opacity: 0.8;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .overlay.active {
        display: block;
    }
}

.info-lainnya {
    display: flex;
    flex-wrap: wrap;
}

.img-info {
    margin: 5px;
}