/**
 * Background Generator - Frontend Styles
 * Version 1.0.2
 */

/* Hide customize button until background is generated */
.dlbg-hidden {
    display: none !important;
}

.dlbg-show {
    display: inline-block !important;
}

/* Disable customize button while uploads are pending */
.single_add_to_cart_button.dlbg-uploads-pending {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #ccc !important;
    border-color: #ccc !important;
    color: #666 !important;
}

/* Step Headings */
.dlbg-step-heading {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin: 15px 0;
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-left: 4px solid #4A90E2;
    border-radius: 0 6px 6px 0;
}

.dlbg-step-heading .dlbg-step-label {
    color: #4A90E2;
    font-weight: 700;
}

.dlbg-step-1 {
    margin-bottom: 15px;
}

.dlbg-step-2 {
    margin-top: 20px;
    margin-bottom: 10px;
}

.dlbg-step-3 {
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Price Label */
.dlbg-price-label {
    font-weight: 600;
    color: #333;
    font-size: 1em;
    margin-right: 5px;
}

/* Generate Background Button */
.dlbg-trigger-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.dlbg-generate-btn {
    background-color: #00bdf8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.dlbg-generate-btn:hover {
    background-color: #00a3d9;
}

.dlbg-generate-btn i {
    font-size: 1.1em;
}

/* Thumbnail Preview */
.dlbg-thumbnail-preview {
    position: relative;
    width: 80px;
    height: 80px;
}

.dlbg-thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #4A90E2;
}

.dlbg-remove-background {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #e74c3c;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background-color 0.2s;
}

.dlbg-remove-background:hover {
    background-color: #c0392b;
}

/* Modal Styles */
.dlbg-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.dlbg-modal.active {
    display: block;
}

body.dlbg-modal-open {
    overflow: hidden;
}

.dlbg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.dlbg-modal-content {
    position: relative;
    background-color: #e8e8e8;
    margin: 30px auto;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 1100px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    z-index: 1;
}

.dlbg-modal-header {
    background-color: #4A90E2;
    color: white;
    padding: 18px 25px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dlbg-modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
    font-style: italic;
}

.dlbg-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.dlbg-modal-close:hover {
    opacity: 1;
}

.dlbg-modal-body {
    padding: 25px;
}

/* Results Area */
.dlbg-results-area {
    min-height: 200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
}

.dlbg-results-area.center-placeholder {
    justify-content: center;
}

#dlbg-placeholder-text {
    color: #888;
    font-size: 1.1em;
    text-align: center;
    padding: 50px;
}

.dlbg-results-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    justify-content: center;
    align-items: flex-start;
    overflow-x: auto;
    width: 100%;
}

.dlbg-result-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dlbg-result-item img {
    max-width: 100%;
    width: 200px;
    height: 200px;
    object-fit: contain;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    transition: transform 0.2s;
}

.dlbg-result-item img:hover {
    transform: scale(1.02);
}

.dlbg-upscale-btn {
    display: block;
    margin-top: 10px;
    background-color: #4A90E2;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s;
}

.dlbg-upscale-btn:hover {
    background-color: #357abd;
}

/* Processing Indicator */
.dlbg-processing-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 12px;
}

.dlbg-loader {
    border: 5px solid #e0e0e0;
    border-top: 5px solid #4A90E2;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    animation: dlbg-spin 1s linear infinite;
}

.dlbg-processing-indicator p {
    margin-top: 15px;
    font-weight: 500;
    color: #4A90E2;
    font-size: 0.95em;
}

@keyframes dlbg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Controls Area */
.dlbg-controls-area {
    border-top: 1px solid #ccc;
    padding-top: 20px;
}

