.pmc-content-icon:before {
    content: "";
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23673AB7' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 14H7v-2h5v2zm3-4H7v-2h8v2zm0-4H7V7h8v2z'/%3E%3C/svg%3E");
    height: 28px;
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
}

/* Additional selector to ensure the icon works in the Elementor panel */
.elementor-element .pmc-content-icon.elementor-widget-icon:before,
.elementor-element-wrapper [data-widget_type="publish_my_content.default"] .elementor-widget-container:before,
.elementor-element-wrapper [data-widget_type="publish_my_content.default"] .title:before {
    content: "";
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23673AB7' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 14H7v-2h5v2zm3-4H7v-2h8v2zm0-4H7V7h8v2z'/%3E%3C/svg%3E");
    height: 16px;
    width: 16px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    margin-right: 5px;
    vertical-align: middle;
}

/* Main Dialog Styles */
#widget-generator-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    max-height: 90%;
    width: 60%;
    min-width: 300px;
    z-index: 9999999; /* Higher z-index to ensure visibility */
    overflow: auto;
}

#widget-generator-dialog .header {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

#widget-generator-dialog .header svg {
    height: 28px;
    width: 28px;
}

#widget-generator-dialog .header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #444;
}

#widget-generator-dialog textarea {
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
    border: 1px solid #ddd;
    padding: 10px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
}

#widget-generator-dialog .btn-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-generate-container {
    display: flex;
    justify-content: center;
    padding: 0 15px;
    width: 100%;
}

/* Button Styling */
#widget-generator-dialog .btn-container button, 
.btn-generate-container .btn-generate {
    padding: 10px 15px;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Elementor-style buttons */
.elementor-button-default {
    background-color: #fff;
    color: #555;
    border: 1px solid #ddd;
}

.elementor-button-default:hover {
    background-color: #f7f7f7;
}

.elementor-button-success {
    background-color: #673AB7;
    color: #fff;
    border: none;
}

.elementor-button-success:hover {
    background-color: #5E35B1;
}

/* Overlay */
#widget-generator-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999998; /* Just below dialog */
}

/* Spinner */
#widget-generator-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #673AB7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -25px;
    margin-left: -25px;
    z-index: 9999999;
    display: none;
}

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

/* Widget styling */
.pmc-content {
    padding: 20px;
    background-color: #f7f7f7;
    border: 1px dashed #ddd;
    text-align: center;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pmc-content:hover {
    background-color: #f0f0f0;
    color: #673AB7;
}

/* Add the following styles for the tabbed interface */

/* Tab Navigation */
.pmc-tab-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.pmc-tab-btn {
    padding: 10px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    margin-right: 5px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-weight: 500;
    color: #555;
}

.pmc-tab-btn:hover {
    background: #f0f0f0;
}

.pmc-tab-btn.active {
    background: #fff;
    color: #673AB7;
    border-bottom: 2px solid #673AB7;
    position: relative;
    bottom: -1px;
}

/* Tab Content */
.pmc-tab-content {
    position: relative;
}

.pmc-tab-pane {
    display: none;
    padding: 10px 0;
}

.pmc-tab-pane.active {
    display: block;
}

/* RTF Editor in Dialog */
#pmc-rtf-editor {
    border: 1px solid #ddd;
    min-height: 200px;
    padding: 10px;
    background: #fff;
    overflow-y: auto;
    line-height: 1.5;
    font-size: 14px;
}

#pmc-rtf-editor:focus {
    outline: none;
    border-color: #673AB7;
    box-shadow: 0 0 0 1px #673AB7;
}

#pmc-rtf-editor[placeholder]:empty:before {
    content: attr(placeholder);
    color: #999;
    font-style: italic;
}

/* RTF Toolbar within Dialog */
.pmc-rtf-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
    padding: 5px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pmc-rtf-toolbar .pmc-toolbar-btn {
    background-color: #fff;
    border: 1px solid #ddd;
    color: #333;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pmc-rtf-toolbar .pmc-toolbar-btn:hover {
    background-color: #f9f9f9;
    border-color: #bbb;
}

.pmc-rtf-toolbar .pmc-toolbar-separator {
    width: 1px;
    height: 20px;
    background-color: #ddd;
    margin: 0 2px;
} 