/* ==========================================================================
   JOEPRO NEWSLETTER POPUP - COMPLETE STYLES
   ========================================================================== */

/* 1. MAIN CONTAINER */
#joepro-popup-container {
    position: fixed;
    z-index: 999999; /* Extra high to stay above menus */
    bottom: 20px; 
    right: 20px;  
    display: none; /* JS will change this to flex/block via .show() or removing .joepro-popup-hidden */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Logic: If NOT hidden, show it */
#joepro-popup-container:not(.joepro-popup-hidden) {
    display: flex !important;
}

/* 2. EXIT INTENT OVERLAY */
#joepro-popup-container.is-exit-intent {
    bottom: 0 !important;
    right: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    pointer-events: auto;
}

/* 3. THE CONTENT CARD */
.joepro-popup-content {
    position: relative !important;
    background: #ffffff;
    padding: 45px 30px 30px 30px; 
    border-radius: 20px; 
    width: 350px; 
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    display: block;
}

/* 4. THE CLOSE BUTTON (X) */
#joepro-close-btn {
    position: absolute !important; 
    top: 10px !important;
    right: 12px !important;
    background: none !important; 
    border: none !important;
    font-size: 30px !important; 
    line-height: 1 !important; 
    cursor: pointer; 
    color: #cccccc; 
    z-index: 1000;
    padding: 5px;
}

#joepro-close-btn:hover {
    color: #2d5a27;
}

/* 5. THE LAUNCHER ICON (Leaf Icon) */
#joepro-launcher-btn {
    width: 60px;
    height: 60px;
    background: #2d5a27;
    border: none;
    border-radius: 50%;
    display: none; 
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    /* GROW EFFECT ADDED HERE */
    transition: transform 0.2s ease-in-out, background 0.2s ease;
}

#joepro-launcher-btn:hover {
    transform: scale(1.15); /* Grows by 15% on hover */
    background: #21441d;    /* Slightly darker green on hover */
}

#joepro-launcher-btn svg {
    width: 30px;
    height: 30px;
    stroke: #ffffff;
    stroke-width: 2.5;
    transition: transform 0.2s ease;
}

#joepro-launcher-btn:hover svg {
    transform: rotate(10deg); /* Slight organic tilt on hover */
}

/* 6. STATE MANAGEMENT */

/* If HIDDEN: vanish everything */
.joepro-popup-hidden {
    display: none !important;
}

/* If MINIMIZED: hide box, show icon */
#joepro-popup-container.is-minimized .joepro-popup-content {
    display: none !important;
}
#joepro-popup-container.is-minimized #joepro-launcher-btn {
    display: flex !important;
}

/* If EXIT INTENT: hide icon, show centered box */
#joepro-popup-container.is-exit-intent #joepro-launcher-btn {
    display: none !important;
}
#joepro-popup-container.is-exit-intent .joepro-popup-content {
    display: block !important;
    margin: auto;
}

/* 7. TYPOGRAPHY & FORM */
.joepro-popup-content h3 {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
    color: #222;
}

.joepro-popup-content p {
    margin: 0 0 20px 0;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
}

.joepro-popup-content a {
    color: #e67e22;
    text-decoration: underline;
    font-weight: 600;
}

.joepro-popup-content input[type="email"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
}

.joepro-popup-content button[type="submit"] {
    background: #2d5a27;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 10px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
}

#joepro-msg {
    margin-top: 10px;
    font-size: 0.85rem;
}

/* 8. MOBILE OPTIMIZATION WITH VH UNITS */
@media screen and (max-width: 768px) {
    div#joepro-popup-container {
        /* Stays at 9% of the screen height regardless of resolution */
        bottom: 9vh !important; 
        right: 15px !important;
        left: auto !important;
        top: auto !important;
    }

    #joepro-popup-container.is-minimized {
        bottom: 9vh !important; 
    }

    .joepro-popup-content {
        width: 88vw !important;
        padding-top: 50px !important;
        border-radius: 25px !important;
    }

    #joepro-close-btn {
        top: 5px !important;
        right: 8px !important;
        font-size: 40px !important;
        padding: 15px !important;
    }

    /* Keep Exit Intent at the very bottom */
    #joepro-popup-container.is-exit-intent {
        bottom: 0 !important;
        right: 0 !important;
        width: 100vw;
        height: 100vh;
    }
}