/* ------------------------------------------------------
   Inputs & General Layout
------------------------------------------------------ */

#imhd_counter_badge,
#imhd_gallery {
    display: none;
}


#imhd_horse_select,
#imhd_user_desc {
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

#imhd_user_desc {
    width: 100%;
}

.imhd-avatar-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    background: #fff;
}

.imhd-avatar-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.imhd-avatar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.imhd-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.imhd-muted {
    color: #666;
    font-size: 12px;
}

.imhd-badge {
    display: inline-block;
    border: 1px solid #999;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
}

/* ------------------------------------------------------
   Alerts
------------------------------------------------------ */

.imhd-alert {
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}

.imhd-alert.error {
    background: #ffe8e8;
    border: 1px solid #f2bcbc;
}

.imhd-alert.ok {
    background: #e8fff0;
    border: 1px solid #bcefd0;
}

/* ------------------------------------------------------
   Preview Area
------------------------------------------------------ */

.imhd-avatar-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    border: 1px dashed #ccc;
    border-radius: 12px;
    overflow: hidden;
}

.imhd-avatar-preview img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Spinner */

.imhd-spinner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
}

.imhd-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid #bbb;
    border-top-color: #555;
    animation: imhd-spin 0.8s linear infinite;
}

@keyframes imhd-spin {
    to {
        transform: rotate(360deg);
    }
}

.imhd-busy .imhd-spinner-overlay {
    display: flex;
}

/* ------------------------------------------------------
   Top Note
------------------------------------------------------ */

.imhd-topnote {
    background: #fff8e1;
    border: 1px solid #f0d38a;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

/* ------------------------------------------------------
   Gallery Layout (Mobile First)
------------------------------------------------------ */

.imhd-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 18px;
    margin-top: 18px;
    align-items: start;
}

/* ------------------------------------------------------
   Thumbnail Cards
------------------------------------------------------ */

.imhd-thumb {
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    padding: 10px;
    text-align: center;
    position: relative;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.imhd-thumb img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 8px;
}

/* ------------------------------------------------------
   Featured Badge
------------------------------------------------------ */

.imhd-featured-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #4CAF50;
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    z-index: 9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ------------------------------------------------------
   Action Buttons (Set Featured / Delete)
------------------------------------------------------ */

.imhd-thumb .btns {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: nowrap;
}

.imhd-thumb .btns button {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    width: 100%;
    max-width: 110px;
    transition: background 0.2s, opacity 0.2s;
}

/* Primary: Set Featured */
.imhd-thumb .imhd_set_featured {
    background: #0073aa;
    color: #fff;
}

.imhd-thumb .imhd_set_featured:hover {
    background: #005f8a;
}

/* Danger: Delete */
.imhd-thumb .imhd_delete_avatar {
    background: #d63638;
    color: #fff;
}

.imhd-thumb .imhd_delete_avatar:hover {
    background: #b02b2d;
}