/**
 * WB Visual Editor - Main CSS
 */

/* ===== Basic Reset ===== */
.wb-editable-area *,
.wb-modal *,
.wb-toolbar * {
    box-sizing: border-box;
}

/* ===== Top Toolbar ===== */
.wb-post-info {
    display: flex;
    flex-direction: column;
}

.wb-post-title-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

#wb-post-title {
    font-size: 16px;
    padding: 5px 0;
    border: none;
    border-bottom: 1px solid #ddd;
    width: 300px;
    margin-bottom: 0;
}

#wb-post-title:focus {
    outline: none;
    border-color: #76b82a;
}

/* Move the status toggle styles here and adjust for toolbar */
.wb-toolbar .wb-status-toggle {
    display: inline-flex;
    background: #e5e5e5;
    border-radius: 20px;
    padding: 2px;
    position: relative;
    margin: 0;
}

.wb-toolbar .wb-status-toggle input[type="radio"] {
    display: none;
}

.wb-toolbar .wb-status-toggle label {
    padding: 6px 12px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
    margin: 0;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

.wb-toolbar .wb-status-toggle input[type="radio"]:checked + label {
    color: #fff;
}

.wb-toolbar .wb-status-toggle .wb-toggle-slider {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 2px;
    background: #76b82a;
    border-radius: 18px;
    transition: all 0.3s ease;
    z-index: 1;
}

.wb-toolbar .wb-status-toggle[data-status="draft"] .wb-toggle-slider {
    right: calc(100% - 2px - var(--draft-width));
}

.wb-toolbar .wb-status-toggle[data-status="publish"] .wb-toggle-slider {
    right: 2px;
}

/* ===== Edit/Create/Delete Buttons ===== */
.wb-edit-button-wrap {
    margin: 20px 0;
    text-align: center;
}
.wb-edit-button {
    display: inline-block;
    padding: 10px 15px;
    background: #76b82a;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s ease;

    line-height: 1.5;
}
.wb-edit-button:hover {
    background: #669f24;
    color: #fff;
}
.wb-edit-button-wrap {
    margin: 20px 0;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.wb-edit-button-wrap .wb-new-button {
    background: #969696;
    margin-left: 1.5rem;
}

.wb-new-button:hover {
    background: #bcbcbc;
}

.wb-edit-button-wrap .wb-new-post-button {
    background: #969696;
    margin-left: 1.5rem;
}

.wb-new-post-button:hover {
    background: #bcbcbc;
}

.wb-featured-image-button {
    background: #3498db !important;
    margin-left: 1.5rem;
}

.wb-featured-image-button:hover {
    background: #2980b9 !important;
}

/* Dropdown Styles */
.wb-new-content-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 1.5rem;
}

.wb-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wb-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.wb-dropdown-menu.show {
    width: 110%;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wb-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.wb-dropdown-item:last-child {
    border-bottom: none;
}

.wb-dropdown-item:hover {
    background: #f8f8f8;
    color: #333;
}

.wb-dropdown-item i {
    width: 16px;
    text-align: center;
}

.wb-delete-button {
    background: #dc3545 !important;
    margin-left: 1.5rem;
}

.wb-delete-button:hover {
    background: #c82333 !important;
}

/* Status Toggle */
.wb-status-toggle {
    display: inline-flex;
    background: #e5e5e5;
    border-radius: 20px;
    padding: 2px;
    margin-right: 15px;
    position: relative;
}

.wb-status-toggle input[type="radio"] {
    display: none;
}

.wb-status-toggle label {
    padding: 8px 16px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
    margin: 0;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

.wb-status-toggle input[type="radio"]:checked + label {
    color: #fff;
}

.wb-status-toggle .wb-toggle-slider {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 2px;
    background: #76b82a;
    border-radius: 18px;
    transition: all 0.3s ease;
    z-index: 1;
}

.wb-status-toggle[data-status="draft"] .wb-toggle-slider {
    right: calc(100% - 2px - var(--draft-width));
}

.wb-status-toggle[data-status="publish"] .wb-toggle-slider {
    right: 2px;
}

.wb-status-toggle .wb-draft-label,
.wb-status-toggle .wb-publish-label {
    width: 113px !important;
}

/* ===== Editor Container ===== */
.wb-editable-area {
    position: relative;
    min-height: 300px;
    padding: 20px 0;
    border: 1px dashed #ddd;
    margin: 0 auto;
}

/* ===== Block Styles ===== */
.wb-block {
    position: relative;
    margin-bottom: 20px;
    margin-top: 2rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.wb-block:hover {
    border-color: rgba(118, 184, 42, 0.4); /* Accent color with opacity */
}

.wb-block-row {
    padding: 15px;
    margin-top: 0;
    width: 100%;
    display: block;
}

.wb-row-content {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.wb-block-column {
    padding: 0;
    min-height: 50px;
    float: left;
}

/* Column width classes */
.wb-col-1-1 { width: 100%; }
.wb-col-1-2 { width: 50%; }
.wb-col-1-3 { width: 33.33%; }
.wb-col-2-3 { width: 66.66%; }
.wb-col-1-4 { width: 25%; }
.wb-col-3-4 { width: 75%; }

.wb-block-text {
    padding: 10px;
    background-color: #fff;
}

.wb-block-image {
    padding: 5px;
    background-color: #fff;
}

.wb-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    background-color: #f5f5f5;
    color: #666;
    border: 2px dashed #ddd;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
}

.wb-image-placeholder i {
    font-size: 32px;
    margin-bottom: 10px;
    color: #999;
}

/* ===== Video Block Styles ===== */
.wb-block-video {
    padding: 5px;
    background-color: #fff;
}

.wb-video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.wb-video-container iframe,
.wb-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wb-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    background-color: #f5f5f5;
    color: #666;
    border: 2px dashed #ddd;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
}

.wb-video-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
    color: #999;
}

.wb-block-video iframe,
.wb-block-video video {
    pointer-events: none;
}

/* ===== Gallery Block Styles ===== */
.wb-block-gallery {
    padding: 5px;
    background-color: #fff;
}

.wb-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px 0;
}

.wb-gallery-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wb-gallery-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.wb-gallery-grid.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

.wb-gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
}

