/*
 * ToolboxBundle — clean-room re-implementation (Round 2).
 * Spec: 01-specs/ToolboxBundle/api-surface-ui.md §3.
 *
 * Public CSS class names form the contract; rule bodies are
 * re-authored.  Selector inventory in §3.1 of the spec.
 */

/* Edit-button bar inserted by area.js / areablock.js. */
.toolbox-element-edit-button {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 200;
    padding: 4px 8px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
}

.toolbox-element-edit-button::before {
    content: attr(data-title);
    display: block;
    font-weight: bold;
    font-size: 10px;
    color: #444;
    margin-bottom: 2px;
}

.toolbox-element-edit-button a {
    color: #1976d2;
    text-decoration: none;
    cursor: pointer;
}

.toolbox-element-edit-button.not-configurable a,
.toolbox-element-edit-button.no-interaction {
    pointer-events: none;
    opacity: 0.5;
}

.editable-blocked {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.editable-blocked .pimcore_area_buttons,
.editable-blocked .toolbox-element-edit-button a {
    display: none;
}

.toolbox-initialized {
    /* set by parseEditable() to prevent re-init; no own styling */
}

.toolbox-modal-open {
    overflow: hidden;
}

.grid-adjuster-active {
    z-index: 250;
}

.toolbox-inline-editable-panel {
    border: 1px dashed #bbb;
    padding: 8px;
    margin: 4px 0;
}

/* Frontend brick wrappers (target hooks for theme stylesheets). */
.toolbox-element,
.toolbox-headline,
.toolbox-anchor,
.toolbox-columns,
.toolbox-columns .toolbox-column,
.toolbox-container,
.toolbox-slide-columns,
.toolbox-slide-columns .slide-columns,
.toolbox-slide-columns .slide-column,
.toolbox-slide-columns .column,
.toolbox-slide-columns .count,
.toolbox-iframe,
.toolbox-iframe .no-iframe-selected,
.toolbox-image,
.toolbox-teaser,
.toolbox-spacer,
.toolbox-parallax-container,
.toolbox-parallax-container .parallax-content,
.toolbox-google-map,
.toolbox-snippet,
.toolbox-video,
.toolbox-gallery,
.toolbox-download,
.toolbox-linklist,
.toolbox-separator,
.toolbox-content,
.toolbox-content.wysiwyg.content-container {
    position: relative;
}

.toolbox-google-map[data-type="googlemap"][data-fetch-error]::before {
    content: attr(data-fetch-error);
    display: block;
    padding: 8px;
    background: #fdecea;
    color: #b71c1c;
    margin-bottom: 4px;
}

/* Column adjuster icon (admin shell button). */
.toolbox_column_adjuster {
    background-image: url('/bundles/toolbox/images/admin/grid.svg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 16px 16px;
}

/* Grid preview rendered inside the columnadjuster editor window. */
.grid-preview {
    display: block;
    border: 1px solid #ddd;
    padding: 4px;
    background: #fafafa;
    font-size: 11px;
}

.grid-pre-row {
    display: flex;
    flex-wrap: nowrap;
    margin-bottom: 2px;
    min-height: 20px;
}

.grid-pre-element {
    box-sizing: border-box;
    padding: 2px 4px;
    margin: 0 1px;
    background: #cfd8dc;
    border: 1px solid #90a4ae;
    text-align: center;
}

.grid-pre-element.inherited {
    background: #eceff1;
    color: #607d8b;
}

.grid-pre-element.is-offset {
    background: transparent;
    border-style: dashed;
}

/* 12-column scale (BS3/BS4 default). */
.pre-col-1  { width: 8.3333%; }
.pre-col-2  { width: 16.6666%; }
.pre-col-3  { width: 25%; }
.pre-col-4  { width: 33.3333%; }
.pre-col-5  { width: 41.6666%; }
.pre-col-6  { width: 50%; }
.pre-col-7  { width: 58.3333%; }
.pre-col-8  { width: 66.6666%; }
.pre-col-9  { width: 75%; }
.pre-col-10 { width: 83.3333%; }
.pre-col-11 { width: 91.6666%; }
.pre-col-12 { width: 100%; }

/* Inline alert helpers (used by Twig templates and JS-injected DOM). */
.tb-alert-info {
    padding: 8px 12px;
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #90caf9;
    margin: 4px 0;
}

.tb-alert-danger {
    padding: 8px 12px;
    background: #fdecea;
    color: #b71c1c;
    border: 1px solid #f5b5b0;
    margin: 4px 0;
}

/* Headless inline config DOM. */
.toolbox-headless {
    display: block;
}

.toolbox-headless .toolbox-inline-editable-panel {
    border: 1px solid #cfd8dc;
    background: #fafafa;
}

.toolbox-headless .inline-config-area {
    display: block;
    margin: 8px 0;
}

.toolbox-headless .inline-config-node {
    padding: 6px 8px;
    border-left: 3px solid #1976d2;
    background: #fff;
    margin-bottom: 4px;
}

.toolbox-headless .inline-config-label {
    font-weight: bold;
    margin-bottom: 2px;
}

.toolbox-headless .inline-config-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.toolbox-headless .inline-config-description {
    color: #555;
    font-size: 11px;
}

.toolbox-headless .toolbox-container {
    display: block;
    margin: 8px 0;
}

.toolbox-headless .toolbox-columns .toolbox-column {
    display: block;
    margin: 4px 0;
}

/* Pimcore-internal selector tweaks the bundle extends. */
.pimcore_iframe_mask {
    z-index: 199;
    background: transparent;
}

.pimcore_area_dialog,
.pimcore_area_entry,
.pimcore_area_buttons,
.pimcore_area_buttons.top,
.pimcore_area_buttons .pimcore_area_buttons_inner,
.pimcore_area_buttons .pimcore_block_label,
.pimcore_area_edit_button,
.pimcore_tag_area .pimcore_area_edit_button,
.pimcore_block_button_dialog,
.pimcore_block_dialog,
.pimcore_block_label,
.pimcore_block_entry,
.pimcore_block_button_plus,
.pimcore_editable_select,
.pimcore_editable_input,
.pimcore_editable_video_empty,
.pimcore_editable_block,
.pimcore_droptarget_input,
.pimcore_edit_link_button {
    position: relative;
}

.googlemap_edit_locations_button {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 200;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #1976d2;
    color: #fff !important;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.googlemap_edit_locations_button::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: url('/bundles/pimcoreadmin/img/flat-white-icons/marker.svg') no-repeat center / contain;
    flex-shrink: 0;
}

.googlemap_edit_locations_button:hover {
    background: #1565c0;
    color: #fff !important;
}

/* Snippet teaser standalone-edit preview body. */
body > .single-teaser {
    margin: 16px;
    max-width: 600px;
}

body > .single-teaser img {
    max-width: 100%;
    height: auto;
}

.snippet-selector {
    padding: 8px 12px;
    background: #f1f8e9;
    border: 1px solid #c5e1a5;
    margin: 8px 0;
}

.snippet-selector label {
    display: inline-block;
    margin-right: 8px;
    font-weight: bold;
}