/* Prompt Container */
.dlbg-prompt-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.dlbg-prompt-container label {
    margin-bottom: 0;
    white-space: nowrap;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.dlbg-prompt-container input[type="text"] {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    background: #fff;
}

.dlbg-btn-generate {
    background-color: #5cb85c;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.dlbg-btn-generate:hover {
    background-color: #449d44;
}

.dlbg-btn-generate.dlbg-btn-disabled,
.dlbg-btn-generate:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.dlbg-btn-generate.dlbg-btn-disabled:hover,
.dlbg-btn-generate:disabled:hover {
    background-color: #999;
}

/* Prompt Help Text */
.dlbg-prompt-help {
    font-size: 0.95em;
    color: #333;
    margin-bottom: 10px;
}

.dlbg-prompt-help a {
    color: #00bdf8;
    text-decoration: none;
    font-weight: 600;
}

.dlbg-prompt-help a:hover {
    text-decoration: underline;
}

/* Examples Popup */
.dlbg-examples-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000001;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.dlbg-examples-popup.active {
    display: flex;
}

.dlbg-examples-popup-content {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.dlbg-examples-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background-color: #00bdf8;
    border-radius: 12px 12px 0 0;
}

.dlbg-examples-popup-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.2em;
}

.dlbg-examples-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.dlbg-examples-popup-close:hover {
    opacity: 1;
}

.dlbg-examples-popup-body {
    padding: 20px;
}

.dlbg-examples-popup-body > p {
    margin: 0 0 15px;
    color: #666;
    font-size: 0.95em;
}

.dlbg-examples-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dlbg-example-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dlbg-example-item:last-child {
    margin-bottom: 0;
}

.dlbg-example-item:hover {
    background-color: #e3f7fd;
    border-color: #00bdf8;
}

.dlbg-example-item i {
    color: #00bdf8;
    font-size: 1.2em;
    margin-top: 2px;
    flex-shrink: 0;
}

.dlbg-example-item span {
    color: #333;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Controls Row - Aspect ratio label above, everything else in one line below */
.dlbg-controls-row {
    margin-bottom: 15px;
}

.dlbg-section-title {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

/* Flex row for aspect buttons + style + turnstile */
.dlbg-controls-flex {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

/* Centered controls when aspect ratios are hidden */
.dlbg-controls-flex.dlbg-controls-centered {
    justify-content: center;
}

/* Hidden aspect ratio grid - remove this class to show aspect ratios again */
.dlbg-aspect-ratio-grid.dlbg-aspect-hidden {
    display: none !important;
}

/* Aspect Ratio Group */
.dlbg-aspect-ratio-group {
    flex: 0 0 auto;
}

.dlbg-aspect-ratio-grid {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
}

.dlbg-aspect-ratio-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    padding: 6px 4px;
    font-size: 0.85em;
    transition: 0.2s;
    height: 65px;
    min-width: 60px;
    line-height: 1.2;
}

.dlbg-aspect-ratio-btn span {
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
    color: #4A90E2;
}

.dlbg-aspect-ratio-btn small {
    font-size: 0.7em;
    color: #888;
    white-space: nowrap;
    margin-top: 2px;
}

.dlbg-aspect-ratio-btn:hover {
    border-color: #4A90E2;
}

.dlbg-aspect-ratio-btn.selected {
    background-color: #4A90E2;
    color: white;
    border-color: #4A90E2;
}

.dlbg-aspect-ratio-btn.selected span,
.dlbg-aspect-ratio-btn.selected small {
    color: white;
}

/* Style dropdown inline */
.dlbg-style-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dlbg-style-row label {
    margin-bottom: 0;
    font-weight: 600;
    white-space: nowrap;
    color: #333;
    font-size: 0.95em;
}

.dlbg-style-row select {
    padding: 8px 12px;
    font-size: 0.9em;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    min-width: 130px;
}

/* Turnstile Container - Compact inline */
.dlbg-turnstile-container {
    flex-shrink: 0;
}

.dlbg-turnstile-container label {
    display: none;
}

#dlbg-turnstile-widget {
    transform: scale(0.8);
    transform-origin: left center;
    margin: -10px 0;
}

/* History */
.dlbg-history-container {
    padding-top: 15px;
    border-top: 1px solid #ccc;
}

.dlbg-history-container .dlbg-section-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.dlbg-history-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 10px 0;
    min-height: 50px;
}

