/* MGE – Frontend */

/* ── Folder grid ───────────────────────────── */
.mge-folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 400px);
    gap: 24px;
    width: 1248px;
}

/* ── Folder card ───────────────────────────── */
.mge-folder-card {
    display: flex;
    align-items: center;
    gap: 19px;
    padding: 24px;
    width: 400px;
    max-width: 100%;
    background: transparent;
    border: 1px solid #BFCFDE;
    border-radius: 10px;
    cursor: pointer;
    transition: box-shadow .2s, transform .15s;
    box-sizing: border-box;
    user-select: none;
}

.mge-folder-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 61px;
    height: 48px;
}
.mge-folder-icon svg {
    display: block;
    width: 61px;
    height: 48px;
}

.mge-folder-info { flex: 1; min-width: 0; }
.mge-folder-name {
    display: block;
    color:#333;
    font-family:'Montserrat';
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mge-folder-meta {
    color:#333;
    font-family: Montserrat;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%; 
    opacity: 0.5;
}
/* ── Back bar ──────────────────────────────── */
.mge-items-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: nowrap;
}
.mge-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 100px;
    flex-shrink: 0;
    box-sizing: border-box;
    text-decoration: none;
}
.mge-back-btn svg { display: block; }
.mge-back-btn .mge-custom-icon { display: flex; align-items: center; justify-content: center; }
.mge-back-btn:hover { background: #eff6ff; }

.mge-active-name {
    color: #333;
    font-family: 'Literata';
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    line-height: 140%;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
    flex: 1;
    min-width: 0;
    display: block;
    margin: 0;
    padding: 0;
}

/* ── Horizontal scroll track ───────────────── */
.mge-scroll-track {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    /* hide scrollbar but keep scrollable */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    padding-bottom: 8px;
}
.mge-scroll-track::-webkit-scrollbar {
    height: 5px;
}
.mge-scroll-track::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.mge-scroll-track::-webkit-scrollbar-track {
    background: transparent;
}

.mge-items-row {
    display: flex;
    flex-direction: row;
    gap: 32px;
    flex-wrap: nowrap;
    align-items: flex-start;
}

/* ── Media item card ───────────────────────── */
.mge-item-card {
    flex-shrink: 0;
    border-radius: 10px;
    overflow: visible;
    background: #fff;
}

.mge-item-thumb {
    position: relative;
    width: 100%;
    border-radius: 10px;
}
.mge-item-thumb img {
    width: auto;
    height: auto;
    display: block;
    max-width: none;
    max-height: 500px;
}
.mge-no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 12px;
}
.mge-no-thumb svg { width: 32px; height: 32px; }

/* video used as thumbnail preview */
.mge-video-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* play icon */
.mge-play-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.mge-play-icon svg { width: 16px; height: 16px; margin-left: 3px; color: #1e40af; }

/* ── Download button — hidden by default, shown on card hover ── */
.mge-download-btn {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 100%;
    border: none;
    background: #F8FAF9;
    text-decoration: none;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.mge-download-btn .mge-custom-icon { display: flex; align-items: center; justify-content: center; }
.mge-item-card:hover .mge-download-btn {
    opacity: 1;
    pointer-events: auto;
}

/* item footer (video title) */
.mge-item-foot {
    padding: 8px 4px 0;
    font-size: 12px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* empty */
.mge-empty {
    color: #94a3b8;
    font-size: 14px;
    padding: 32px 0;
    text-align: center;
}