﻿/* ── Test View Overrides for LessonBlocks ── */
.test-view-container {
    overflow-y: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .08) transparent;
    max-height: 50vh;
    height: 100%;
}

.test-view-container .block-overlay {
    position: relative !important;
    inset: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    margin-bottom: 24px;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
    transform: none !important;
}

.test-view-container .block-card {
    max-width: 100% !important;
    transform: none !important;
    opacity: 1 !important;
    margin: 0 auto;
}

/* ── Overlay ── */
#modal-video-guide-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

    #modal-video-guide-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

/* ── Modal container ── */
.modal-video-guide {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: 85vh;
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(.95) translateY(20px);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}

#modal-video-guide-overlay.active .modal-video-guide {
    transform: scale(1) translateY(0);
}

/* ── Header ── */
.modal-video-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

    .modal-video-guide-header h2 {
        font-size: 1.1rem;
        font-weight: 700;
        background: linear-gradient(135deg, #7c5cfc, #c45cfc);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

/* ── Multi-select dropdown trigger ── */
.cat-select-wrap {
    position: relative;
    padding: 10px;
}

.cat-select-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 14px;
    background: #22222f;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: #f0f0f8;
    transition: border-color .2s, background .2s;
    min-width: 160px;
    max-width: 180px;
    white-space: nowrap;
    user-select: none;
}

    .cat-select-trigger:hover {
        border-color: rgba(124, 92, 252, .5);
        background: #2a2a3a;
    }

    .cat-select-trigger.open {
        border-color: #7c5cfc;
        background: #2a2a3a;
    }

.cat-select-trigger-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-select-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #9090b0;
    transition: transform .2s;
}

.cat-select-trigger.open .cat-select-arrow {
    transform: rotate(180deg);
}

/* Badge count khi chọn nhiều */
.cat-select-badge {
    background: linear-gradient(135deg, #7c5cfc, #c45cfc);
    color: #fff;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
}

/* ── Dropdown panel ── */
.cat-dropdown {
    position: absolute;
    top: calc(100%);
    left: 10px;
    min-width: 220px;
    background: #22222f;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
    z-index: 200;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(.97);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

    .cat-dropdown.open {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: all;
    }

/* Search inside dropdown */
.cat-search-wrap {
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.cat-search {
    width: 100%;
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 0.78rem;
    color: #f0f0f8;
    outline: none;
    transition: border-color .2s;
}

    .cat-search::placeholder {
        color: #606078;
    }

    .cat-search:focus {
        border-color: rgba(124, 92, 252, .5);
    }

/* Action row */
.cat-actions {
    display: flex;
    gap: 6px;
    padding: 6px 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.cat-action-btn {
    flex: 1;
    padding: 5px 0;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, .07);
    background: transparent;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    color: #9090b0;
    cursor: pointer;
    transition: all .15s;
}

    .cat-action-btn:hover {
        background: rgba(124, 92, 252, .12);
        color: #c4b5fd;
        border-color: rgba(124, 92, 252, .3);
    }

    .cat-action-btn.accent {
        background: rgba(124, 92, 252, .15);
        color: #a78bfa;
        border-color: rgba(124, 92, 252, .25);
    }

/* Option list */
.cat-option-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 6px 0 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .08) transparent;
}

    .cat-option-list::-webkit-scrollbar {
        width: 4px;
    }

    .cat-option-list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .08);
        border-radius: 4px;
    }

.cat-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background .15s;
    font-size: 0.84rem;
}

    .cat-option:hover {
        background: rgba(124, 92, 252, .1);
    }

    .cat-option.selected {
        background: rgba(124, 92, 252, .14);
    }

/* Custom checkbox */
.cat-checkbox {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    border-radius: 5px;
    border: 1.5px solid rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    background: transparent;
}

.cat-option.selected .cat-checkbox {
    background: linear-gradient(135deg, #7c5cfc, #c45cfc);
    border-color: transparent;
}

.cat-checkbox svg {
    display: none;
}

.cat-option.selected .cat-checkbox svg {
    display: block;
}

.cat-option-icon {
    font-size: 1rem;
}

.cat-option-label {
    flex: 1;
    color: white;
    font-weight: 500;
}

.cat-option-count {
    font-size: 0.7rem;
    color: #7c5cfc;
    font-weight: 600;
    background: rgba(124, 92, 252, .12);
    border-radius: 50px;
    padding: 1px 7px;
}

/* ── Selected tags pills (below header) ── */
.selected-tags {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px 10px;
    flex-shrink: 0;
}

    .selected-tags.visible {
        display: flex;
    }

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 12px;
    background: rgba(124, 92, 252, .18);
    border: 1px solid rgba(124, 92, 252, .3);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #c4b5fd;
    animation: tagIn .15s ease;
}

