:root{
    --background-color: #f4f4f4;
    --black-color: #000;
    --white-color: #fff;
    --overlay-color: rgba(0,0,0,0.6);
    --note-color: #666;
    --gray-color: #ccc;
    --green-color: #46b450;
    --purple-color: #5a2cff;
    --more-purple-color: #4a1fe0;
}

/* Css code for the Pop up plugin */
.if-popup-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.if-popup {
    max-width: 500px;
    width: 90%;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    position: relative;
}
.if-popup-image img {
    max-width: 100%;
    height: auto;
    display: block;
}
.if-popup-title {
    margin-top: 0;
    margin-bottom: 10px;
}
.if-popup-text p:last-child {
    margin-bottom: 0;
}
.if-popup-btn {
    display: inline-block;
    padding: 10px 18px;
    margin-top: 15px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
}
.if-popup-close {
    width: 30px;
    height: 30px;
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--white-color);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    z-index: 4;
}
.if-popup-close span{
    width: 18px;
    height: 2px;
    position: absolute;
    background-color: var(--black-color);
}
.if-popup-close span:nth-child(1) {
    transform: rotate(45deg);
}
.if-popup-close span:nth-child(2) {
    transform: rotate(-45deg);
}

.if-popup-template_1 .if-popup-content{
    padding-top: 20px;
}
.if-popup-template_1 .background-filter, .if-popup-template_3 .background-filter{display: none;}

.if-popup-template_2 .background-filter{
    width: 96%;
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 10px;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0), rgb(0, 0, 0, 0.4));
    z-index: 1;
}
.if-popup-template_1 .if-popup-image img{
    width: 100%;
    aspect-ratio: 500/400;
    object-fit: cover;
}
.if-popup-template_2 .if-popup-image img, .if-popup-template_3 .if-popup-image img{
    width: 100%;
    aspect-ratio: 500/600;
    object-fit: cover;
}
.if-popup-template_2 .if-popup-content{
    width: 96%;
    position: absolute;
    bottom: 10px;
    padding: 30px;
    z-index: 3;
}

.if-popup-field {
    margin-bottom: 15px;
}
.if-popup-label {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}
.if-popup-image-preview img {
    max-width: 200px;
    height: auto;
    display: block;
    margin-bottom: 8px;
}
.if-popup-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.if-popup-col-half {
    flex: 1 1 45%;
    min-width: 250px;
}
.if-popup-note {
    font-size: 12px;
    color: var(--note-color);
}

.column-if_popup_status { width: 120px; text-align: center; }

.if-popup-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}
.if-popup-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.if-popup-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--gray-color);
    transition: .2s;
    border-radius: 34px;
}
.if-popup-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    top: 3px;
    background-color: var(--white-color);
    transition: .2s;
    border-radius: 50%;
}
.if-popup-switch input:checked + .if-popup-slider {
    background-color: var(--green-color);
}
.if-popup-switch input:checked + .if-popup-slider:before {
    transform: translateX(18px);
}

/* Code for the wizard */
.if-popup-wizard {
    max-width: 100%;
}
.if-popup-header {
    background: var(--purple-color);
    color: #fff;
    padding: 24px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}
.if-popup-header-title {
    font-size: 24px;
}
.if-popup-header-links a {
    color: var(--white-color);
    text-decoration: none;
    font-size: 13px;
}
.if-popup-header-links a:hover {
    text-decoration: underline;
}
.if-popup-body {
    padding: 32px;
}
.if-popup-body h1 {
    margin-top: 0;
    text-align: center;
    color: var(--purple-color);
    font-size: 24px;
    font-weight: 700;
}

.if-tpl-label{
    text-align: center;
    padding-bottom: 20px;
}
.if-tpl-label p{
    font-size: 16px;
    line-height: 24px;
    font-weight: 700;
    margin: 0px!important;
}
.if-popup-body p.description {
    text-align: center;
    color: var(--note-color);
    margin-bottom: 32px;
    font-size: 13px;
}
.if-popup-templates {
    max-width: 900px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 24px;
}

.if-popup-template-form {
    margin: 0;
}

.if-popup-template-card {
    width: 100%;
    border: 2px solid #e0e0e6;
    border-radius: 12px;
    padding: 10px;
    background: #fafafa;
    cursor: pointer;
    text-align: left;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    display: block;
}
.if-popup-template-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: var(--purple-color);
}

.if-popup-template-card .if-tpl-label {
    text-align: center;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.if-popup-template-preview {
    background: #f2f2f4;
    border-radius: 10px;
    padding: 20px;
    position: relative;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.if-popup-template-preview span {
    font-size: 32px;
    opacity: 0.7;
}

.if-popup-template-preview.overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.35), #f2f2f4);
}

.if-popup-template-content{
    padding-top: 15px;
}
.if-popup-template-content h3 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
}
.if-popup-template-content p {
    margin: 0 0 10px;
    font-size: 12px;
    color: #666;
}
.if-popup-template-content .button-primary {
    background: var(--purple-color);
    border-color: var(--purple-color);
    font-size: 12px;
    padding: 0 16px;
    height: 28px!important;
    min-height: 28px!important;
    line-height: 26px;
}
.if-popup-template-content .button-primary:hover {
    background: var(--more-purple-color);
    border-color: var(--more-purple-color);
}

.if-popup-template-form.template02 .if-popup-template-card{
    position: relative;
}
.if-popup-template-form.template02 .if-popup-template-preview{
    min-height: 256px;
}
.if-popup-template-form.template02 .if-popup-template-content{
    width: 85%;
    position: absolute;
    bottom: 10px;
    padding: 15px;
}