.wb-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wb-gallery-item img:hover {
    transform: scale(1.05);
}

.wb-gallery-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    background-color: #f5f5f5;
    color: #666;
    border: 2px dashed #ddd;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
}

.wb-gallery-placeholder i {
    font-size: 32px;
    margin-bottom: 10px;
    color: #999;
}

/* ===== Gallery Settings Styles ===== */
.wb-gallery-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    min-height: 60px;
}

.wb-gallery-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.wb-gallery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wb-remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wb-remove-image:hover {
    background: #c0392b;
}

.wb-select-gallery-images {
    margin-top: 10px;
}

/* ===== Responsive Video ===== */
@media (max-width: 768px) {
    .wb-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wb-gallery-grid.columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .wb-gallery-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.wb-block-generic {
    background-color: #f3f3f3;
    padding: 15px;
    border: 1px solid #ddd;
}

.wb-generic-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-height: 60px;
}

.wb-generic-icon {
    margin-right: 15px;
    font-size: 24px;
    color: #666;
}

.wb-generic-name {
    font-weight: bold;
    margin-right: 15px;
}

.wb-generic-attrs {
    font-size: 12px;
    font-family: monospace;
    color: #666;
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

/* ===== Block Controls ===== */
.wb-block-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #ddd;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wb-block-controls.ui-sortable-handle {
    cursor: move;
}

.wb-block:hover > .wb-block-controls {
    opacity: 1;
}

.wb-block-type {
    font-size: 12px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
}

.wb-block-actions {
    display: flex;
}

.wb-block-actions button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 14px;
    transition: color 0.2s ease;
}

.wb-block-actions button:hover {
    color: #76b82a; /* Accent color */
}

.wb-block-move, .wb-block-move > .fa-arrows {
    z-index: -1000;
}

/* ===== Add Element Buttons ===== */
.wb-add-element-btn {
    padding: 10px;
    background: rgba(118, 184, 42, 0.05);
    border: 1px dashed #ccc;
    color: #76b82a;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    margin: 10px 0;
    transition: all 0.2s ease;
}

.wb-add-element-btn:hover {
    background: rgba(118, 184, 42, 0.1);
    border-color: #76b82a;
}