.dlbg-history-thumbnails img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    background-color: #fff;
    padding: 3px;
    transition: transform 0.2s, border-color 0.2s;
}

.dlbg-history-thumbnails img:hover {
    transform: scale(1.05);
    border-color: #4A90E2;
}

.dlbg-no-history {
    color: #888;
    font-style: normal;
    text-align: center;
    width: 100%;
    font-size: 0.9em;
}

/* Error */
.dlbg-error {
    color: #D8000C;
    background-color: #FFD2D2;
    border: 1px solid #D8000C;
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 6px;
}

.dlbg-error-container {
    margin-bottom: 15px;
}

/* Image Modal */
.dlbg-image-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    text-align: center;
}

.dlbg-image-modal-wrapper {
    position: relative;
    display: inline-block;
}

.dlbg-image-modal-content {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 10px #000;
}

/* Sample Watermark Overlay */
.dlbg-sample-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dlbg-sample-overlay::before {
    content: 'SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE SAMPLE';
    position: absolute;
    font-size: 48px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.4);
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.5);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3), -1px -1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 20px;
    line-height: 100px;
    transform: rotate(-30deg);
    white-space: normal;
    word-spacing: 30px;
    text-align: center;
    width: 400%;
    height: 400%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dlbg-image-modal-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.dlbg-image-modal-close:hover {
    color: #bbb;
}

/* Recommended Aspect Ratio Badge */
.dlbg-aspect-ratio-btn.recommended {
    position: relative;
    border-color: #5cb85c;
    box-shadow: 0 0 0 2px rgba(92, 184, 92, 0.3);
}

.dlbg-aspect-ratio-btn.recommended::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #5cb85c;
    color: white;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dlbg-aspect-ratio-btn.recommended.selected {
    border-color: #4A90E2;
}

.dlbg-aspect-ratio-btn.recommended.selected::after {
    background-color: #4A90E2;
}

/* Aspect Ratio Warning Modal */
.dlbg-aspect-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dlbg-aspect-warning-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.dlbg-aspect-warning-content {
    position: relative;
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    text-align: center;
    z-index: 1;
}

.dlbg-aspect-warning-icon {
    width: 60px;
    height: 60px;
    background-color: #fff3cd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.dlbg-aspect-warning-icon i {
    font-size: 28px;
    color: #856404;
}

.dlbg-aspect-warning-content h3 {
    margin: 0 0 15px;
    color: #333;
    font-size: 1.4em;
}

.dlbg-aspect-warning-content p {
    margin: 0 0 15px;
    color: #555;
    line-height: 1.6;
}

.dlbg-aspect-warning-confirm {
    font-weight: 600;
    color: #333 !important;
}

.dlbg-aspect-warning-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.dlbg-btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: background-color 0.2s;
}

.dlbg-btn-secondary:hover {
    background-color: #5a6268;
}

.dlbg-btn-warning {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: background-color 0.2s;
}

.dlbg-btn-warning:hover {
    background-color: #c82333;
}

/* Mobile Responsive Styles */
@media (max-width: 1000px) {
    .dlbg-controls-flex {
        flex-wrap: wrap;
    }

    .dlbg-aspect-ratio-grid {
        flex-wrap: wrap;
    }

    /* Keep aspect ratios hidden on tablet */
    .dlbg-aspect-ratio-grid.dlbg-aspect-hidden {
        display: none !important;
    }

    #dlbg-turnstile-widget {
        transform: scale(0.9);
        margin: 0;
    }
}

