/* pae-frontend.css */
/* Minimal styling rules for PAE front-end rendered ads */

.pae-wrapper {
    background-color: rgb(43 57 144 / 4%);
    box-shadow: 0 0 4px 0 rgb(0 0 0 / 40%);
}

.steps-heading {
    background-color: #2b3991;
    color: #fff;
    padding: 10px 20px;
    font-weight: 400;
}

.steps-content {
    padding: 10px 20px 40px;
}

.pae-steps {
    display: flex;
    gap: 40px;
    margin-bottom: 25px;
}

.pae-step {
    position: relative;
    padding: 8px 14px;
    border-radius: 20px;
    background: #eee;
    font-size: 14px;
}

.pae-step:not(:last-child):after {
    content: '';
    width: 40px;
    height: 4px;
    position: absolute;
    top: calc(50% - 2px);
    left: 100%;
    background-color: inherit;
}

.pae-step.active {
    background: #000;
    color: #fff;
}

.pae-step.completed {
    background: #136913;
    color: #fff;
    font-weight: 600;
}

.pae-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.pae-package-card {
    position: relative;
    display: flex;
    flex-direction: column;
    text-align: center;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 0 4px 0 rgb(0 0 0 / 40%);
    border: 1px solid #f3953d;
}

.pae-package-header h3 {
    background-color: #2B3990;
    color: #fff;
    padding: 16px 10px;
    margin-bottom: 0;
    border-radius: 5px 5px 0 0;
}

.pae-package-card p {
    color: #000;
}

.pae-badge {
    background: #F7941E;
    color: #000;
    padding: 10px 10px;
    font-weight: 400;
    text-transform: uppercase;
    margin-bottom: 0;
}

.pae-price {
    font-size: 36px;
    font-weight: bold;
    margin: 25px 0;
    color: #000;
}

.package-divider-heading {
    position: relative;
    margin-bottom: 20px;
}

.package-divider-heading p {
    position: relative;
    background-color: #2B3990;
    color: #fff;
    display: inline-block;
    padding: 4px 15px;
    border-radius: 30px;
    margin: 0;
    z-index: 1;
}

.package-divider-heading:after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background-color: #2B3990;
    position: absolute;
    top: 50%;
}

.pae-views ul {
    list-style: none;
    text-align: left;
    padding: 0 10px;
}

.pae-views ul li {
    display: flex;
    font-size: 110%;
    line-height: 1.2;
    color: #000;
    margin-bottom: 10px;
}

.pae-views ul li i {
    color: #4BD444;
}

.pae-views ul li i.fa-square-xmark {
    color: red;
}

.pae-why .package-divider-heading p,
.pae-why .package-divider-heading:after {
    background-color: #000;
    color: #fff;
}

.pae-why>p {
    padding: 0 10px;
}

/* Ad Creation Previews */
.pae-preview-label {
    font-size: 14px;
    font-weight: 700;
    color: #4a5568;
    margin: 20px 0 10px;
}

.pae-preview-wrap.vertical {
    max-width: 300px;
}

.pae-preview-wrap.horizontal {
    max-width: 800px;
}

.pae-preview-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background: #edf2f7;
    color: #000;
    text-align: center;
    padding: 20px;
}

.pae-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.pae-input-hint {
    display: block;
    color: #000;
    margin-bottom: 5px;
}

.pae-select-btn {
    display: block;
    margin: 15px;
    margin-top: auto;
    text-align: center;
    background-color: #2b3991;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
}

.pae-select-btn:hover {
    background-color: #F7941E;
    color: #fff;
}

.pae-package-card.takeover {
    border: 2px solid #ff9800;
    background: #fff8ed;
}

.pae-select-btn.takeover {
    background: #ff9800;
}

.pae-selected-package {
    border: 1px solid #000;
    border-radius: 5px;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 30px;
    background-color: #fff;
}

.pae-selected-package * {
    margin: 0;
}

.pae-selected-package>div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pae-selected-package .sp-price {
    font-size: 160%;
    font-weight: 400;
}

#pae_ad_details_section {
    display: flex;
    flex-direction: column;
}

.pae-campaign-form label {
    display: block;
    margin-top: 15px;
    font-weight: 600;
}

.pae-campaign-form input,
.pae-campaign-form textarea {
    padding: 10px !important;
    margin-top: 5px;
    background-color: #fff !important;
}

.pae-campaign-form select {
    background-color: #fff;
}

.pae-preview-title {
    margin-top: 30px;
}

.pae-previews {
    margin-top: 20px;
}

.pae-preview {
    background: #fff;
    border: 1px solid #000;
    padding: 20px 20px;
    border-radius: 5px;
    box-shadow: 0 0 4px 0 #00000036;
    margin-bottom: 20px;
}

.pae-preview.horizontal {
    display: flex;
    gap: 15px;
    max-width: 800px;
}

/* Removed redundant .pae-preview-img styles as they are replaced by the unified card system */

/* Removed redundant vertical img styles */

