/* Speaker items */
.speaker-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    background-color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.speaker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f0f0f0;
    cursor: pointer;
}

.speaker-form {
    padding: 15px;
}

.speaker-header h4 {
    margin: 0;
    flex-grow: 1;
}

.drag-handle {
    cursor: grab;
    padding: 0 10px;
    color: #999;
    font-size: 1.2em;
    -webkit-user-select: none;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.speaker-item.dragging {
    opacity: 0.2;
    border: 2px dashed #3498db;
    transform: scale(0.98);
}

.speaker-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    min-height: 100px;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.speaker-image-preview {
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.speaker-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.speaker-image-preview .remove-image,
.speaker-image-preview .remove-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
}

.add-image-button {
    width: 100px;
    height: 100px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: #f9f9f9;
    color: #666;
}

.add-image-button:hover {
    background-color: #f0f0f0;
}

.drag-highlight {
    border: 2px dashed #3498db !important;
    background-color: rgba(52, 152, 219, 0.1) !important;
}

.speaker-image-preview.drag-highlight {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* Multi-image Grid UI refined for dialogs */
.speaker-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    padding: 15px;
    background: #fdfdfd;
    border: 1px dashed #ccc;
    border-radius: 8px;
    min-height: 110px;
    align-items: center;
}

.speaker-images-grid .speaker-image-preview {
    width: 80px;
    height: 80px;
}

.grid-image-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    padding: 0;
    background: #ff5252;
    color: white;
    border: 1px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}