@media (max-width: 768px) {
    .dlbg-modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: calc(100vh - 20px);
    }

    .dlbg-modal-header {
        padding: 15px 20px;
    }

    .dlbg-modal-header h2 {
        font-size: 1.2em;
    }

    .dlbg-modal-body {
        padding: 15px;
    }

    .dlbg-prompt-container {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .dlbg-prompt-container label {
        white-space: normal;
        text-align: left;
    }

    .dlbg-controls-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .dlbg-aspect-ratio-grid {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Keep aspect ratios hidden on mobile */
    .dlbg-aspect-ratio-grid.dlbg-aspect-hidden {
        display: none !important;
    }

    .dlbg-aspect-ratio-btn {
        height: 55px;
        min-width: 55px;
    }

    .dlbg-style-row {
        width: 100%;
    }

    .dlbg-style-row select {
        flex-grow: 1;
    }

    .dlbg-turnstile-container {
        width: 100%;
    }

    #dlbg-turnstile-widget {
        transform: scale(1);
        margin: 0;
    }

    .dlbg-results-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .dlbg-result-item img {
        width: 220px;
        height: 220px;
    }

    .dlbg-history-thumbnails img {
        width: 60px;
        height: 60px;
    }

    .dlbg-image-modal {
        padding-top: 20px;
    }

    .dlbg-image-modal-content {
        max-width: 95%;
        max-height: 85vh;
    }

    .dlbg-image-modal-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }

    #dlbg-placeholder-text {
        font-size: 1em;
        padding: 30px 15px;
    }

    .dlbg-trigger-container {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Mobile warning modal */
    .dlbg-aspect-warning-content {
        padding: 20px;
        max-width: 320px;
    }

    .dlbg-aspect-warning-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .dlbg-btn-secondary,
    .dlbg-btn-warning {
        width: 100%;
    }
}

/* =====================================================
   BLOCKS EDITOR STYLES
   ===================================================== */

.dlbg-blocks-editor {
    margin: 20px 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.dlbg-blocks-loading {
    text-align: center;
    padding: 40px 20px;
}

.dlbg-blocks-loading p {
    margin-top: 15px;
    color: #666;
}

/* Error state with retry button */
.dlbg-blocks-error {
    text-align: center;
    padding: 30px 20px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    margin: 20px 0;
}

.dlbg-blocks-error p {
    margin: 0 0 10px 0;
    color: #c53030;
}

.dlbg-blocks-error p:first-child {
    font-size: 1.1em;
    font-weight: 500;
}

.dlbg-blocks-error p:first-child i {
    margin-right: 8px;
}

.dlbg-blocks-error .dlbg-retry-blocks-btn {
    margin-top: 15px;
}

.dlbg-blocks-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.dlbg-blocks-instructions {
    background: #f0f7ff;
    border: 1px solid #c5ddf5;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 5px;
}

.dlbg-blocks-instructions p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.6;
    color: #2c5282;
}

.dlbg-blocks-instructions strong,
.dlbg-blocks-instructions b {
    font-weight: 700 !important;
    font-style: normal;
}

.dlbg-blocks-section {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: none;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dlbg-blocks-section-title {
    margin: 0;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4A90E2 0%, #5BA0F2 100%);
    color: #fff;
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dlbg-blocks-section-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.dlbg-blocks-section-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: #f9f9f9;
}

/* Individual block item */
.dlbg-block-item {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #ddd;
}

.dlbg-block-item-label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
    font-size: 0.95em;
}

/* Image block hint text */
.dlbg-block-image-hint {
    margin: 0 0 8px 0;
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

/* Text block input */
.dlbg-block-text-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    line-height: 1.5;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dlbg-block-text-input:focus {
    outline: none;
    border-color: #3a5a40;
    box-shadow: 0 0 0 2px rgba(58, 90, 64, 0.1);
}

.dlbg-block-text-input.dlbg-block-modified {
    border-color: #3a5a40;
    background-color: #f8fdf8;
}

/* Image block upload */
.dlbg-block-image-upload {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dlbg-block-image-preview {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
}

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

.dlbg-block-image-preview.has-image {
    border-style: solid;
    border-color: #3a5a40;
}

.dlbg-block-image-placeholder {
    color: #999;
    font-size: 24px;
}

.dlbg-block-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #00bdf8;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.dlbg-block-upload-btn:hover {
    background: #00a3d9;
}

.dlbg-block-upload-btn i {
    font-size: 1em;
}

.dlbg-block-upload-info {
    flex: 1;
}

.dlbg-block-upload-instructions {
    display: block;
    font-size: 0.8em;
    color: #888;
    margin-top: 5px;
}

/* Block Image Upload Modal */
.dlbg-block-image-modal-content {
    max-width: 600px;
}

.dlbg-block-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.dlbg-block-upload-area:hover,
.dlbg-block-upload-area.drag-over {
    border-color: #00bdf8;
    background: #f0f9ff;
}

.dlbg-block-upload-prompt i {
    font-size: 48px;
    color: #999;
    margin-bottom: 15px;
    display: block;
}

.dlbg-block-upload-prompt p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 1em;
}

