/* ══════════════════════════════════════════════════════════
   Edit-media gallery (ad create / edit)
   ══════════════════════════════════════════════════════════ */

.editmedia-tile {
    width: 150px;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    position: relative;
    user-select: none;
}

.editmedia-thumb {
    width: 100%;
    height: 105px;
    object-fit: cover;
    display: block;
    background: #f3f5f8;
}

.editmedia-footer {
    padding: 6px 8px;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.editmedia-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.editmedia-actions button {
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(255,255,255,.95);
    border-radius: 999px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.editmedia-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    font-size: 11px;
}

/* Drag & drop states */
.dragging {
    opacity: .55;
}

.drop-target {
    outline: 2px dashed rgba(59,130,246,.5);
    outline-offset: 2px;
}

.marked-delete {
    filter: grayscale(1);
    opacity: .55;
}

.editmedia-tile.swap-selected {
    outline: 3px solid rgba(59,130,246,.7);
    outline-offset: 2px;
    box-shadow: 0 10px 25px rgba(59,130,246,.25);
}

/* Video icon overlay */
.editmedia-video-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,.6);
    pointer-events: none;
}

/* Cover button wrap */
.editmedia-cover-wrap {
    display: flex;
    justify-content: center;
    margin-top: .35rem;
}

.editmedia-cover-wrap .btn {
    font-size: .75rem;
    padding: 2px 10px;
    border-radius: 999px;
}

@media (max-width: 767.98px) {
    #editMediaGallery {
        justify-content: center;
    }
}

/* Footer cover button */
.editmedia-footer-btn {
    width: calc(100% - 10px);
    margin: .35rem 5px 0;
    padding: .4rem .6rem;
    border-radius: .75rem;
    border: 1px solid #cfe2ff;
    background: #fff;
    color: #0d6efd;
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all .15s ease-in-out;
}

.editmedia-footer-btn:hover {
    background: var(--bs-primary);
    border-color: #9ec5fe;
    color: white;
}

.editmedia-footer-btn:active {
    transform: scale(0.98);
}

.editmedia-footer-btn.is-cover {
    background: var(--bs-primary);
    border-color: #0d6efd;
    color: #fff;
    cursor: default;
}

.editmedia-footer-btn:disabled {
    opacity: .9;
    cursor: default;
}

/* Video placeholder tile */
.editmedia-video-ph {
    width: 100%;
    height: 100%;
    min-height: 120px;
    border-radius: .75rem;
    background: #f3f5f8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: .75rem;
    box-sizing: border-box;
    margin-bottom: 0;
}

.editmedia-video-ph__icon {
    font-size: 2rem;
    line-height: 1;
    color: #0d6efd;
    background: #e7f1ff;
    width: 56px;
    height: 56px;
    border-radius: .75rem;
    display: grid;
    place-items: center;
    margin-bottom: .4rem;
}

.editmedia-video-ph__text {
    font-size: .78rem;
    color: #6c757d;
    font-weight: 500;
    line-height: 1.2;
}

/* Tile conditionals */
.editmedia-tile:has(.editmedia-video-ph),
.editmedia-tile:has(.editmedia-video-icon) {
    padding-bottom: 0;
}

.editmedia-tile:not(:has(.editmedia-footer-btn)) {
    padding-bottom: 0;
}
