.image-block-wrapper {
    width: 100%;
    display: flex;
    padding: 0.5rem 0;
    position: relative;
}

.image-controls {
    position: absolute;
    top: -1.5rem;
    left: 9.4rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.25rem;
    background-color: rgba(31, 41, 55, 0.9);
    padding: 0.375rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: all 0.2s;
    transform: scale(0.95);
    pointer-events: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
}

.image-block-wrapper:hover .image-controls {
    opacity: 1;
    transform: scale(1) translateX(-50%);
}

.image-control-btn {
    background-color: #374151;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    padding: 0 0.5rem;
    border: 1px solid #4b5563;
    cursor: pointer;
}

.image-control-btn:hover {
    background-color: #4b5563;
}

.image-control-btn.btn-danger:hover {
    background-color: #ef4444;
    border-color: #f87171;
}

.image-container-inner {
    position: relative;
}

.image-img {
    width: 100%;
    height: auto;
    border-radius: 0.25rem;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.image-img:hover {
    border-color: #60a5fa;
}

.resize-handle {
    position: absolute;
    bottom: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    background-color: #3b82f6;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 0.125rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 20;
}

.image-container-inner:hover .resize-handle {
    opacity: 1;
}

.handle-right {
    right: 0.25rem;
    cursor: nwse-resize;
}

.handle-left {
    left: 0.25rem;
    cursor: nesw-resize;
}

/* Caption Styles */
.image-content-wrapper {
    display: flex;
    /* gap: 1rem; */
    align-items: flex-start;
    width: 100%;
}

.image-with-caption-left {
    flex-direction: row-reverse;
}

.image-with-caption-right {
    flex-direction: row;
}

.image-with-caption-bottom {
    flex-direction: column;
    align-items: center;
}

.image-with-caption-bottom .image-caption {
    margin-top: 0px !important;
    text-align: center;
}

.image-caption {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    /* border-left: 3px solid var(--accent, #3b82f6); */
    background-color: var(--bg-secondary, #f9fafb);
    border-radius: 0.375rem;
    color: var(--text-primary, #1f2937);
    font-size: 0.875rem;
    line-height: 1.5;
    outline: none;
    transition: all 0.2s;
}

.image-caption:focus {
    border-left-color: var(--accent-hover, #2563eb);
    background-color: var(--bg-tertiary, #ffffff);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.image-caption:empty:not(.caption-editing)::before {
    content: "Adicione uma legenda...";
    color: var(--text-secondary, #9ca3af);
    font-style: italic;
}

.image-with-caption-bottom .image-caption {
    width: 100%;
    margin-top: 0.5rem;
}

.image-with-caption-left .image-caption,
.image-with-caption-right .image-caption {
    /* max-width: 300px; */
    align-self: center;
}