/* ============================================
   AI Card Post CTA Popup — Frontend Styles v3
   Senior UI/UX Optimized | RTL | 25px Radius
   Black · White · Grayscale Only
   ============================================ */

/* ── Base RTL & Reset ── */
.aicpp-cta,
.aicpp-google-cta,
.aicpp-popup,
.aicpp-popup__inner,
.aicpp-cta-product__inner,
.aicpp-cta-post__inner,
.aicpp-cta-special__inner {
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
}

/* ── Typography Scale ── */
.aicpp-cta__title,
.aicpp-popup__title,
.aicpp-google-cta__text {
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.aicpp-cta__summary,
.aicpp-cta__body {
    text-align: justify;
    text-align-last: right;
    text-justify: inter-word;
    hyphens: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ── Shared Button (Inline, Left Arrow) ── */
.aicpp-cta__button,
.aicpp-popup__button,
.aicpp-google-cta__button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.3rem;
    border-radius: 25px;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none !important;
    cursor: pointer;
    width: auto;
    white-space: nowrap;
    border: 1.5px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Arrow container: all arrows point LEFT */
.aicpp-cta__arrow {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.aicpp-cta__arrow svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.5;
}

/* Hover: arrow shifts LEFT (toward the tip direction) */
.aicpp-cta__button:hover .aicpp-cta__arrow,
.aicpp-popup__button:hover .aicpp-cta__arrow,
.aicpp-google-cta__button:hover .aicpp-cta__arrow {
    transform: translateX(-4px);
}

/* ── Label / Meta (No Background, Minimal) ── */
.aicpp-cta__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: right;
}

.aicpp-cta__badge-icon svg {
    width: 17px;
    height: 17px;
    stroke-width: 2;
}

/* ── CTA Grid ── */
.aicpp-cta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

@media (min-width: 768px) {
    .aicpp-cta-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* ═══════════════════════════════════════════
   PRODUCT CTA — Dark Premium Card
   Background: #0a0a0a  →  Text: white/light
   ═══════════════════════════════════════════ */
.aicpp-cta-product {
    background: #0a0a0a;
    border-radius: 25px;
    padding: 1.7rem;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.08),
        0 8px 24px rgba(0,0,0,0.12);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    position: relative;
    overflow: hidden;
}

.aicpp-cta-product::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, rgba(255,255,255,0.15) 50%, transparent 90%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.aicpp-cta-product:hover {
    transform: translateY(-4px);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.08),
        0 16px 40px rgba(0,0,0,0.18);
}

.aicpp-cta-product:hover::after {
    opacity: 1;
}

.aicpp-cta-product__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.aicpp-cta-product .aicpp-cta__meta {
    color: rgba(255,255,255,0.5);
}

.aicpp-cta-product .aicpp-cta__badge-icon svg {
    stroke: rgba(255,255,255,0.6);
}

.aicpp-cta-product .aicpp-cta__title {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0.2rem 0 0.6rem;
    text-align: right;
}

.aicpp-cta-product .aicpp-cta__summary {
    color: rgba(255,255,255,0.6);
    font-size: 0.87rem;
    line-height: 1.8;
    margin: 0 0 1.1rem;
    text-align: justify;
    text-align-last: right;
}

.aicpp-cta-product .aicpp-cta__button {
    background: #fff;
    color: #0a0a0a !important;
    border-color: #fff;
    align-self: flex-start;
}

.aicpp-cta-product .aicpp-cta__button:hover {
    background: #e8e8e8;
    border-color: #e8e8e8;
    box-shadow: 0 4px 14px rgba(255,255,255,0.12);
}

.aicpp-cta-product .aicpp-cta__arrow svg {
    stroke: #0a0a0a;
}

/* ═══════════════════════════════════════════
   POST CTA — Clean Light Card
   Background: #ffffff  →  Text: dark
   ═══════════════════════════════════════════ */
.aicpp-cta-post {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 25px;
    padding: 1.7rem;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.03),
        0 4px 16px rgba(0,0,0,0.04);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    position: relative;
    overflow: hidden;
}

.aicpp-cta-post::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, #000 50%, transparent 90%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.aicpp-cta-post:hover {
    transform: translateY(-4px);
    border-color: #ddd;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.03),
        0 10px 32px rgba(0,0,0,0.07);
}

.aicpp-cta-post:hover::after {
    opacity: 0.1;
}

.aicpp-cta-post__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.aicpp-cta-post .aicpp-cta__meta {
    color: #999;
}

.aicpp-cta-post .aicpp-cta__badge-icon svg {
    stroke: #999;
}

.aicpp-cta-post .aicpp-cta__title {
    color: #111;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0.2rem 0 0.6rem;
    text-align: right;
}

.aicpp-cta-post .aicpp-cta__summary {
    color: #555;
    font-size: 0.87rem;
    line-height: 1.8;
    margin: 0 0 1.1rem;
    text-align: justify;
    text-align-last: right;
}

.aicpp-cta-post .aicpp-cta__button {
    background: #000;
    color: #fff !important;
    border-color: #000;
    align-self: flex-start;
}

.aicpp-cta-post .aicpp-cta__button:hover {
    background: #222;
    border-color: #222;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.aicpp-cta-post .aicpp-cta__arrow svg {
    stroke: #fff;
}

/* ═══════════════════════════════════════════
   SPECIAL CTA — Ultra Premium
   Background: #000000  →  Text: white
   ═══════════════════════════════════════════ */
.aicpp-cta-special {
    position: relative;
    background: #000;
    color: #fff;
    border-radius: 25px;
    padding: 2px;
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.14);
}

.aicpp-cta-special__inner {
    position: relative;
    z-index: 2;
    background: #000;
    border-radius: 23px;
    padding: 1.9rem;
}

