/**
 * McLean Email Popup Styles
 *
 * @package McLean_Email_Popup
 * @version 1.4.0
 */

/* CSS Variables */
:root {
    --mclean-gold: #fcb316;
    --mclean-gold-dark: #d4960f;
    --mclean-black: #000000;
    --mclean-bg-dark: #0a0a0a;
    --mclean-bg-card: #111111;
    --mclean-border: #2a2a2a;
    --mclean-text: #ffffff;
    --mclean-text-muted: #888888;
}

/* ========================================
   POPUP OVERLAY (shared)
   ======================================== */
.mclean-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.mclean-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Corner Brackets */
.mclean-corner-bracket {
    position: absolute;
    width: 25px;
    height: 25px;
    pointer-events: none;
}

.mclean-corner-bracket::before,
.mclean-corner-bracket::after {
    content: '';
    position: absolute;
    background: var(--mclean-gold);
}

.mclean-corner-bracket.tl { top: 0; left: 0; }
.mclean-corner-bracket.tl::before { width: 3px; height: 20px; top: 0; left: 0; }
.mclean-corner-bracket.tl::after { width: 20px; height: 3px; top: 0; left: 0; }

.mclean-corner-bracket.tr { top: 0; right: 0; }
.mclean-corner-bracket.tr::before { width: 3px; height: 20px; top: 0; right: 0; }
.mclean-corner-bracket.tr::after { width: 20px; height: 3px; top: 0; right: 0; }

.mclean-corner-bracket.bl { bottom: 0; left: 0; }
.mclean-corner-bracket.bl::before { width: 3px; height: 20px; bottom: 0; left: 0; }
.mclean-corner-bracket.bl::after { width: 20px; height: 3px; bottom: 0; left: 0; }

.mclean-corner-bracket.br { bottom: 0; right: 0; }
.mclean-corner-bracket.br::before { width: 3px; height: 20px; bottom: 0; right: 0; }
.mclean-corner-bracket.br::after { width: 20px; height: 3px; bottom: 0; right: 0; }

/* ========================================
   MODAL STYLE
   ======================================== */
.mclean-popup-modal {
    background: var(--mclean-bg-card);
    border: 1px solid var(--mclean-border);
    display: flex;
    max-width: 850px;
    width: 92%;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s ease;
    max-height: 90vh;
    overflow: hidden;
}

.mclean-popup-overlay.active .mclean-popup-modal {
    transform: scale(1) translateY(0);
}

.mclean-popup-image {
    width: 42%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.mclean-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mclean-popup-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 50%, var(--mclean-bg-card) 100%);
}