.dlbg-block-upload-prompt .dlbg-upload-instructions {
    color: #888;
    font-size: 0.85em;
}

.dlbg-block-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.dlbg-block-upload-area {
    position: relative;
}

/* No photo needed option in upload area */
.dlbg-block-no-photo-option {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    position: relative;
    z-index: 10;
}

.dlbg-block-upload-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    position: relative;
    z-index: 10;
}

.dlbg-block-upload-buttons .dlbg-btn {
    letter-spacing: normal;
}

.dlbg-or-divider {
    display: block;
    text-align: center;
    color: #888;
    font-size: 0.9em;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#dlbg-block-no-photo-btn {
    display: block;
    margin: 0 auto;
}

/* No photo needed checkbox */
.dlbg-no-photo-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    cursor: pointer;
    font-size: 0.85em;
    color: #666;
}

.dlbg-no-photo-label:hover {
    color: #333;
}

.dlbg-no-photo-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* No photo preview state */
.dlbg-block-image-preview.no-photo {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dlbg-no-photo-text {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 0.85em;
}

.dlbg-no-photo-text i {
    color: #999;
}

/* Disabled upload button */
.dlbg-block-upload-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dlbg-block-upload-btn.disabled:hover {
    background: #00bdf8;
}

.dlbg-block-processing {
    text-align: center;
    padding: 40px 20px;
    width: 100%;
    box-sizing: border-box;
}

.dlbg-block-processing .dlbg-loader {
    margin: 0 auto;
}

.dlbg-block-processing p {
    margin-top: 15px;
    color: #666;
}

/* Face selection grid */
.dlbg-block-faces-area {
    padding: 20px;
}

.dlbg-block-faces-instruction {
    margin: 0 0 15px 0;
    color: #666;
    text-align: center;
}

.dlbg-block-faces-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.dlbg-block-face-option {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.dlbg-block-face-option:hover {
    border-color: #00bdf8;
    transform: scale(1.05);
}

.dlbg-block-face-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#dlbg-block-use-full-image {
    display: block;
    margin: 0 auto;
}

/* Preview/crop area */
.dlbg-block-preview-area {
    padding: 15px;
}

.dlbg-crop-instructions {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 0 0 10px 0;
    padding: 0;
}

.dlbg-block-crop-viewport {
    width: 450px;
    height: 450px;
    max-width: 100%;
    margin: 0 auto 15px;
    overflow: hidden;
}

/* Cropper.js container styling */
.dlbg-block-crop-viewport .cropper-container {
    max-width: 100% !important;
    max-height: 100% !important;
}

.dlbg-block-crop-viewport img {
    max-width: 100%;
    display: block;
}

.dlbg-block-crop-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Zoom Control */
.dlbg-block-zoom-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.dlbg-block-zoom-control label {
    color: #666;
    font-size: 1em;
    cursor: pointer;
}

.dlbg-zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: normal;
}

/* Reset letter-spacing on all buttons in the crop actions */
.dlbg-block-crop-actions .dlbg-btn {
    letter-spacing: normal;
}

.dlbg-zoom-btn:hover {
    background: #4A90E2;
    border-color: #4A90E2;
    color: #fff;
}

.dlbg-zoom-btn:active {
    transform: scale(0.95);
}

.dlbg-zoom-slider {
    width: 200px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.dlbg-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #00bdf8;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.dlbg-zoom-slider::-webkit-slider-thumb:hover {
    background: #00a3d9;
}

.dlbg-zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #00bdf8;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.dlbg-zoom-slider::-moz-range-thumb:hover {
    background: #00a3d9;
}