/* Hidden add element buttons between elements */
.wb-add-element-btn-hidden {
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: auto;
}

.wb-add-element-btn.wb-add-element-btn-hidden:hover {
    opacity: 1;
}

.wb-block:hover + .wb-add-element-btn-hidden,
.wb-add-element-btn-hidden:hover {
    opacity: 1;
    pointer-events: auto;
}

.wb-add-column-btn {
    background: none;
    border: none;
    padding: 2px 5px;
    cursor: pointer;
    color: #666;
    font-size: 12px;
    border-radius: 2px;
    transition: all 0.2s ease;
    margin-right: 10px;
}

.wb-add-column-btn:hover {
    background: #76b82a;
    color: #fff;
}

/* ===== Toolbar ===== */
.wb-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 9999;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    height: 60px;
}

body.admin-bar .wb-toolbar {
    top: 32px;
}

.wb-toolbar-left,
.wb-toolbar-right {
    display: flex;
    align-items: center;
}

.wb-logo {
    display: flex;
    align-items: center;
    font-weight: bold;
    margin-right: 30px;
    font-size: 18px;
}

.wb-logo span {
    background-color: #76b82a;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    margin-right: 8px;
}

.wb-post-info {
    display: flex;
    flex-direction: column;
}

#wb-post-title {
    font-size: 16px;
    padding: 5px 0;
    border: none;
    border-bottom: 1px solid #ddd;
    width: 300px;
    margin-bottom: 3px;
}

#wb-post-title:focus {
    outline: none;
    border-color: #76b82a;
}

.wb-post-status {
    font-size: 12px;
    color: #666;
}

.wb-post-status.publish {
    color: #76b82a;
}

.wb-post-status.draft {
    color: #f39c12;
}

.wb-button {
    background: #f1f1f1;
    border: none;
    padding: 8px 15px;
    margin-left: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
}

.wb-button i {
    margin-right: 5px;
}

.wb-button:hover {
    background: #e5e5e5;
}

.wb-primary-button {
    background: #76b82a;
    color: #fff;
}

.wb-primary-button:hover {
    background: #669f24;
}

.wb-exit-button {
    background: #f5f5f5;
}

.wb-exit-button:hover {
    background: #e0e0e0;
}

/* ===== Modal ===== */
.wb-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.wb-modal-content {
    position: relative;
    background-color: #fff;
    margin: 80px auto;
    width: 80%;
    max-width: 700px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    animation: modal-in 0.3s ease;
}

@keyframes modal-in {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.wb-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wb-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.wb-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
}

.wb-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.wb-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Element modal styles */
.wb-element-categories {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.wb-element-category {
    padding: 10px 15px;
    cursor: pointer;
    border: none;
    background: none;
    position: relative;
    color: #666;
    font-size: 14px;
}

.wb-element-category:hover {
    color: #76b82a;
}

.wb-element-category.active {
    color: #76b82a;
    font-weight: bold;
}

.wb-element-category.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #76b82a;
}

.wb-elements-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.wb-element {
    width: calc(33.33% - 10px);
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wb-element:hover {
    border-color: #76b82a;
    background: #f5f9f0;
}

.wb-element-icon {
    font-size: 24px;
    color: #76b82a;
    margin-bottom: 8px;
}

.wb-element-label {
    font-size: 14px;
    color: #333;
}

/* Settings form styles */
.wb-settings-group {
    margin-bottom: 15px;
}

.wb-settings-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}

.wb-settings-group input[type="text"],
.wb-settings-group input[type="number"],
.wb-settings-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wb-settings-group input[type="color"] {
    padding: 0;
    width: 40px;
    height: 30px;
}

/* Button document preview in settings */
.wb-button-document-preview {
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    text-align: center;
}

.wb-button-document-name {
    font-size: 14px;
    color: #333;
}

.wb-select-button-document {
    width: 100%;
    margin-bottom: 10px;
}

/* ===== Column Layout Selector ===== */
.wb-column-layout-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.wb-layout-option {
    border: 2px solid #eee;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.wb-layout-option:hover {
    border-color: #76b82a;
    background: #f8fcf4;
}

