.cpw-popup-overlay {
    display: flex; /* Initially hidden */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.cpw-popup {
    /* position: relative; */
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 400px;
    margin: 0 auto;
    overflow-y: auto;
    height: auto;
    max-height: 80vh;
}
#cpw_promo_widget_form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cpw-popup h2 {
    margin-top: 0;
    font-size: 18px;
}

.cpw-popup input,
.cpw-popup textarea {
    width: 100%;
    margin: 10px 0;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.cpw-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}
.cpw-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.cpw-popup-title {
    font-size: 18px;
    font-weight: bold;
    color: #23282d;
    margin: 0;
}
.cpw-widget-image-preview img{
    background-color: #f5f5f5;
    padding: 15px;
    max-width: 200px; 
    height: auto; 
    display: block;
}
/* frontend styles */
.pei_promo_widget_container {
    float: left;
    margin-right: 48px;
    margin-bottom: 48px;
    margin-top: 8px;
    border-top: 2px solid #006400;
    border-bottom: 2px solid #006400;
    padding: 20px;
    text-align: left;
    height: max-content;
    padding: 30px;
    width: 324px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: "Avenir Next LT W01 Medium", Arial, sans-serif;
  
}
.pei_promo_widget_date, .pei_promo_widget_content, .pei_promo_widget_link, .pei_promo_widget_optional_footer {
    padding-top: 16px;

}
 
.pei_promo_widget_header, .pei_promo_widget_date, .pei_promo_widget_content, .pei_promo_widget_optional_footer {
    color: #111111;
}
.pei_promo_widget_header {
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 27px;
    letter-spacing: 0px;
}
.pei_promo_widget_image {
    text-align: left;
    width: 100%;
    padding-top: 24px;
}
.pei_promo_widget_date {
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
    line-height: 18px;
    letter-spacing: -0.12px;
}
.pei_promo_widget_content {
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: 0px;
}
#pei_promo_widget_link{
    text-decoration: underline !important;
}
.pei_promo_widget_container .pei_promo_widget_link {
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 21px;
    letter-spacing: -0.14px;
    color: #007749 !important;
    border-bottom: 0px !important;
    text-decoration: underline !important;
}
.pei_promo_widget_container .pei_promo_widget_link_container {
    border-bottom: 1px solid #007749;
}
.pei_promo_widget_optional_footer {
    font-size: 13px;
    font-style: normal;
    font-weight: 500;
    line-height: 18px;
}
@media screen and (min-width: 540px) and (max-width: 768px) {
    .pei_promo_widget_container {
        margin-right: 0px;
        width: 100%;
        margin-top: 24px;
        margin-bottom: 24px;
    }

}
@media screen and (min-width: 376px) and (max-width: 540px) {
    .pei_promo_widget_container {
        margin: 24px 24px 24px 0px;
        width: 50%;
    }

}
@media screen and (max-width: 376px) {
    .pei_promo_widget_container {
        margin: 24px 0px 24px 0px;
        width: 100%;
    }
}

/* meta box css */

/* --- Metabox Container --- */
#cpw-widget-container {
    background: #f8f9fa;
    border: 1px solid #dcdcde;
    padding: 15px;
    border-radius: 5px;
}

/* --- Widget List --- */
#cpw-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* --- Individual Widget Box --- */
.cpw-widget-item {
    background: #ffffff;
    border: 1px solid #dcdcde;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* --- Labels --- */
.cpw-widget-item label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #555;
}

/* --- Input Fields --- */
.cpw-widget-item input[type="text"],
.cpw-widget-item input[type="url"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

/* --- Buttons --- */
.cpw-widget-item .remove-widget {
    background: #d63638;
    color: white;
    border: none;
    padding: 6px 12px;
    margin-top: 8px;
    cursor: pointer;
    border-radius: 3px;
}

.cpw-widget-item .remove-widget:hover {
    background: #b32d2e;
}

.cpw-widget-item .update-widget {
    background: #2271b1;
    color: white;
    border: none;
    padding: 6px 12px;
    margin-top: 8px;
    cursor: pointer;
    border-radius: 3px;
}

.cpw-widget-item .update-widget:hover {
    background: #135e96;
}
span.help-icon-container {
    margin-top: 10px;
    display: block;
}
.pei_promo_widget_image img {
    margin-bottom: 0px !important;
    height: auto;
}
/* --- Add New Widget Button --- */
#cpw-add-widget {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 10px;
    display: block;
}

#cpw-add-widget:hover {
    background: #005a9e;
}

.cpw-widget-item .spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url(/wp-admin/images/spinner-2x.gif);
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 10px;
    visibility: visible;
}

/* High-resolution displays */
@media print, (min-resolution: 120dpi) {
    .spinner {
        background-image: url(/wp-admin/images/spinner-2x.gif);
    }
}