/* Buttons */
.dlbg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: background-color 0.2s;
}

.dlbg-btn-primary {
    background: #00bdf8;
    color: #fff;
}

.dlbg-btn-primary:hover {
    background: #00a3d9;
}

.dlbg-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.dlbg-btn-secondary:hover {
    background: #e0e0e0;
}

/* Responsive styles for blocks editor */
@media (max-width: 768px) {
    .dlbg-blocks-section {
        padding: 15px;
    }

    .dlbg-block-image-upload {
        flex-direction: column;
        align-items: flex-start;
    }

    .dlbg-block-image-preview {
        width: 100%;
        height: 150px;
    }

    .dlbg-block-upload-btn {
        width: 100%;
        justify-content: center;
    }

    .dlbg-block-crop-actions {
        flex-direction: column;
    }

    .dlbg-block-crop-actions .dlbg-btn {
        width: 100%;
    }

    .dlbg-block-face-option {
        width: 80px;
        height: 80px;
    }
}

/* ==========================================================================
   Attribute Tooltip Styles
   ========================================================================== */

/* Select + Tooltip Wrapper */
.dlbg-select-tooltip-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.dlbg-select-tooltip-wrapper select {
    flex: 1;
    min-width: 0;
}

/* Tooltip Icon */
.dlbg-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    color: #4A90E2;
    font-size: 1.1em;
    transition: color 0.2s ease;
}

.dlbg-tooltip-icon:hover {
    color: #2a6fc9;
}

.dlbg-tooltip-icon i {
    font-size: 1em;
}

/* Tooltip Modal */
.dlbg-tooltip-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.dlbg-tooltip-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dlbg-tooltip-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.dlbg-tooltip-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.dlbg-tooltip-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1em;
    transition: all 0.2s ease;
    z-index: 2;
}

.dlbg-tooltip-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.dlbg-tooltip-modal-body {
    padding: 25px;
}

.dlbg-tooltip-modal-body h3 {
    margin: 0 0 20px 0;
    font-size: 1.4em;
    font-weight: 600;
    color: #333;
    padding-right: 30px;
}

/* Tooltip Image */
.dlbg-tooltip-image {
    margin-bottom: 20px;
    text-align: center;
}

.dlbg-tooltip-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tooltip Text */
.dlbg-tooltip-text {
    font-size: 0.95em;
    line-height: 1.6;
    color: #444;
}

.dlbg-tooltip-text p {
    margin: 0 0 15px 0;
}

.dlbg-tooltip-text p:last-child {
    margin-bottom: 0;
}

.dlbg-tooltip-text strong {
    color: #333;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .dlbg-tooltip-modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 8px;
    }

    .dlbg-tooltip-modal-body {
        padding: 20px;
    }

    .dlbg-tooltip-modal-body h3 {
        font-size: 1.2em;
    }

    .dlbg-tooltip-text {
        font-size: 0.9em;
    }
}

/* ==========================================================================
   Browse Poems Modal Styles
   ========================================================================== */

.dlbg-poems-modal-content {
    max-width: 700px;
}

/* Search wrapper */
.dlbg-poems-search-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.dlbg-poems-search {
    width: 100%;
    padding: 12px 15px 12px 42px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: transparent;
    position: relative;
    z-index: 2;
}

.dlbg-poems-search::placeholder {
    color: #aaa;
    padding-left: 0;
}

.dlbg-poems-search:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.dlbg-poems-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.9em;
    pointer-events: none;
    z-index: 1;
}

/* Poems list container */
.dlbg-poems-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    margin-bottom: 20px;
}

/* Modal body scrolling */
.dlbg-poems-modal-content .dlbg-modal-body {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.dlbg-poems-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.dlbg-poems-loading .dlbg-loader {
    margin: 0 auto;
}

.dlbg-poems-loading p {
    margin-top: 15px;
}

/* Poem accordion item */
.dlbg-poem-accordion-item {
    border-bottom: 1px solid #eee;
}

.dlbg-poem-accordion-item:last-child {
    border-bottom: none;
}

.dlbg-poem-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    cursor: pointer;
    background: #fafafa;
    transition: background-color 0.2s;
}