.wb-layout-option.active {
    border-color: #76b82a;
    background: #f0f8e8;
    box-shadow: 0 2px 8px rgba(118, 184, 42, 0.2);
}

.wb-layout-preview {
    display: flex;
    gap: 3px;
    margin-bottom: 8px;
    height: 16px;
    align-items: center;
}

.wb-layout-bar {
    background: #76b82a;
    height: 100%;
    border-radius: 2px;
    transition: all 0.2s ease;
    min-width: 8px;
}

.wb-layout-option:not(.active) .wb-layout-bar {
    background: #ccc;
}

.wb-layout-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    display: block;
    text-align: center;
}

.wb-layout-option.active .wb-layout-label {
    color: #76b82a;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .wb-layout-label {
        font-size: 11px;
    }
    
    .wb-layout-preview {
        height: 14px;
    }
}

/* ===== Status Message ===== */
.wb-status-message {
    position: fixed;
    top: 70px;
    right: 20px;
    padding: 12px 20px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    display: none;
    max-width: 300px;
}

.wb-status-message.success {
    background: #76b82a;
}

.wb-status-message.error {
    background: #e74c3c;
}

/* ===== Drag and Drop Styles ===== */
.wb-drop-target {
    border: 2px dashed #76b82a !important;
    background-color: rgba(118, 184, 42, 0.05);
}

.wb-block.ui-sortable-helper {
    opacity: 0.8;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.wb-block.ui-sortable-placeholder {
    background-color: rgba(118, 184, 42, 0.1);
    border: 2px dashed #76b82a;
    visibility: visible !important;
    height: 50px;
}

.wb-column-placeholder {
    background-color: rgba(118, 184, 42, 0.15) !important;
    border: 2px dashed #76b82a !important;
    min-height: 100px !important;
    height: auto !important;
    width: 200px; /* Fixed width for better visual feedback */
    margin: 0 10px;
}

/* Ensure row content maintains flex layout during drag */
.wb-row-content.ui-sortable-sorting {
    display: flex !important;
    align-items: stretch;
}

/* Hide sidebars when in edit mode */
.wb-visual-editor-active .sidebar,
.wb-visual-editor-active #sidebar,
.wb-visual-editor-active .widget-area {
    display: none !important;
}

/* Make content area full width when in edit mode */
.wb-visual-editor-active .content-area,
.wb-visual-editor-active .site-content,
.wb-visual-editor-active #content {
    width: 100% !important;
}

.fa.fa-trash:before {
    content: "\f1f8"!important;
}

.wb-row-content {
    display: flex;
    flex-wrap: wrap;
    flex: 1;
}

