/* ===============================
   EduNav FAQ Manager - Layout Utama
=================================*/

.edunav-faq-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Wrapper Sidebar + Konten */
.edunav-faq-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* ===============================
   Search Bar
=================================*/

.edunav-faq-search-container {
    background: #ffffff;
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.faq-search-wrapper {
    position: relative;
    max-width: 520px;
    margin: 0;
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: #a0aec0;
    pointer-events: none;
}

.faq-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    border-radius: 8px;
    border: 1.8px solid #e2e8f0;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease;
}

.faq-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.search-clear {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: none;
    background: #e2e8f0;
    color: #4a5568;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: #cbd5e0;
}

.search-results-info {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: #718096;
}

/* ===============================
   Sidebar Kiri (Kategori)
=================================*/

.edunav-faq-sidebar {
    width: 320px;
    background: #ffffff;
    padding: 1.25rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 1.5rem;
    box-sizing: border-box;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}

.sidebar-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.75rem;
}

/* Level 1 - Kategori (accordion) */

.accordion-item {
    margin-bottom: 0.45rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    background: #f9fafb;
}

.accordion-header {
    padding: 0.7rem 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    background: #f7fafc;
    transition: all 0.25s ease;
    user-select: none;
}

.accordion-header:hover {
    background: #0AB2D4;
}

.accordion-header.active {
    background: #0AB2D4;
    color: #ffffff;
}

.accordion-icon {
    font-size: 0.9rem;
    transition: transform 0.25s ease;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    background: #ffffff;
    transition: max-height 0.3s ease;
}

.accordion-content.active {
    max-height: 900px; /* cukup besar untuk isi submenu */
}

/* Level 2 - Sub Kategori */

.sub-accordion-item {
    border-top: 1px solid #f3f4f6;
}

.sub-accordion-header {
    padding: 0.55rem 0.8rem 0.55rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    background: #f9fafb;
    transition: all 0.2s ease;
    user-select: none;
}

.sub-accordion-header:hover {
    background: #edf2ff;
    color: #0ab2d4;
}

.sub-accordion-header.active {
    background: #0ab2d479;
    color: #000000;
    border-left: 3px solid #0ab2d4;
}

.sub-accordion-icon {
    font-size: 0.8rem;
    transition: transform 0.25s ease;
}

.sub-accordion-header.active .sub-accordion-icon {
    transform: rotate(90deg);
}

.sub-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background: #ffffff;
}

.sub-accordion-content.active {
    max-height: 600px;
}

/* Level 3 - Sub-Sub Kategori */

.subsub-item {
    padding: 0.45rem 0.8rem 0.45rem 2.0rem;
    font-size: 0.82rem;
    color: #4a5568;
    cursor: pointer;
    position: relative;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: normal;
    line-height: 1.4;
}

.subsub-item::before {
    content: "•";
    position: absolute;
    left: 1.35rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #cbd5e0;
}

.subsub-item:hover {
    background: #0ab2d430;
    color: #000000;
    border-left-color: #0ab2d4;
}

.subsub-item.active {
    background: #0ab2d430;
    color: #000000;
    border-left-color: #0ab2d4;
    font-weight: 600;
}

.subsub-item.active::before {
    content: "▸";
    color: #4f46e5;
}

/* ===============================
   Konten Kanan
=================================*/

.edunav-faq-content {
    flex: 1;
    background: #ffffff;
    padding: 1.5rem 1.75rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    min-height: 420px;
    box-sizing: border-box;
}

.faq-content-section {
    display: none;
    animation: fadeIn 0.35s ease;
}

.faq-content-section.active {
    display: block;
}

.faq-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0ab2d4;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #e5e7eb;
}

.faq-item {
    padding: 0.9rem 0;
    border-bottom: 1px solid #edf2f7;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-weight: 600;
    color: #1f2933;
    margin-bottom: 0.35rem;
    font-size: 0.98rem;
}

.faq-answer {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.7;
}

/* ===============================
   Search Highlight & Empty State
=================================*/

.search-highlight {
    background: #fef9c3;
    padding: 0 2px;
    border-radius: 2px;
}

.no-results-message {
    padding: 2rem 1.5rem;
    text-align: center;
    border-radius: 10px;
    border: 1.5px dashed #cbd5e0;
    color: #718096;
    background: #f9fafb;
    font-size: 0.9rem;
}

/* ===============================
   Mobile Menu
=================================*/

.mobile-menu-toggle {
    display: none;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 0.25rem;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    display: none;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mobile-menu-toggle .hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mobile-menu-toggle .hamburger-icon span {
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: all 0.25s;
}

.mobile-menu-toggle.active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translateY(4px);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translateY(-4px);
}

/* ===============================
   Responsive
=================================*/

@media (max-width: 992px) {
    .edunav-faq-wrapper {
        gap: 1rem;
    }

    .edunav-faq-sidebar {
        width: 260px;
    }
}

@media (max-width: 768px) {

    .edunav-faq-container {
        padding: 0 0.5rem;
        gap: 1rem;
    }

    .edunav-faq-wrapper {
        flex-direction: column;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .edunav-faq-sidebar {
        position: fixed;
        z-index: 9999;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        border-radius: 0;
        box-shadow: 4px 0 16px rgba(15, 23, 42, 0.35);
        padding-top: 1.25rem;
        transition: left 0.3s ease;
        max-height: 100vh;
    }

    .edunav-faq-sidebar.mobile-open {
        left: 0;
    }

    .edunav-faq-content {
        padding: 1.1rem 1rem;
        box-shadow: 0 1px 6px rgba(15, 23, 42, 0.08);
        min-height: 260px;
    }

    .faq-title {
        font-size: 1.05rem;
    }

    .faq-question {
        font-size: 0.92rem;
    }

    .faq-answer {
        font-size: 0.86rem;
    }
}

/* ===============================
   Animasi
=================================*/

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
