/* ============================================================
   ML TOPIC DETAILS PAGE
============================================================ */

.ml-details-page {
    min-height: calc(100vh - 80px);
    padding: 25px 30px 40px 30px;
    background: #f5f7fb;
}


/* ============================================================
   BACK
============================================================ */

.ml-details-back {
    margin-bottom: 25px;
}

.ml-details-back a {
    color: #202428;
    text-decoration: none;
    font-size: 24px;
}

.ml-details-back a:hover {
    text-decoration: underline;
}


/* ============================================================
   MAIN LAYOUT
============================================================ */

.ml-details-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    min-height: 700px;
}


/* ============================================================
   SIDEBAR
============================================================ */

.ml-details-sidebar {
    width: 220px;
    flex-shrink: 0;
}


.ml-details-sidebar-heading {
    font-size: 18px;
    font-weight: 700;

    margin-bottom: 15px;

    color: #343a40;
}


/* ============================================================
   SIDEBAR BUTTONS
============================================================ */

.ml-details-sidebar-button {
    width: 100%;
    min-height: 52px;

    margin-bottom: 12px;
    padding: 14px 18px;

    display: flex;
    align-items: center;

    box-sizing: border-box;

    border-radius: 8px;

    background: linear-gradient(
        to bottom,
        #3d4145,
        #222629
    );

    color: white;

    font-size: 16px;
    font-weight: 500;

    cursor: grab;

    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.ml-details-sidebar-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.25);
}


.ml-details-sidebar-button:active {
    cursor: grabbing;
}


/* ============================================================
   WORKSPACE
============================================================ */

.ml-details-workspace {
    flex: 1;
    min-width: 0;
}


/* ============================================================
   DROP AREA
============================================================ */

.ml-details-drop-area {
    min-height: 700px;

    border: 2px dashed #aeb4bc;
    border-radius: 10px;

    padding: 25px;

    background: #edf4fa;

    box-sizing: border-box;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


.ml-details-drop-area.dragover {
    background: #e4f0fb;

    border-color: #3b82f6;
}


/* ============================================================
   DROP MESSAGE
============================================================ */

.ml-drop-message {
    color: #202428;

    font-size: 18px;

    margin-bottom: 20px;
}


/* ============================================================
   WORKSPACE PANELS
============================================================ */

.ml-details-panel {
    background: white;

    border: 1px solid #d9dee5;
    border-radius: 14px;

    padding: 20px;
    margin-bottom: 20px;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08);
}


/* ============================================================
   PANEL HEADER
============================================================ */

.ml-details-panel-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}


.ml-details-panel-title {
    font-size: 22px;
    font-weight: 700;

    color: #252a2f;
}


/* ============================================================
   PANEL CLOSE BUTTON
============================================================ */

.ml-details-panel-close {
    border: none;

    background: transparent;

    font-size: 28px;
    line-height: 1;

    color: #777;

    cursor: pointer;
}


.ml-details-panel-close:hover {
    color: #222;
}


/* ============================================================
   LEVEL 4 BUTTONS
============================================================ */

.ml-level4-container {
    display: flex;

    flex-direction: column;

    gap: 10px;
}


.ml-level4-button {
    width: 100%;

    padding: 16px 22px;

    text-align: left;

    border: 1px solid #d5dbe2;
    border-radius: 8px;

    background: #f8fafc;

    color: #252a2f;

    font-size: 17px;
    line-height: 1.45;

    cursor: pointer;

    box-sizing: border-box;

    transition:
        background 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.ml-level4-button:hover {
    background: #eef4fb;

    transform: translateX(3px);

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.08);
}


/* ------------------------------------------------------------
   Completed sidebar topic
   ------------------------------------------------------------ */

.ml-details-sidebar-button.understood {
    background-color: #eef9ee;
    border-color: #b8dcb8;
}

.ml-level4-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}


.ml-level4-button {
    flex: 1;
    min-width: 0;
}


.ml-level4-checkbox {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    opacity: 1;
}


.ml-level4-row.understood {
    background-color: #eef9ee;
    border-radius: 6px;
}

.ml-details-sidebar-button.understood {
    background: #eef9ee;
    border: 1px solid #b8dcb8;
    color: #252a2f;
}

.ml-level4-button.has-youtube {
    cursor: pointer;
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 768px) {

    .ml-details-page {
        padding: 20px 15px 30px 15px;
    }


    .ml-details-layout {
        flex-direction: column;
    }


    .ml-details-sidebar {
        width: 100%;
    }


    .ml-details-workspace {
        width: 100%;
    }


    .ml-details-drop-area {
        min-height: 500px;

        padding: 15px;
    }


    .ml-details-sidebar-button {
        cursor: pointer;
    }


    .ml-details-panel-title {
        font-size: 20px;
    }


    .ml-level4-button {
        font-size: 16px;
    }
}