/* IF Popup Editor Wrapper */
#wpbody, #wpwrap{
    background-color: var(--white-color)!important;
}

#wpcontent{
    padding-right: 20px!important;
}

.if-popup-editor-wrapper{
    width: 100%;
    position: relative;
}

.if-popup-editor-nav-buttons{
    width: 100%;
    position: relative;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.if-popup-editor-save button{
    width: 111px;
    height: 40px;
    background-color: var(--purple-color)!important;
    color: var(--white-color)!important;
    border-radius: 24px!important;
    font-size: 12px!important;
    font-weight: 700!important;
    cursor: pointer;
    transition: 0.2s ease;
}

.if-popup-editor-save button:hover{
    opacity: 0.7;
    transition: 0.2s ease;
}

.if-popup-editor-tabs{
    display: flex;
    gap: 10px;
    justify-content: start;
}

.if-popup-editor-tabs .if-tab{
    width: 111px;
    height: 40px;
    background-color: var(--background-color);
    color: var(--black-color);
    border: 1px solid #efefef;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.if-popup-editor-tabs .if-tab.active{
    background-color: var(--white-color);
    color: var(--purple-color);
}

.if-popup-editor-body{
    position: relative;
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 50px;
    margin: 20px 0px 0px 0px;
    border-left: 1px solid #efefef;
    border-top: 1px solid #efefef;
    border-right: 1px solid #efefef;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.if-popup-editor-left{
    width: 100%;
    max-width: 600px;
    position: relative;
    padding: 20px;
}

.if-popup-image-preview{
    width: 100%;
    display: flex;
    justify-content: center;
    background: var(--background-color);
    border-radius: 8px;
    aspect-ratio: 350/200;
}

.if-popup-image-preview img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.if-popup-select-image, .if-popup-remove-image{
    width: 120px!important;
    height: 40px!important;
    background: var(--background-color) !important;
    color: var(--black-color)!important;
    font-weight: 500!important;
    border: none!important;
    border-radius: 8px!important;
    margin-top: 10px!important;
    transition: 0.2s ease;
}

.if-popup-select-image:hover, .if-popup-remove-image:hover{
    opacity: 0.7;
    transition: 0.2s ease;
}

.if-popup-field #if_popup_title,
.if-popup-field #if_popup_button_text,
.if-popup-field #if_popup_button_url{
    width: 100%;
    height: 40px!important;
    border: 1px solid #efefef!important;
}

.if-popup-field textarea{
    border: 1px solid #efefef!important;
}

.if-popup-label{
    font-size: 16px!important;
    font-weight: 500!important;
    color: var(--black-color)!important;
}

.if-popup-editor-right{
    width: 100%;
    position: relative;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.if-popup-preview-card {
    width: 90%;
    max-width: 500px;
    position: relative;
    border: 2px solid #e0e0e6;
    border-radius: 12px;
    padding: 10px;
    background: #fafafa;
    cursor: pointer;
    text-align: left;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    display: block;
}

.if-popup-preview-image{
    width: 100%;
    position: relative;
}

.if-popup-preview-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 500/400;
}

.if-popup-preview-card-template_2 .if-popup-preview-image img, .if-popup-preview-card-template_3 .if-popup-preview-image img{
    aspect-ratio: 500/600;
}

.if-popup-template-card:hover{
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: var(--purple-color);
}

.if-popup-preview-overlay{
    position: absolute;
    bottom: 0px;
    width: 100%;
    z-index: 3;
}

.if-popup-preview-overlay .if-popup-preview-content{
    padding: 10px;
}

#preview_headline{
    font-size: 16px!important;
    font-weight: 700!important;
}

.if-popup-preview-card .background-filter{
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
    background: linear-gradient(rgba(244, 244, 244, 0), #8E8E8E);
    z-index: 2;
}

.if-popup-preview-button{
    width: fit-content;
    display: flex;
    background: var(--purple-color);
    border-color: var(--purple-color);
    color: var(--white-color);
    font-size: 12px;
    padding: 0 16px;
    height: 28px!important;
    min-height: 28px!important;
    line-height: 26px;
    text-decoration: none;
}

.if-popup-preview-button:hover {
    background: var(--more-purple-color);
    border-color: var(--more-purple-color);
}

.if-popup-editor-footer{
    position: relative;
    padding: 20px 20px 20px 0px;
    display: flex;
    gap: 10px;
    justify-content: end;
    border: 1px solid #efefef;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.if-popup-editor-footer .button-primary{
    width: 100%!important;
    max-width: 110px!important;
    background: var(--purple-color)!important;
    border-color: var(--purple-color)!important;
    color: var(--white-color)!important;
    transition: 0.2s ease;
}

.if-popup-editor-footer .button{
    width: 100%!important;
    max-width: 110px!important;
    background: var(--background-color);
    border-color: var(--background-color);
    color: var(--black-color);
    transition: 0.2s ease;
}

.if-popup-editor-footer .button:hover, .if-popup-editor-footer .button-primary:hover{
    opacity: 0.7!important;
    border: none;
    transition: 0.2s ease;
}



@media (max-width: 900px) {
    .if-popup-templates {
        grid-template-columns: 1fr;
    }

    .if-popup-editor-body{
        grid-template-columns: 1fr;
    }

    .if-popup-editor-left{
        max-width: 100%;
        padding: 0px;
    }

    .if-popup-editor-right{
        padding: 20px 0px;
    }

    #if-popup-form{
        padding: 20px;
    }
}