.pae-preview button {
    margin-top: 10px;
    padding: 6px 14px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
}

.pae-pay-btn {
    display: block;
    margin: 30px auto 0;
    padding: 14px 40px;
    width: auto;
    background: #2b3991;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(43, 57, 145, 0.2);
}

.pae-pay-btn:hover {
    background: #f3953d;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(243, 149, 61, 0.3);
}

.pae-pay-btn:active {
    transform: translateY(0);
}

/* Cropper Modal Styles */
#pae-cropper-modal {
    display: none;
    backdrop-filter: blur(5px);
}

#pae-cropper-modal .cropper-view-box,
#pae-cropper-modal .cropper-face {
    border-radius: 0;
}

#pae-form-errors {
    animation: paeShake 0.4s ease-in-out;
}

@keyframes paeShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* =====================================================
   PAE Ad Slot Wrapper
   ===================================================== */
.pae-slot {
    width: 100%;
    margin: 15px 0;
}

.widget.widget_block .pae-slot {
    margin: 0;
}

/* =====================================================
   Base Ad Card (Unified Vertical Layout - Image on Top)
   ===================================================== */
.pae-ad {
    background: #ffffff;
    border: 1px solid #e1e8f0;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    contain: layout style;
    /* Performance: Isolate ad rendering from rest of page */
}

.pae-ad-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.pae-layout-horizontal .pae-ad-inner {
    flex-direction: row;
    width: 800px;
    height: 202.5px;
    /* Fixed height to match 16:9 image at 45% width (360px wide) */
    transform-origin: top left;
    /* Changed to top left for easier scaling alignment */
    transition: transform 0.2s ease-out;
}

/* Remove CSS scaling since we're using JS now */
@media (max-width: 800px) {
    .pae-ad.pae-layout-horizontal .pae-ad-inner {
        /* JS will handle this */
    }
}

.pae-ad-image {
    width: 100%;
    height: 0;
    padding-top: 56.25%;
    /* 16:9 ratio fallback for vertical */
    position: relative;
    overflow: hidden;
    background: #f7fafc;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    /* Modern aspect-ratio instead of padding-top hack */
}

.pae-layout-horizontal .pae-ad-image {
    width: 45%;
    height: 100%;
    /* Fill the fixed 202.5px height */
    padding-top: 0;
    align-self: stretch;
}

.pae-ad-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pae-ad.pae-layout-horizontal .pae-ad-content {
    width: 55%;
    height: 100%;
    padding: 30px 20px 10px;
    overflow: hidden;
    /* Prevent text spill-out in fixed height */
}

.pae-ad.pae-layout-horizontal.pae-ad-no-image .pae-ad-content {
    width: 100%;
    padding: 30px 20px 10px;
}

.pae-ad-no-image .pae-ad-content {
    padding: 30px 10px 10px;
}

.pae-ad-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
	text-align: left;
}

/* Width Constraints */
.pae-ad.pae-layout-horizontal {
    width: 100%;
    margin: 0 auto;
    border: none;
    box-shadow: none;
    background: transparent;
    overflow: hidden;
    /* Hide overflow from scaled content */
    position: relative;
}

/* Base card styling for JS scaling */
.pae-ad.pae-layout-horizontal .pae-ad-inner {
    background: #fff;
    border: 1px solid #2B3990;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 10px;
}
.cheaderads .pae-ad.pae-layout-horizontal .pae-ad-inner {
	left: 0;
}
.pae-ad.pae-layout-vertical {
    max-width: 300px;
}

.pae-ad.pae-layout-vertical .pae-ad-inner {
    min-height: 360px;
}

/* =====================================================
   Typography & Elements
   ===================================================== */
.pae-ad-title {
    margin: 0 0 5px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.2;
}

.pae-ad-desc {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.5;
}

.pae-ad-sponsored {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 10px;
    font-weight: 700;
    background-color: #f3953d;
    color: #fff;
    padding: 0px 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    pointer-events: none;
}

.pae-layout-vertical .pae-ad-sponsored {
    display: none;
}

/* Hide description if empty is handled by PHP, but this is a safety */
.pae-ad-desc:empty {
    display: none;
}

.pae-ad-btn {
    display: inline-block;
    padding: 7.5px 15px;
    background: #2b3991;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(43, 57, 145, 0.2);
    align-self: flex-start;
    border: 1px solid #f3953e;
    text-align: center;
    margin-top: auto;
}

.pae-ad.pae-layout-vertical .pae-ad-btn {
    width: 100%;
    text-align: center;
}

.pae-ad-btn:hover {
    background: #f7941e;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(247, 148, 30, 0.3);
}

/* Takeover Enhancements */
.pae-takeover .pae-ad {
    border: 2px solid #2b3991;
    background: linear-gradient(to bottom right, #ffffff, #f0f4ff);
}

.pae-takeover .pae-ad-title {
    font-size: 1.4rem;
    color: #101e5a;
}

.pae-ad-type-selection input[type="radio"] {
    transform: translateY(-30%);
}