.wb-add-column-container {
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.wb-block-row {
    display: flex;
    flex-direction: row;
}

/*.wb-add-column-btn {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}*/

/* Mobile Warning */
.wb-visual-editor-mobile-warning {
    display: none;
}

/* ===== Text Editor Toolbar ===== */
.wb-text-toolbar {
    position: absolute;
    top: -40px;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
    white-space: nowrap;
}

.wb-text-toolbar button {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    border-right: 1px solid #eee;
}

.wb-text-toolbar button:last-child {
    border-right: none;
}

.wb-text-toolbar button:hover {
    background: #f5f5f5;
}

.wb-text-toolbar button.active {
    color: #76b82a;
    background: rgba(118, 184, 42, 0.1);
}

.wb-link-dialog {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 101;
    width: 300px;
    display: none;
}

.wb-link-dialog input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wb-link-options {
    margin-bottom: 10px;
}

.wb-link-options label {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.wb-link-options input[type="checkbox"] {
    margin-right: 5px;
}

.wb-link-actions {
    display: flex;
    justify-content: space-between;
}

.wb-document-dialog {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 101;
    width: 300px;
    display: none;
}

.wb-document-preview {
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    text-align: center;
}

.wb-document-name {
    font-size: 14px;
    color: #333;
}

.wb-select-document {
    width: 100%;
    margin-bottom: 10px;
}

.wb-document-options {
    margin-bottom: 10px;
}

.wb-document-options label {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.wb-document-options input[type="checkbox"] {
    margin-right: 5px;
}

.wb-document-actions {
    display: flex;
    justify-content: space-between;
}

.wb-block-content {
    padding-top: 1.2rem;
}

.wb-text-align-left { text-align: left; }
.wb-text-align-center { text-align: center; }
.wb-text-align-right { text-align: right; }
.wb-text-align-justify { text-align: justify; }


@media (max-width: 1290px) and (orientation: portrait) {
    /* Hide 'add elements' buttons on mobile */
    .wb-add-column-container, .wb-add-element-btn {
        display: none!important;
    }
    /* Mobile Warning */
    .wb-visual-editor-mobile-warning {
        display: block;
        color: #969696;
    }
}

/* ===== Table Editor Styles ===== */
.wb-table-editor-container {
    margin: 20px 0;
}

.wb-table-dimensions {
    margin-bottom: 15px;
    font-weight: bold;
    color: #333;
}

.wb-table-controls {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wb-table-controls label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wb-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wb-editable-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 500px;
}

.wb-editable-table td, 
.wb-editable-table th {
    border: 1px solid #ddd;
    padding: 8px;
    position: relative;
    vertical-align: top;
    min-width: 100px;
}

.wb-editable-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.wb-cell-editor {
    min-height: 20px;
    min-width: 50px;
    outline: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.wb-cell-editor.active-cell {
    background-color: #f0f8ff;
    border: 1px dotted #76b82a;
    border-radius: 2px;
}

.wb-formatting-toolbar {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 8px;
    margin-bottom: 15px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 2px;
}

.wb-format-btn {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wb-format-btn:hover {
    background: #f0f0f0;
    color: #333;
    border-color: #76b82a;
}

.wb-format-btn:active {
    background: #76b82a;
    color: #fff;
}

.wb-separator {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 5px;
}

/* ===== Table Block Styles ===== */
.wb-block-table {
    padding: 5px;
    background-color: #fff;
}

.wb-table-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 120px;
    background-color: #f5f5f5;
    color: #666;
    border: 2px dashed #ddd;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    border-radius: 4px;
}

.wb-table-placeholder i {
    font-size: 32px;
    margin-bottom: 10px;
    color: #999;
}

.wb-table-placeholder:hover {
    border-color: #76b82a;
    background-color: rgba(118, 184, 42, 0.05);
}

/* Table display styles */
.wb-table-container {
    overflow-x: auto;
}

.wb-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.wb-table td,
.wb-table th {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

.wb-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.wb-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Responsive table */
@media (max-width: 768px) {
    .wb-table-wrapper {
        font-size: 14px;
    }
    
    .wb-editable-table td,
    .wb-editable-table th {
        min-width: 80px;
        padding: 6px;
    }
    
    .wb-formatting-toolbar {
        flex-wrap: wrap;
    }
    
    .wb-format-btn {
        font-size: 12px;
        padding: 4px 8px;
        min-width: 28px;
        height: 28px;
    }
}

/* Excerpt area */
.wb-editable-excerpt {
    position: relative;
    transition: all 0.3s ease;
    min-height: 20px;
    padding: 8px;
    border-radius: 4px;
    border: 2px solid transparent;
}

.wb-editable-excerpt:hover {
    border-color: #76b82a;
    background-color: rgba(118, 184, 42, 0.05);
}

.wb-editable-excerpt.wb-editing {
    border-color: #76b82a;
    background-color: rgba(118, 184, 42, 0.1);
    outline: none;
}

.wb-editable-excerpt:empty:before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

.wb-excerpt-label {
    position: absolute;
    top: -25px;
    left: 0;
    font-size: 12px;
    color: #76b82a;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #76b82a;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wb-editable-excerpt:hover + .wb-excerpt-label,
.wb-editable-excerpt.wb-editing + .wb-excerpt-label,
.wb-excerpt-label:hover {
    opacity: 1;
}

/* Ensure excerpt label is visible when excerpt is being edited */
.wb-editable-excerpt.wb-editing ~ .wb-excerpt-label {
    opacity: 1;
}

/* Position the label correctly if it comes before the excerpt */
.wb-excerpt-label + .wb-editable-excerpt:hover ~ .wb-excerpt-label,
.wb-excerpt-label + .wb-editable-excerpt.wb-editing ~ .wb-excerpt-label {
    opacity: 1;
}