/**
 * PMN Landing Page - Frontend Styles
 * Version: 3.2.6
 * Added: Content 95vh with Close Button in remaining 5vh, no padding gap
 */

/* CSS Variables */
:root {
    --pmn-landing-primary: #3b82f6;
    --pmn-landing-primary-hover: #2563eb;
    --pmn-landing-border: #e5e7eb;
    --pmn-landing-text: #374151;
    --pmn-landing-text-light: #6b7280;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

.pmn-landing-wrapper {
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

.pmn-landing-wrapper *,
.pmn-landing-wrapper *::before,
.pmn-landing-wrapper *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Display Modes
   ========================================================================== */

/* Container Mode */
.pmn-landing-wrapper.pmn-mode-container {
    max-width: 100%;
}

.pmn-landing-wrapper.pmn-mode-container .pmn-landing-content {
    width: 100%;
}

/* Fullwidth Mode */
.pmn-landing-wrapper.pmn-mode-fullwidth {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.pmn-landing-wrapper.pmn-mode-fullwidth .pmn-landing-content {
    width: 100%;
}

/* Custom Mode */
.pmn-landing-wrapper.pmn-mode-custom .pmn-landing-content {
    margin: 0 auto;
}

/* ==========================================================================
   Landing Content
   ========================================================================== */

.pmn-landing-content {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Content area takes 95vh when close button is enabled */
.pmn-landing-wrapper.pmn-has-close-button .pmn-landing-content {
    height: 95vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
}

.pmn-landing-iframe {
    width: 100%;
    min-height: 600px;
    height: 100%;
    border: none;
    display: block;
    overflow: visible;
    margin: 0;
    padding: 0;
}

/* Allow iframe content to scroll */
.pmn-landing-wrapper {
    overflow: visible !important;
}

/* Ensure page scrolls normally */
body.pmn-has-landing {
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */

/* Position: Bottom */
.pmn-pdf-btn.pmn-position-bottom,
.pmn-redirect-btn.pmn-position-bottom {
    display: inline-flex;
    margin-top: 15px;
    margin-right: 10px;
}

/* Position: Floating */
.pmn-pdf-btn.pmn-position-floating,
.pmn-redirect-btn.pmn-position-floating {
    position: fixed;
    bottom: 20px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pmn-pdf-btn.pmn-position-floating {
    right: 20px;
}

.pmn-redirect-btn.pmn-position-floating {
    right: 180px;
}

/* Position: Hidden */
.pmn-position-hidden {
    display: none !important;
}

/* PDF Button */
.pmn-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #dc2626;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pmn-pdf-btn:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.pmn-pdf-btn svg {
    width: 18px;
    height: 18px;
}

/* Redirect Button */
.pmn-redirect-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--pmn-landing-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pmn-redirect-btn:hover {
    background: var(--pmn-landing-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.pmn-redirect-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .pmn-pdf-btn.pmn-position-floating,
    .pmn-redirect-btn.pmn-position-floating {
        right: 15px;
        bottom: 15px;
        padding: 10px 18px;
        font-size: 14px;
    }

    .pmn-redirect-btn.pmn-position-floating {
        right: auto;
        left: 15px;
    }

    .pmn-pdf-btn,
    .pmn-redirect-btn {
        width: 100%;
        justify-content: center;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* ==========================================================================
   Close Button Feature
   ========================================================================== */

/* Landing wrapper with close button - fixed fullscreen */
.pmn-landing-wrapper.pmn-has-close-button {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--pmn-landing-z-index, 9999);
    overflow: hidden;
    background: #ffffff;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* Full width mode - ignore header completely */
.pmn-landing-wrapper.pmn-has-close-button.pmn-ignore-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Slide up animation when closing */
.pmn-landing-wrapper.pmn-has-close-button.pmn-sliding-up {
    transform: translateY(-100%);
}

/* Hidden state after animation */
.pmn-landing-wrapper.pmn-has-close-button.pmn-closed {
    display: none;
}

/* Close Button Bar - Takes remaining 5vh */
.pmn-close-button-bar {
    position: relative;
    z-index: 2147483647;
    width: 100%;
    height: 5vh;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--pmn-close-bg-color, #ffffff);
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

/* Gradient Fade Effect */
.pmn-close-gradient {
    display: none;
}

/* Close Button */
.pmn-close-landing-btn {
    position: relative;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 10px 0;
    margin: 0;
    background: var(--pmn-close-bg-color, #ffffff);
    color: var(--pmn-close-text-color, #333333);
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pmn-close-landing-btn:hover {
    filter: brightness(0.95);
}

.pmn-close-landing-btn:active {
    filter: brightness(0.9);
}

.pmn-close-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pmn-close-icon svg {
    width: 20px;
    height: 20px;
}

.pmn-close-text {
    font-size: 16px;
}

/* Body state when landing page is visible */
body.pmn-landing-visible {
    overflow: hidden;
}

/* Original content initially hidden */
.pmn-original-content {
    display: none;
}

.pmn-original-content.pmn-visible {
    display: block;
}

/* ==========================================================================
   Close Button with Close Button - Adjust other floating buttons
   ========================================================================== */

.pmn-landing-wrapper.pmn-has-close-button .pmn-pdf-btn.pmn-position-floating,
.pmn-landing-wrapper.pmn-has-close-button .pmn-redirect-btn.pmn-position-floating {
    bottom: 120px; /* Above the close button bar */
}

/* ==========================================================================
   Fullwidth Mode Enhancement with Close Button
   ========================================================================== */

.pmn-landing-wrapper.pmn-mode-fullwidth.pmn-has-close-button {
    margin-left: 0;
    width: 100vw;
}


.pmn-landing-wrapper.pmn-mode-fullwidth.pmn-has-close-button .pmn-landing-content {
    width: 100vw;
    min-height: calc(100vh - 100px); /* Reserve space for close button */
}

.pmn-landing-wrapper.pmn-mode-fullwidth.pmn-has-close-button .pmn-landing-iframe {
    width: 100%;
    min-height: calc(100vh - 100px);
}

/* ==========================================================================
   Close Button Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .pmn-close-button-bar {
        position: sticky;
        bottom: 0;
        z-index: 2147483647;
    }

    .pmn-close-gradient {
        height: 60px;
    }

    .pmn-close-landing-btn {
        z-index: 2147483647;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        padding: 15px 20px;
        font-size: 15px;
    }

    .pmn-close-icon svg {
        width: 18px;
        height: 18px;
    }

    .pmn-landing-wrapper.pmn-has-close-button .pmn-pdf-btn.pmn-position-floating,
    .pmn-landing-wrapper.pmn-has-close-button .pmn-redirect-btn.pmn-position-floating {
        bottom: 100px;
    }
}

@media (max-width: 480px) {
    .pmn-close-button-bar {
        z-index: 2147483647;
    }

    .pmn-close-gradient {
        height: 50px;
    }

    .pmn-close-landing-btn {
        z-index: 2147483647;
        padding: 14px 16px;
        font-size: 14px;
        gap: 8px;
    }

    .pmn-landing-wrapper.pmn-has-close-button .pmn-pdf-btn.pmn-position-floating,
    .pmn-landing-wrapper.pmn-has-close-button .pmn-redirect-btn.pmn-position-floating {
        bottom: 90px;
    }
}
