﻿.ua {
    font-family: inherit;
    width: 100%;
    direction: rtl;
}
.ua-fit {
    font-family: inherit;
    width: fit-content;
    direction: rtl;
}

.ua__strip-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    background: var(--hmj-bg-card);
    border: 1.5px solid var(--hmj-border);
    border-radius: 12px;
    padding: 10px 12px;
    min-height: 88px;
    overflow: hidden;
    gap: 8px;
}

.ua__add {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    order: 0;
    border-radius: 8px;
    border: 1.5px dashed var(--hmj-border);
    background: transparent;
    color: var(--hmj-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: border-color .2s, color .2s, background .2s;
    font-family: inherit;
    font-size: 10px;
}

    .ua__add:hover {
        border-color: var(--hmj-accent);
        color: var(--hmj-accent);
        background: var(--hmj-bg-highlight);
    }

    .ua__add svg {
        width: 20px;
        height: 20px;
    }

.ua__add--hidden {
    display: none;
}

.ua__strip {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    order: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--hmj-border) transparent;
    padding-bottom: 2px;
    direction: rtl;
    justify-content: flex-start;
}

    .ua__strip::-webkit-scrollbar {
        height: 4px;
    }

    .ua__strip::-webkit-scrollbar-track {
        background: transparent;
    }

    .ua__strip::-webkit-scrollbar-thumb {
        background: var(--hmj-border);
        border-radius: 4px;
    }

.ua__empty {
    color: var(--hmj-text-muted);
    font-size: 13px;
    padding: 0 4px;
    white-space: nowrap;
    user-select: none;
    direction: rtl;
}

.ua__thumb {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--hmj-bg-highlight);
    border: 1.5px solid var(--hmj-border);
    cursor: pointer;
    transition: border-color .2s;
    direction: ltr;
}

    .ua__thumb:hover {
        border-color: var(--hmj-accent);
    }

    .ua__thumb img, .ua__thumb video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        pointer-events: none;
    }

.ua__thumb-icon {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px;
}

    .ua__thumb-icon svg {
        width: 24px;
        height: 24px;
        color: var(--hmj-text-muted);
    }

    .ua__thumb-icon span {
        font-size: 9px;
        color: var(--hmj-text-muted);
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: .5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 52px;
        text-align: center;
    }

.ua__thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 21%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 1;
    transition: opacity .18s;
}

.ua__thumb:hover .ua__thumb-overlay {
    opacity: 1;
}

.ua__thumb-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--hmj-text-on-primary);
    background: rgb(0 0 0 / 58%);
    color: var(--hmj-text-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
    padding: 0;
}

    .ua__thumb-btn:hover {
        background: rgba(255,255,255,.35);
    }

    .ua__thumb-btn svg {
        width: 13px;
        height: 13px;
    }

.ua__status {
    position: absolute;
    bottom: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ua__status--uploading {
    background: var(--hmj-info);
}

.ua__status--done {
    background: var(--hmj-success);
}

.ua__status--error {
    background: var(--hmj-error);
}

.ua__status svg {
    width: 9px;
    height: 9px;
    color: var(--hmj-text-on-primary);
}

.ua__thumb--url {
    border-style: dashed;
}

.ua__modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
}

.ua__modal-backdrop--hidden {
    display: none;
}

.ua__editor {
    background: var(--hmj-bg-card);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.ua__editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hmj-bg-highlight);
    flex-shrink: 0;
}

.ua__editor-title {
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.ua__editor-header-btns {
    display: flex;
    gap: 6px;
}

.ua__icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--hmj-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    font-family: inherit;
    padding: 0;
}

    .ua__icon-btn:hover {
        background: var(--hmj-bg-highlight);
        color: #111;
    }

    .ua__icon-btn svg {
        width: 16px;
        height: 16px;
    }

.ua__icon-btn--active {
    color: var(--hmj-accent);
    background: var(--hmj-bg-highlight);
}

.ua__canvas-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #1a1a2e;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ua-canvas {
    display: block;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

#ua-crop-overlay {
    position: absolute;
    z-index: 2;
    display: none;
    cursor: crosshair;
    user-select: none;
}

    #ua-crop-overlay.active {
        display: block;
    }