.aicpp-cta-special__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.aicpp-cta-special .aicpp-cta__label--special {
    color: rgba(255,255,255,0.65);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-align: right;
}

.aicpp-cta-special .aicpp-cta__icon svg {
    stroke: rgba(255,255,255,0.8);
    width: 24px;
    height: 24px;
}

.aicpp-cta-special .aicpp-cta__title {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.45;
    margin: 0.5rem 0 0.7rem;
    letter-spacing: -0.02em;
    text-align: right;
}

.aicpp-cta-special .aicpp-cta__body {
    color: rgba(255,255,255,0.55);
    font-size: 0.92rem;
    line-height: 1.85;
    margin: 0 0 1.3rem;
    text-align: justify;
    text-align-last: right;
}

.aicpp-cta-special .aicpp-cta__button {
    background: #fff;
    color: #000 !important;
    border-color: #fff;
    padding: 0.65rem 1.4rem;
    font-size: 0.9rem;
}

.aicpp-cta-special .aicpp-cta__button:hover {
    background: #e8e8e8;
    border-color: #e8e8e8;
    box-shadow: 0 6px 20px rgba(255,255,255,0.14);
}

.aicpp-cta-special .aicpp-cta__arrow svg {
    stroke: #000;
}

/* Animated Border */
.aicpp-cta-special--animated .aicpp-cta-special__border {
    position: absolute;
    inset: 0;
    border-radius: 25px;
    background: conic-gradient(from 0deg, #fff, #555, #fff, #555, #fff);
    animation: aicpp-border-rotate 6s linear infinite;
    z-index: 1;
}

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

/* ═══════════════════════════════════════════
   GOOGLE CTA
   Background: #f5f5f5  →  Text: dark
   ═══════════════════════════════════════════ */
.aicpp-google-cta {
    background: linear-gradient(145deg, #f8f8f8 0%, #ececec 100%);
    border: 1.5px solid #e0e0e0;
    border-radius: 25px;
    padding: 1.6rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.aicpp-google-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.07);
}

.aicpp-google-cta__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: right;
}

@media (min-width: 768px) {
    .aicpp-google-cta__inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.aicpp-google-cta__content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-align: right;
}

.aicpp-google-cta__icon svg {
    width: 28px;
    height: 28px;
    stroke: #333;
    stroke-width: 2;
    flex-shrink: 0;
}

.aicpp-google-cta__text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.5;
    text-align: right;
}

.aicpp-google-cta__button {
    background: #000;
    color: #fff !important;
    border-color: #000;
    padding: 0.65rem 1.4rem;
    font-size: 0.9rem;
}

.aicpp-google-cta__button:hover {
    background: #222;
    border-color: #222;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.aicpp-google-cta__button .aicpp-cta__arrow svg {
    stroke: #fff;
}

/* Google visibility */
.aicpp-google-cta--hide-mobile { display: none; }
@media (min-width: 768px) {
    .aicpp-google-cta--hide-mobile { display: block; }
    .aicpp-google-cta--hide-desktop { display: none !important; }
}

/* ═══════════════════════════════════════════
   POPUP
   Background overlay + white card
   ═══════════════════════════════════════════ */
.aicpp-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.45s ease;
}

.aicpp-popup.is-visible {
    opacity: 1;
    visibility: visible;
}

.aicpp-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.aicpp-popup__container {
    position: relative;
    z-index: 2;
    width: calc(100% - 2rem);
    max-width: 380px;
    margin: 0 1rem;
    transform: translateY(36px) scale(0.95);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.aicpp-popup.is-visible .aicpp-popup__container {
    transform: translateY(0) scale(1);
}

.aicpp-popup__inner {
    background: #fff;
    border-radius: 25px;
    padding: 1.6rem;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    text-align: right;
    overflow: hidden;
}

.aicpp-popup__label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #000;
    color: #fff;
    padding: 0.35rem 0.9rem;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
    text-align: right;
}

.aicpp-popup__label-icon svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
    stroke-width: 2;
}

.aicpp-popup__image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #f2f2f2;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03);
}

.aicpp-popup__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.aicpp-popup__inner:hover .aicpp-popup__image {
    transform: scale(1.04);
}

.aicpp-popup__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 1rem;
    line-height: 1.5;
    text-align: right;
}

.aicpp-popup__button {
    width: 100%;
    justify-content: center;
    background: #000;
    color: #fff !important;
    border-color: #000;
    padding: 0.8rem 1.5rem;
    font-size: 0.92rem;
}

.aicpp-popup__button:hover {
    background: #222;
    border-color: #222;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.aicpp-popup__button .aicpp-cta__arrow svg {
    stroke: #fff;
}

/* Mobile popup position */
@media (max-width: 767px) {
    .aicpp-popup {
        align-items: flex-start;
        padding-top: 3.5rem;
    }
    .aicpp-popup__container {
        max-width: 330px;
    }
}

/* ═══════════════════════════════════════════
   Responsive Utilities
   ═══════════════════════════════════════════ */
@media (max-width: 767px) {
    .aicpp-cta-product,
    .aicpp-cta-post {
        padding: 1.4rem;
    }
    .aicpp-cta-special__inner {
        padding: 1.5rem;
    }
    .aicpp-cta__title,
    .aicpp-popup__title {
        font-size: 1.05rem;
    }
    .aicpp-cta-special .aicpp-cta__title {
        font-size: 1.2rem;
    }
    .aicpp-cta__summary,
    .aicpp-cta__body {
        font-size: 0.82rem;
        line-height: 1.75;
    }
    .aicpp-google-cta__text {
        font-size: 0.95rem;
    }
}