.dlbg-poem-accordion-header:hover {
    background: #f0f0f0;
}

.dlbg-poem-title {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
    flex: 1;
}

.dlbg-poem-accordion-header i {
    color: #666;
    font-size: 0.8em;
    transition: transform 0.2s;
}

.dlbg-poem-accordion-item.active .dlbg-poem-accordion-header i {
    transform: rotate(180deg);
}

.dlbg-poem-accordion-content {
    display: none;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
}

.dlbg-poem-accordion-item.active .dlbg-poem-accordion-content {
    display: block;
}

.dlbg-poem-text {
    font-family: Georgia, serif;
    font-size: 0.95em;
    line-height: 1.6;
    color: #444;
    white-space: pre-line;
    margin-bottom: 15px;
}

/* No poems message */
.dlbg-no-poems {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-style: italic;
}

/* AI Poem result styling */
.dlbg-ai-poem-result {
    margin-top: 15px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 6px;
    border: 1px solid #4A90E2;
}

.dlbg-ai-poem-result h4 {
    margin: 0 0 10px 0;
    color: #4A90E2;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dlbg-poems-error {
    color: #dc2626;
    padding: 10px;
    text-align: center;
}

/* AI Search Section */
.dlbg-poems-ai-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.dlbg-poems-ai-prompt {
    margin: 0 0 12px 0;
    color: #555;
    font-size: 0.9em;
}

.dlbg-poems-ai-search {
    display: flex;
    gap: 10px;
}

.dlbg-poems-ai-query {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.dlbg-poems-ai-query:focus {
    outline: none;
    border-color: #4A90E2;
}

#dlbg-poems-ai-search-btn {
    white-space: nowrap;
}

/* AI Result */
.dlbg-poems-ai-result {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.dlbg-poems-ai-result-content {
    margin-bottom: 15px;
}

.dlbg-poems-ai-result-content h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
    color: #333;
}

#dlbg-poems-ai-result-text {
    font-family: Georgia, serif;
    font-size: 0.9em;
    line-height: 1.8;
    color: #444;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: #fafafa;
    border-radius: 4px;
}

/* AI Loading */
.dlbg-poems-ai-loading {
    text-align: center;
    padding: 20px;
    margin-top: 15px;
}

.dlbg-poems-ai-loading .dlbg-loader {
    margin: 0 auto;
    width: 30px;
    height: 30px;
    border-width: 3px;
}

.dlbg-poems-ai-loading p {
    margin-top: 10px;
    color: #666;
    font-size: 0.9em;
}

/* AI Error */
.dlbg-poems-ai-error {
    margin-top: 15px;
    padding: 12px 15px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Browse Poems Button */
.dlbg-browse-poems-btn {
    margin-top: 10px;
    margin-bottom: 15px;
}

.dlbg-browse-poems-btn i {
    font-size: 0.9em;
}

/* "I do not need this field" checkbox for text blocks */
.dlbg-clear-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.9em;
    color: #666;
    cursor: pointer;
}

.dlbg-clear-field-label:hover {
    color: #333;
}

.dlbg-clear-field-checkbox {
    margin: 0;
    cursor: pointer;
}

/* Cleared text block styling */
.dlbg-block-cleared .dlbg-block-text-input,
.dlbg-field-cleared {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    opacity: 0.7;
}

.dlbg-block-cleared .dlbg-block-header {
    opacity: 0.7;
}

.dlbg-block-cleared .dlbg-browse-poems-btn {
    pointer-events: none;
    opacity: 0.5;
}

/* Translate button (blocks editor - bottom row) */
.dlbg-block-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.dlbg-block-bottom-row .dlbg-clear-field-label {
    margin-top: 0;
}

.dlbg-translate-btn {
    background: #fff !important;
    border: 1px solid #999 !important;
    color: #666 !important;
    padding: 2px 10px !important;
    font-size: 11px !important;
    cursor: pointer;
    line-height: 1 !important;
    border-radius: 2px !important;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
    letter-spacing: 0.3px;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    text-transform: none !important;
}