@keyframes tagIn {
    from {
        opacity: 0;
        transform: scale(.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tag-remove {
    width: 14px;
    height: 14px;
    background: rgba(124, 92, 252, .3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    color: #c4b5fd;
    transition: background .15s;
    flex-shrink: 0;
}

    .tag-remove:hover {
        background: rgba(255, 80, 80, .3);
        color: #ff9090;
    }

#close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .08);
    background: #22222f;
    color: #9090b0;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}

    #close-btn:hover {
        background: rgba(255, 80, 80, .15);
        color: #ff6060;
    }

/* ── Controls Bar & Select ── */
.controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 20px;
}

.view-mode-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.view-mode-select {
    appearance: none;
    -webkit-appearance: none;
    background: #22222f;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    padding: 7px 24px 7px 14px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: #f0f0f8;
    cursor: pointer;
    outline: none;
    transition: border-color .2s, background .2s;
}

    .view-mode-select:hover {
        border-color: rgba(124, 92, 252, .5);
        background: #2a2a3a;
    }

    .view-mode-select:focus {
        border-color: #7c5cfc;
    }

.view-mode-arrow {
    position: absolute;
    right: 10px;
    width: 16px;
    height: 16px;
    color: #9090b0;
    pointer-events: none;
}

/* ── Body: player + list ── */
.modal-video-guide-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Video player ── */
.player-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    min-width: 0;
    justify-content: center;
}

.player-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #9090b0;
    font-size: .9rem;
    padding: 32px;
}

    .player-placeholder svg {
        opacity: .4;
    }

.video-frame {
    width: 100%;
    aspect-ratio: 16/9;
    display: none;
}

    .video-frame.visible {
        display: block;
    }

.player-info {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: #1a1a24;
    flex-shrink: 0;
    display: none;
}

    .player-info.visible {
        display: block;
    }

    .player-info h3 {
        font-size: .95rem;
        font-weight: 600;
        margin-bottom: 4px;
        color: white;
    }

    .player-info p {
        font-size: .8rem;
        color: #9090b0;
        margin: 0;
    }

.player-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: .7rem;
    font-weight: 600;
    background: rgba(124, 92, 252, .18);
    color: #c4b5fd;
    border: 1px solid rgba(124, 92, 252, .25);
}

/* ── Video list panel ── */
.video-list-panel {
    width: 290px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    flex-direction: column;
    background: #22222f;
    overflow: hidden;
}

.list-header {
    padding: 12px 16px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}

.list-header-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9090b0;
}

.list-count {
    font-size: .72rem;
    color: #7c5cfc;
    margin-top: 2px;
    font-weight: 500;
}

.video-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .08) transparent;
}

    .video-list::-webkit-scrollbar {
        width: 4px;
    }

    .video-list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .08);
        border-radius: 4px;
    }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    min-height: 120px;
    color: #9090b0;
    font-size: .82rem;
    opacity: .7;
    padding: 24px;
    text-align: center;
}

/* ── Video items ── */
.video-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 10px;
    margin: 2px 8px;
    transition: background .2s, transform .15s;
    position: relative;
}

    .video-item:hover {
        background: rgba(124, 92, 252, .12);
        transform: translateX(3px);
    }

    .video-item.active {
        background: rgba(124, 92, 252, .22);
    }

        .video-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 60%;
            background: linear-gradient(180deg, #7c5cfc, #c45cfc);
            border-radius: 0 4px 4px 0;
        }

/*.thumb-wrap {
    position: relative;
    width: 80px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #000;
}

    .thumb-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
    transition: background .2s;
}

.video-item:hover .play-icon,
.video-item.active .play-icon {
    background: rgba(124, 92, 252, .5);
}

.play-icon svg {
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, .6));
}*/

.item-meta {
    min-width: 0;
}

    .item-meta .title {
        font-size: .82rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: white;
        margin: 0 !important;
    }

    .item-meta .sub {
        font-size: .72rem;
        color: #9090b0;
        margin-top: 2px;
    }

    .item-meta .item-cat {
        display: inline-block;
        margin-top: 4px;
        padding: 1px 7px;
        border-radius: 50px;
        font-size: .65rem;
        font-weight: 600;
        background: rgba(124, 92, 252, .15);
        color: #a78bfa;
        border: 1px solid rgba(124, 92, 252, .2);
    }

/* ── Responsive ── */
@media (max-width: 640px) {
    .modal-video-guide-body {
        flex-direction: column;
    }

    .video-list-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, .08);
        max-height: 160px;
    }

    .modal-video-guide-header {
        padding: 16px 16px 12px;
    }

    .controls-bar {
        padding-right: 16px;
    }

    .test-toggle-label {
        font-size: 0.78rem;
    }

    .cat-select-trigger {
        min-width: 120px;
        font-size: 0.78rem;
        padding: 6px 10px 6px 12px;
    }

    .cat-dropdown {
        right: 10px;
        min-width: 200px;
    }

    .player-info {
        padding: 10px 14px;
    }
}