#ua-crop-box {
    position: absolute;
    border: 2px solid var(--hmj-bg-card);
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
    display: none;
}

    #ua-crop-box.visible {
        display: block;
    }

    #ua-crop-box::before,
    #ua-crop-box::after {
        content: '';
        position: absolute;
        background: rgba(255,255,255,.3);
        pointer-events: none;
    }

    #ua-crop-box::before {
        left: 33.33%;
        width: 33.34%;
        top: 0;
        bottom: 0;
        border-left: 1px solid rgba(255,255,255,.3);
        border-right: 1px solid rgba(255,255,255,.3);
        background: transparent;
    }

    #ua-crop-box::after {
        top: 33.33%;
        height: 33.34%;
        left: 0;
        right: 0;
        border-top: 1px solid rgba(255,255,255,.3);
        border-bottom: 1px solid rgba(255,255,255,.3);
        background: transparent;
    }

.ua__ch {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--hmj-bg-card);
    border: 2px solid var(--hmj-accent);
    border-radius: 2px;
}

.ua__ch--tl {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.ua__ch--tr {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.ua__ch--bl {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.ua__ch--br {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}

.ua__ch--tc {
    top: -6px;
    left: calc(50% - 6px);
    cursor: ns-resize;
}

.ua__ch--bc {
    bottom: -6px;
    left: calc(50% - 6px);
    cursor: ns-resize;
}

.ua__ch--ml {
    top: calc(50% - 6px);
    left: -6px;
    cursor: ew-resize;
}

.ua__ch--mr {
    top: calc(50% - 6px);
    right: -6px;
    cursor: ew-resize;
}

.ua__crop-actions {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
    pointer-events: auto;
    white-space: nowrap;
}

.ua__crop-action-btn {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}

.ua__cap--apply {
    background: var(--hmj-accent);
    color: var(--hmj-text-on-primary);
}

    .ua__cap--apply:hover {
        background: #6d28d9;
    }

.ua__cap--cancel {
    background: rgba(255,255,255,.15);
    color: var(--hmj-text-on-primary);
    backdrop-filter: blur(4px);
}

    .ua__cap--cancel:hover {
        background: rgba(255,255,255,.28);
    }

.ua__controls {
    padding: 12px 18px;
    border-top: 1px solid var(--hmj-bg-highlight);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex-shrink: 0;
}

.ua__quick-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ua__action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid var(--hmj-border);
    border-radius: 7px;
    background: var(--hmj-bg-card);
    color: #374151;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}

    .ua__action-btn:hover {
        border-color: var(--hmj-accent);
        color: var(--hmj-accent);
        background: var(--hmj-bg-highlight);
    }

    .ua__action-btn svg {
        width: 13px;
        height: 13px;
    }

.ua__slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ua__slider-label {
    font-size: 11px;
    color: var(--hmj-text-muted);
    width: 65px;
    flex-shrink: 0;
}

.ua__slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 4px;
    background: var(--hmj-border);
    outline: none;
    cursor: pointer;
}

    .ua__slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: var(--hmj-accent);
        cursor: pointer;
        border: 2px solid var(--hmj-bg-card);
        box-shadow: 0 1px 4px rgba(124,58,237,.4);
    }

.ua__slider-val {
    font-size: 11px;
    color: #374151;
    width: 34px;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.ua__editor-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 18px;
    border-top: 1px solid var(--hmj-bg-highlight);
    flex-shrink: 0;
}

.ua__btn {
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s;
    font-family: inherit;
}

.ua__btn--ghost {
    background: transparent;
    border-color: var(--hmj-border);
    color: #374151;
}

    .ua__btn--ghost:hover {
        background: var(--hmj-bg-highlight);
    }

.ua__btn--primary {
    background: var(--hmj-accent);
    color: var(--hmj-text-on-primary);
    border-color: var(--hmj-accent);
}

    .ua__btn--primary:hover {
        background: #6d28d9;
    }

.ua__toasts {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    min-width: 220px;
}

.ua__toast {
    background: #1f2937;
    color: var(--hmj-text-on-primary);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    animation: ua-slide-up .25s ease;
    text-align: center;
    font-family: inherit;
}

.ua__toast--success {
    background: #065f46;
}

.ua__toast--error {
    background: #991b1b;
}

.ua__toast--warn {
    background: #92400e;
}

@keyframes ua-slide-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .ua__editor {
        border-radius: 12px 12px 0 0;
        max-height: 95vh;
    }

    .ua__modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }
}
