/**
 * Public-facing styles for popups and banners
 */

/* Reset and Base Styles */
.acp-campaign {
    position: fixed;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.acp-campaign.acp-active {
    opacity: 1;
    visibility: visible;
}

/* Popup Styles */
.acp-campaign.acp-popup {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.acp-campaign.acp-popup .acp-text-content {
    margin-bottom: 30px;
}

.acp-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.acp-content {
    position: relative;
    max-width: 900px;
    width: 90%;
    margin: 0 auto;
    padding: 24px;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.acp-title {
    margin: 0 0 15px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.375;
    color: #000000;
}

.acp-subtitle {
    font-size: 18px;
}

.acp-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.acp-buttons.acp-align-center {
    justify-content: center;
}

.acp-buttons.acp-align-left {
    justify-content: flex-start;
}

.acp-buttons.acp-align-right {
    justify-content: flex-end;
}

.acp-button {
    display: inline-block;
    padding: 14px 24px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.acp-cta {
    background: #016600;
    color: #ffffff;
}

.acp-cta:hover {
    background: #2e614d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(221, 225, 240, 0.3);
}

.acp-cta.acp-copied {
    background-color: #EAFFE0 !important;
    color: #016600 !important;
}

.acp-secondary {
    background: transparent;
    color: #676767;
}

.acp-secondary:hover {
    opacity: 0.8;
}

/* Alignment Helper Classes */
.acp-align-left {
    text-align: left;
}

.acp-align-center {
    text-align: center;
}

.acp-align-center > .acp-title {
    margin-left: auto;
    margin-right: auto;
}

.acp-align-right {
    text-align: right;
}

.acp-coupon {
    margin-top: 20px;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

/* Coupon Badge (inline in subtitle via %coupon%) */
.acp-coupon-badge {
    font-weight: 700;
    color: #016600;
}

/* Banner Top Styles */
.acp-campaign.acp-banner-top .acp-text-content,
.acp-campaign.acp-banner-bottom .acp-text-content {
    flex: 1;
}

.acp-campaign.acp-banner-top .acp-title,
.acp-campaign.acp-banner-bottom .acp-title {
    margin: 0;
    font-size: 16px;
    display: inline;
}

.acp-campaign.acp-banner-top .acp-subtitle,
.acp-campaign.acp-banner-bottom .acp-subtitle {
    display: inline;
}

.acp-campaign.acp-banner-top .acp-buttons {
    justify-content: flex-end;
}

.acp-campaign.acp-popup .acp-button {
    padding: 17px 24px;
    font-size: 20px;
}

.acp-campaign.acp-popup .acp-subtitle {
    margin: 0 0 30px;
}

/* Banner Bottom Styles */
.acp-campaign.acp-banner-top {
    top: 0;
}

.acp-campaign.acp-banner-bottom {
    bottom: 0;
}

.acp-campaign.acp-banner-top,
.acp-campaign.acp-banner-bottom {
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    padding: 14px;
    background: #FDFDFD;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0px 12px 16px -4px rgba(10, 13, 18, 0.08), 0px 4px 6px -2px rgba(10, 13, 18, 0.03), 0px 2px 2px -1px rgba(10, 13, 18, 0.04);
    border-radius: 24px;
}

.acp-campaign.acp-banner-top .acp-content,
.acp-campaign.acp-banner-bottom .acp-content {
    background: #ffffff;
    max-width: 1200px;
    width: 100%;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Floating Styles */
.acp-campaign.acp-floating {
    bottom: 20px;
    right: 20px;
    width: 400px;
    max-width: calc(100% - 40px);
}

.acp-campaign.acp-floating .acp-title {
    font-size: 16px;
}

.acp-campaign.acp-floating .acp-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    background: #ffffff;
    justify-content: space-between;
}

.acp-campaign.acp-floating .acp-buttons {
    justify-content: center;
    width: 100%;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .acp-subtitle {
        font-size: 16px;
    }

    .acp-campaign.acp-popup .acp-content {
        text-align: center;
        background: #ffffff !important;
    }

    .acp-campaign.acp-floating .acp-text-content {
        max-width: 100% !important;
    }

    .acp-campaign.acp-floating .acp-content,
    .acp-campaign.acp-banner-top .acp-content,
    .acp-campaign.acp-banner-bottom .acp-content {
        /*flex-direction: column;*/
        flex-wrap: wrap;
    }

    .acp-campaign.acp-banner-top .acp-text-content,
    .acp-campaign.acp-banner-bottom .acp-text-content {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .acp-campaign.acp-banner-top .acp-buttons,
    .acp-campaign.acp-banner-bottom .acp-buttons {
        justify-content: center;
        width: 100%;
    }

    .acp-campaign.acp-floating {
        width: auto;
    }
}

@media (min-width: 768px) {
    .acp-campaign.acp-popup .acp-content {
        padding: 40px;
    }

    .acp-campaign.acp-banner-bottom .acp-media img {
        position: absolute;
        left: 50%;
        bottom: -35px;
        transform: translate(-50%, 0);
    }

    .acp-campaign.acp-banner-top .acp-media img {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 767px) {
    .acp-campaign.acp-popup .acp-title,
    .acp-campaign.acp-popup .acp-text-content {
        max-width: 100% !important;
        text-align: center;
    }

    .acp-title,
    .acp-text {
        color: #000000 !important;
    }

    .acp-campaign.acp-popup .acp-buttons {
        justify-content: center;
    }

    .acp-coupon-badge {
        color: #016600 !important;
    }

    .acp-button.acp-secondary {
        color: #676767 !important;
    }
}

/* Animation Classes */
@keyframes acpFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes acpSlideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes acpSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.acp-campaign.acp-popup.acp-active .acp-content {
    animation: acpFadeIn 0.3s ease;
}

.acp-campaign.acp-banner-top.acp-active {
    animation: acpSlideDown 0.3s ease;
}

.acp-campaign.acp-banner-bottom.acp-active {
    animation: acpSlideUp 0.3s ease;
}

.acp-campaign.acp-floating.acp-active {
    animation: acpFadeIn 0.3s ease;
}

/* ============================================
   Design Enhancements v1.8.8
   ============================================ */

.acp-text {
    font-size: 18px;
    color: #000000;
}

.acp-button-secondary {
    transition: all 0.3s ease;
    padding: 10px 20px;
}

.acp-button-secondary.acp-no-border {
    border: none !important;
    background: transparent !important;
    text-decoration: underline;
}

.acp-button-secondary.acp-no-border:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Copy Code Success Animation */
.acp-button-primary.acp-copied {
    background-color: #10b981 !important;
    animation: acpPulse 0.5s ease;
    position: relative;
}

@keyframes acpPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Copy button loading state */
.acp-button-primary.acp-copying {
    opacity: 0.7;
    cursor: wait;
}

/* Hide old coupon button if still in template */
.acp-coupon,
.acp-coupon-wrapper {
    display: none !important;
}

/* Ensure copy button has pointer cursor */
.acp-button-primary[data-action="copy_code"] {
    cursor: pointer;
}

/* Accessibility improvements */
.acp-button-primary:focus,
.acp-button-secondary:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Copy success checkmark animation */
.acp-button-primary.acp-copied::after {
    content: " ✓";
    display: inline-block;
    animation: acpCheckmark 0.3s ease;
}

@keyframes acpCheckmark {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}