.mclean-popup-content {
    flex: 1;
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Close Button */
.mclean-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 2px solid var(--mclean-border);
    color: var(--mclean-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
    line-height: 1;
    padding: 0;
}

.mclean-popup-close:hover {
    border-color: var(--mclean-gold);
    color: var(--mclean-gold);
}

/* Badge */
.mclean-popup-badge {
    display: inline-block;
    background: var(--mclean-gold);
    color: var(--mclean-black);
    padding: 6px 14px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 18px;
    width: fit-content;
}

/* Headline */
.mclean-popup-headline {
    font-family: 'Bebas Neue', Impact, 'Arial Black', sans-serif;
    font-size: 2.2rem;
    line-height: 1.05;
    letter-spacing: 0.02em;
    margin: 0 0 12px 0;
    color: var(--mclean-text);
}

.mclean-popup-headline span {
    color: var(--mclean-gold);
}

/* Subheadline */
.mclean-popup-subheadline {
    color: var(--mclean-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 25px 0;
}

/* Form */
.mclean-popup-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mclean-popup-input {
    background: var(--mclean-bg-dark);
    border: 2px solid var(--mclean-border);
    padding: 15px 18px;
    color: var(--mclean-text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.mclean-popup-input::placeholder {
    color: var(--mclean-text-muted);
}

.mclean-popup-input:focus {
    outline: none;
    border-color: var(--mclean-gold);
}

.mclean-popup-submit {
    background: var(--mclean-gold);
    color: var(--mclean-black);
    border: none;
    padding: 16px 25px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.mclean-popup-submit:hover {
    background: var(--mclean-gold-dark);
}

.mclean-popup-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Disclaimer */
.mclean-popup-disclaimer {
    font-size: 0.7rem;
    color: var(--mclean-text-muted);
    margin-top: 12px;
}

/* Error/Success Messages */
.mclean-popup-message {
    padding: 12px 15px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    display: none;
}

.mclean-popup-message.error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b7a;
    display: block;
}

.mclean-popup-message.success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #5dd879;
    display: block;
}

/* Success State */
.mclean-popup-success {
    display: none;
    text-align: center;
    padding: 20px 0;
}

.mclean-popup-success.active {
    display: block;
}

.mclean-popup-success-icon {
    width: 70px;
    height: 70px;
    background: var(--mclean-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.mclean-popup-success-icon svg {
    width: 35px;
    height: 35px;
    stroke: var(--mclean-black);
    stroke-width: 3;
    fill: none;
}

.mclean-popup-success h3 {
    font-family: 'Bebas Neue', Impact, 'Arial Black', sans-serif;
    font-size: 2rem;
    margin: 0 0 10px 0;
    color: var(--mclean-text);
}

.mclean-popup-success p {
    color: var(--mclean-text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Hide form when success */
.mclean-popup-form-wrapper.hidden {
    display: none;
}

/* ========================================
   FULLSCREEN STYLE
   ======================================== */
.mclean-popup-fullscreen {
    position: fixed;
    inset: 0;
    background: var(--mclean-black);
    z-index: 999999;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.mclean-popup-fullscreen.active {
    opacity: 1;
    visibility: visible;
}

.mclean-fullscreen-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.mclean-fullscreen-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
}

.mclean-fullscreen-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.8) 100%);
}

.mclean-fullscreen-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 40px;
}

.mclean-fullscreen-box {
    max-width: 550px;
    width: 100%;
    text-align: center;
    position: relative;
    padding: 60px 50px;
    border: 1px solid rgba(252, 179, 22, 0.25);
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.mclean-fullscreen-logo {
    font-family: 'Bebas Neue', Impact, 'Arial Black', sans-serif;
    font-size: 1.8rem;
    color: var(--mclean-gold);
    letter-spacing: 0.1em;
    margin-bottom: 25px;
}

.mclean-fullscreen-offer {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(252, 179, 22, 0.1);
    border: 1px solid rgba(252, 179, 22, 0.3);
    padding: 12px 22px;
    margin-bottom: 25px;
}

.mclean-fullscreen-offer-amount {
    font-family: 'Bebas Neue', Impact, 'Arial Black', sans-serif;
    font-size: 2.2rem;
    color: var(--mclean-gold);
    line-height: 1;
}

.mclean-fullscreen-offer-text {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: left;
    line-height: 1.3;
    color: var(--mclean-text);
}

.mclean-fullscreen-headline {
    font-family: 'Bebas Neue', Impact, 'Arial Black', sans-serif;
    font-size: 2.8rem;
    line-height: 1;
    letter-spacing: 0.02em;
    margin: 0 0 15px 0;
    color: var(--mclean-text);
}

.mclean-fullscreen-headline span {
    color: var(--mclean-gold);
}

.mclean-fullscreen-subheadline {
    color: var(--mclean-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0 0 30px 0;
}

.mclean-fullscreen-form {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.mclean-fullscreen-form .mclean-popup-input {
    flex: 1;
    text-align: center;
}

.mclean-fullscreen-close {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 45px;
    height: 45px;
    background: transparent;
    border: 2px solid var(--mclean-border);
    color: var(--mclean-text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
    line-height: 1;
    padding: 0;
}

.mclean-fullscreen-close:hover {
    border-color: var(--mclean-gold);
    color: var(--mclean-gold);
}

/* ========================================
   SLIDE-IN PANEL STYLE
   ======================================== */
.mclean-popup-slide {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mclean-bg-card);
    border-top: 1px solid var(--mclean-border);
    z-index: 999999;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.mclean-popup-slide.active {
    transform: translateY(0);
}

.mclean-slide-inner {
    display: flex;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.mclean-slide-image {
    width: 300px;
    height: 220px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.mclean-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mclean-slide-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 40%, var(--mclean-bg-card) 100%);
}

.mclean-slide-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 40px;
    gap: 30px;
}

.mclean-slide-text h3 {
    font-family: 'Bebas Neue', Impact, 'Arial Black', sans-serif;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
    margin: 0 0 5px 0;
    color: var(--mclean-text);
}

.mclean-slide-text h3 span {
    color: var(--mclean-gold);
}

.mclean-slide-text p {
    color: var(--mclean-text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.mclean-slide-form {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.mclean-slide-form .mclean-popup-input {
    width: 260px;
    padding: 13px 16px;
}

.mclean-slide-form .mclean-popup-submit {
    padding: 13px 22px;
    white-space: nowrap;
}

.mclean-slide-close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 2px solid var(--mclean-border);
    color: var(--mclean-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

.mclean-slide-close:hover {
    border-color: var(--mclean-gold);
    color: var(--mclean-gold);
}

/* ========================================
   LOADING STATE
   ======================================== */
.mclean-popup-submit.loading {
    position: relative;
    color: transparent;
}

.mclean-popup-submit.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid var(--mclean-black);
    border-radius: 50%;
    border-top-color: transparent;
    animation: mclean-spin 0.8s linear infinite;
}

@keyframes mclean-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    /* Modal */
    .mclean-popup-modal {
        flex-direction: column;
        max-height: 95vh;
        overflow-y: auto;
    }

    .mclean-popup-image {
        width: 100%;
        height: 180px;
    }

    .mclean-popup-image::after {
        background: linear-gradient(180deg, transparent 50%, var(--mclean-bg-card) 100%);
    }

    .mclean-popup-content {
        padding: 30px 25px 40px;
    }

    .mclean-popup-headline {
        font-size: 1.8rem;
    }

    /* Fullscreen */
    .mclean-fullscreen-box {
        padding: 50px 30px;
        margin: 20px;
    }

    .mclean-fullscreen-headline {
        font-size: 2.2rem;
    }

    .mclean-fullscreen-form {
        flex-direction: column;
    }

    .mclean-fullscreen-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    /* Slide */
    .mclean-popup-slide {
        max-height: 90vh;
        overflow-y: auto;
    }

    .mclean-slide-inner {
        flex-direction: column;
    }

    .mclean-slide-image {
        width: 100%;
        height: 140px;
    }

    .mclean-slide-image::after {
        background: linear-gradient(180deg, transparent 50%, var(--mclean-bg-card) 100%);
    }

    .mclean-slide-content {
        flex-direction: column;
        text-align: center;
        gap: 18px;
        padding: 25px;
    }

    .mclean-slide-form {
        flex-direction: column;
        width: 100%;
    }

    .mclean-slide-form .mclean-popup-input {
        width: 100%;
    }

    .mclean-slide-close {
        position: absolute;
        top: 15px;
        right: 15px;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .mclean-popup-content {
        padding: 25px 20px 35px;
    }

    .mclean-popup-headline {
        font-size: 1.5rem;
    }

    .mclean-fullscreen-headline {
        font-size: 1.8rem;
    }

    .mclean-fullscreen-offer {
        flex-direction: column;
        gap: 5px;
        padding: 15px 20px;
    }

    .mclean-fullscreen-offer-text {
        text-align: center;
    }
}

/* ========================================
   THEME BUTTON OVERRIDE
   ----------------------------------------
   Astra/Elementor set a global button background (a muted tan gold) that beats
   the popup's own gold on the CTA and close buttons, so they render off-brand
   while the "Join the Mission" badge (a span, not a button) stays correct.
   Force the brand orange with overlay-scoped specificity + !important so the
   theme can't win. Close stays transparent (a filled box reads wrong) but takes
   the gold border/glyph so it still matches.
   ======================================== */
.mclean-popup-overlay .mclean-popup-submit,
.mclean-popup-fullscreen .mclean-popup-submit,
.mclean-popup-slide .mclean-popup-submit {
    background: var(--mclean-gold) !important;
    color: var(--mclean-black) !important;
}

.mclean-popup-overlay .mclean-popup-submit:hover,
.mclean-popup-fullscreen .mclean-popup-submit:hover,
.mclean-popup-slide .mclean-popup-submit:hover {
    background: var(--mclean-gold-dark) !important;
}

.mclean-popup-overlay .mclean-popup-close,
.mclean-popup-fullscreen .mclean-fullscreen-close,
.mclean-popup-slide .mclean-slide-close {
    background: transparent !important;
    border-color: var(--mclean-gold) !important;
    color: var(--mclean-gold) !important;
}
