/* Image search modal — shared polish for default + Aster */
.image-search-modal .modal-content {
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
}

.image-search-modal .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 1.25rem;
}

.image-search-modal .modal-title {
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.image-search-modal .modal-body {
    padding: 1.25rem;
}

.image-search-modal .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.875rem 1.25rem;
}

.image-search-intro {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.image-search-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 180px;
    padding: 1.5rem 1rem;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.image-search-dropzone:hover,
.image-search-dropzone.is-dragover {
    border-color: var(--web-primary, var(--bs-primary, #1b7fed));
    background: rgba(27, 127, 237, 0.04);
    box-shadow: inset 0 0 0 1px rgba(27, 127, 237, 0.12);
}

.image-search-dropzone-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(27, 127, 237, 0.1);
    color: var(--web-primary, var(--bs-primary, #1b7fed));
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.image-search-dropzone-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
    margin: 0;
}

.image-search-dropzone-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

.image-search-dropzone-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0.25rem 0 0;
}

.image-search-file-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

.image-search-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-search-preview img {
    display: block;
    max-width: 100%;
    max-height: 240px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.image-search-preview-clear {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.image-search-preview-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

.image-search-error {
    border-radius: 8px;
    font-size: 0.875rem;
    margin-top: 0.875rem;
    margin-bottom: 0 !important;
}

.image-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.875rem;
}

.image-search-modal.is-searching .image-search-dropzone,
.image-search-modal.is-searching .image-search-preview-clear,
.image-search-modal.is-searching #image-search-submit {
    pointer-events: none;
    opacity: 0.65;
}

.image-search-modal #image-search-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

[dir="rtl"] .image-search-preview-clear {
    right: auto;
    left: 10px;
}

[dir="rtl"] .image-search-preview-badge {
    left: auto;
    right: 10px;
}
