:root {
    --main-bg-color: #f0f4f8;
    --primary-color: #0077be;   /* Ocean Blue */
    --secondary-color: #81d4fa; /* Light Blue */
    --sidebar-bg: #0d47a1;     /* Deep Blue */
    --sidebar-text: #e3f2fd;
    --sidebar-hover-bg: #1565c0;
    --accent-color: #00bcd4;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--main-bg-color);
    color: #2c3e50;
    font-size: 0.875rem; /* Mengecilkan font dasar */
}

#wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#sidebar-wrapper {
    background: var(--sidebar-bg);
    height: 100vh;
    width: 14rem;
    flex-shrink: 0;
    transition: margin .25s ease-out;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

#sidebar-nav {
    overflow-y: auto;
    flex-grow: 1;
}

#page-content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    background-color: var(--main-bg-color);
}

@media (max-width: 768px) {
    #sidebar-wrapper {
        position: absolute;
        z-index: 1000;
        margin-left: -14rem;
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
    #page-content-wrapper {
        min-width: 100vw;
    }
}

#sidebar-wrapper .sidebar-heading {
    color: white;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    font-size: 1.1rem; /* Ukuran heading sidebar */
}

.sidebar-footer {
    flex-shrink: 0;
    padding-bottom: 20px;
}

#menu-toggle {
    cursor: pointer;
    color: var(--primary-color);
}

.list-group-item {
    border: none;
    padding: 10px 20px; /* Lebih ramping */
    background-color: transparent;
    color: var(--sidebar-text);
    font-size: 0.85rem; /* Font menu lebih kecil */
    transition: all 0.3s;
}

.list-group-item.active {
    color: white;
    font-weight: 600;
    background-color: var(--sidebar-hover-bg);
    border: none;
    border-left: 4px solid var(--accent-color);
    padding-left: 21px;
}

.primary-text {
    color: var(--primary-color);
}

.list-group-item-action:hover, .list-group-item-action:focus {
    color: white;
    background-color: var(--sidebar-hover-bg);
}

.sidebar-category {
    font-size: 0.7rem; /* Kategori lebih kecil */
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 15px 20px 5px;
    color: rgba(255,255,255,0.4);
    font-weight: 700;
}

/* Submenu Styling */
.submenu-container {
    background-color: rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.sidebar-item-container.open .submenu-container {
    max-height: 500px; /* Nilai besar agar cukup untuk banyak submenu */
}

.submenu-item {
    padding-left: 35px !important;
    font-size: 0.8rem !important;
    opacity: 0.8;
}

.submenu-item:hover {
    opacity: 1;
}

.toggle-icon {
    transition: transform 0.3s ease;
    display: inline-block;
    opacity: 0.5;
}

.toggle-btn:hover .toggle-icon {
    opacity: 1;
}

.sidebar-item-container.open .toggle-icon {
    transform: rotate(180deg);
}

.parent-link {
    padding-right: 0 !important;
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Delete Button Styling */
.delete-btn {
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: color 0.3s;
    visibility: hidden; /* Hide by default */
    opacity: 0;
}

.list-group-item:hover .delete-btn,
.d-flex:hover .delete-btn {
    visibility: visible; /* Show on hover */
    opacity: 1;
}

.delete-btn:hover {
    color: #ff8a80; /* Light red on hover */
}

.edit-btn {
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: color 0.3s;
    visibility: hidden; /* Hide by default */
    opacity: 0;
}

.list-group-item:hover .edit-btn,
.d-flex:hover .edit-btn {
    visibility: visible; /* Show on hover */
    opacity: 1;
}

.edit-btn:hover {
    color: #81d4fa; /* Light blue on hover */
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sidebar-item-container {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Page Content Titles */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

.fs-2 { font-size: 1.5rem !important; }
.display-4 { font-size: 2.2rem !important; }
.display-5 { font-size: 1.8rem !important; }
.fs-4 { font-size: 1rem !important; }

.tutorial-content h3 {
    font-size: 1.2rem;
    margin-top: 20px;
}

.tutorial-content p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Tutorial Page Specific Styles */
.tutorial-header {
    background: linear-gradient(rgba(0, 119, 190, 0.8), rgba(0, 119, 190, 0.6)), url('https://images.unsplash.com/photo-1516321318423-f06f85e504b3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    height: 35vh;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.tutorial-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    margin-top: -60px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

/* Form Styling */
.ck-editor__editable {
    min-height: 300px;
}

#add-tutorial-form .card {
    background-color: white;
}

#btn-show-add-form {
    transition: all 0.3s;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

#btn-show-add-form:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 119, 190, 0.25);
}