.dlbg-translate-btn:hover {
    border-color: #0073aa !important;
    color: #0073aa !important;
    background: #fff !important;
}

.dlbg-block-cleared .dlbg-translate-btn {
    pointer-events: none;
    opacity: 0.5;
}

/* Translate Modal */
.dlbg-translate-disclaimer {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #6d5c00;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.82em;
    margin: 0 0 14px;
    line-height: 1.4;
}

.dlbg-translate-modal-content {
    max-width: 560px;
    width: 95%;
}

.dlbg-translate-field {
    margin-bottom: 15px;
}

.dlbg-translate-label {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
    margin-bottom: 5px;
}

.dlbg-translate-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.dlbg-translate-textarea[readonly] {
    background: #f9f9f9;
    color: #555;
}

.dlbg-translate-controls {
    margin-bottom: 12px;
}

.dlbg-translate-lang-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dlbg-translate-select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    background: #fff;
}

.dlbg-translate-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    margin-bottom: 12px;
}

.dlbg-status-info {
    background: #e8f4fd;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.dlbg-status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.dlbg-status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.dlbg-translate-actions {
    text-align: right;
    padding-top: 5px;
}

/* Background Removal Selection UI */
.dlbg-bg-removal-selection {
    padding: 20px;
}

.dlbg-bg-removal-instruction {
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.dlbg-bg-removal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.dlbg-bg-removal-option {
    border: 3px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f9f9f9;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dlbg-bg-removal-option:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.dlbg-bg-removal-option img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.dlbg-bg-removal-option.selected {
    border-color: #22c55e;
    background: #f0fdf4;
}

/* Checkered background for transparency */
.dlbg-bg-removal-option {
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #fff;
}

/* Responsive */
@media (max-width: 600px) {
    .dlbg-poems-modal-content {
        width: 95%;
    }

    .dlbg-poems-list {
        max-height: 250px;
    }

    .dlbg-poems-ai-search {
        flex-direction: column;
    }

    .dlbg-poems-ai-search .dlbg-btn {
        width: 100%;
    }
}

/* ===== MemorialPrints Layout Fix for Blocks Editor ===== */
/* Force the variation wrap to stack vertically when blocks editor is present */
.single_variation_wrap:has(.dlbg-blocks-editor),
.dlbg-blocks-enabled-product .single_variation_wrap,
body.single-product .single_variation_wrap:has(.dlbg-blocks-editor) {
    flex-direction: column !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    display: flex !important;
}

/* All direct children of single_variation_wrap should be full width */
.single_variation_wrap:has(.dlbg-blocks-editor) > *,
.dlbg-blocks-enabled-product .single_variation_wrap > * {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Blocks editor - full width */
.dlbg-blocks-enabled-product #dlbg-blocks-editor {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    order: 2 !important;
    margin: 20px 0 !important;
}

/* Step headings - full width */
.dlbg-blocks-enabled-product .dlbg-step-heading {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.dlbg-step-heading.dlbg-step-1 { order: 0 !important; }
.dlbg-step-heading.dlbg-step-2,
.dlbg-step-heading.dlbg-step-blocks { order: 1 !important; }
.dlbg-step-heading.dlbg-step-final { order: 3 !important; }

/* Price and add to cart wrapper */
.single_variation_wrap:has(.dlbg-blocks-editor) .woocommerce-variation-add-to-cart,
.single_variation_wrap:has(.dlbg-blocks-editor) .woocommerce-variation,
.dlbg-blocks-enabled-product .woocommerce-variation-add-to-cart,
.dlbg-blocks-enabled-product .woocommerce-variation {
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 4 !important;
    max-width: 100% !important;
}

/* Price display */
.single_variation_wrap:has(.dlbg-blocks-editor) .woocommerce-variation-price,
.dlbg-blocks-enabled-product .woocommerce-variation-price {
    width: 100% !important;
    text-align: center !important;
}
