/* === avatar_gallery_hagalnaud === */

.gallery-warning-text {
    font-size: 12px;
    margin-top: 5px;
    min-height: 10px; 
    transition: color 0.3s, opacity 0.3s;
    line-height: 1.4;
}

.gallery-warning-error {
    color: #d9534f;
}

.gallery-warning-success {
    color: #4CAF50;
    font-weight: bold;
}

.gallery-controls {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.gallery-url-input {
    flex: 1;
    min-width: 200px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    max-height: 225px;
    overflow-y: auto;}

.gallery-empty-state {
    grid-column: 1 / -1;
    color: #888;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

.gallery-info {
    margin-top: 15px;
    font-size: 11px;
    line-height: 1.4;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
    aspect-ratio: 1;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover {
    border-color: #aaa;
    transform: scale(0.98);
}

.gallery-item.active {
    border-color: #4CAF50;
}

.gallery-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item-error {
    font-size: 10px;
    color: #999;
    text-align: center;
    padding: 5px;
}

.gallery-delete-btn {
    position: absolute;
    display: flex;
    top: 4px;
    right: 4px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    padding: 2px 5px 3px 5px;
    cursor: pointer;
    font-weight: bold;
    z-index: 10;
    transition: background 0.2s;
    justify-content: center;
    align-content: center;
    flex-wrap: wrap;
}

.gallery-delete-btn:hover {
    background: rgba(255, 0, 0, 1);
}

.gallery-file-input {
    display: none;
}

fieldset.gallery-custom-block {
    margin-top: 10px!important;
}