/* Main Root Wrapper - High Specificity */
body .lifeezi-ap-root {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 0 !important;
    height: 0 !important;
    z-index: 9999999 !important;
    pointer-events: none !important; /* Allow clicks to pass through to the site */
}

body .lifeezi-ap-root.ap-active {
    width: 100% !important;
    height: 100% !important;
}

/* Glassmorphism Overlay */
body .lifeezi-ap-root .lifeezi-ap-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(14, 26, 22, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    z-index: 9999999 !important;
    display: none; /* Controlled by script for safe toggle */
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-sizing: border-box !important;
    visibility: hidden;
    pointer-events: none;
    will-change: opacity;
}

body .lifeezi-ap-root .lifeezi-ap-overlay.ap-active {
    display: flex !important;
}

body .lifeezi-ap-root .lifeezi-ap-overlay.ap-visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Modal Container - Aggressive Fix */
body .lifeezi-ap-root .lifeezi-ap-modal {
    background: #ffffff !important;
    background-image: 
        radial-gradient(at 0% 0%, rgba(22, 160, 133, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(46, 204, 113, 0.05) 0px, transparent 50%) !important;
    width: 100% !important;
    max-width: 700px !important;
    border-radius: 32px !important;
    overflow: hidden !important;
    position: relative !important;
    box-shadow: 0 45px 110px rgba(0, 0, 0, 0.6) !important;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 100 !important;
    will-change: transform;
    max-height: 95vh !important; /* Cap height for mobile */
    pointer-events: auto !important; /* Re-enable clicks ONLY on the modal itself */
}

body .lifeezi-ap-root .ap-visible .lifeezi-ap-modal {
    transform: scale(1) translateY(0) !important;
}

/* Premium Banner - Deep Contrast for Logo Visibility */
body .lifeezi-ap-root .lifeezi-ap-banner {
    width: 100% !important;
    height: 120px !important;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%) !important; /* Deep Royal Blue to Bright Blue */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    border-bottom: 5px solid rgba(255, 255, 255, 0.1) !important;
}

body .lifeezi-ap-root .lifeezi-ap-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 36px !important;
    height: 36px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 200 !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    backdrop-filter: blur(8px);
}

body .lifeezi-ap-root .lifeezi-ap-logo-wrapper {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body .lifeezi-ap-root .lifeezi-ap-logo-img {
    max-width: 250px !important;
    max-height: 100px !important;
    object-fit: contain !important;
}

body .lifeezi-ap-root .lifeezi-ap-logo-placeholder {
    font-size: 42px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    letter-spacing: -2px !important;
}

/* Content Area - All Centered */
body .lifeezi-ap-root .lifeezi-ap-content {
    padding: 25px 30px !important;
    background: #ffffff !important;
    text-align: center !important;
    overflow-y: auto !important; /* Enable scrolling for tall content on small screens */
    flex: 1 !important;
}

body .lifeezi-ap-root .lifeezi-ap-title {
    color: #0d9488 !important; /* Deep Teal */
    font-size: 32px !important;
    font-weight: 800 !important;
    margin: 0 0 2px 0 !important;
    font-family: 'Outfit', sans-serif !important;
    letter-spacing: 0.5px !important;
}

body .lifeezi-ap-root .lifeezi-ap-subtitle {
    color: #f97316 !important; /* Vibrant Orange Subtitle */
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 4px !important;
    font-weight: 700 !important;
    margin-bottom: 20px !important;
    font-family: 'Outfit', sans-serif !important;
}

body .lifeezi-ap-root .lifeezi-ap-story-intro {
    font-size: 15px !important;
    color: #475569 !important;
    line-height: 1.6 !important;
    margin-bottom: 25px !important;
    max-width: 500px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    font-family: 'Outfit', sans-serif !important;
}

/* Stats Grid - Emoji Free & Balanced */
body .lifeezi-ap-root .lifeezi-ap-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px !important;
    margin-bottom: 30px !important;
}

body .lifeezi-ap-root .lifeezi-ap-stat-card {
    padding: 22px 15px !important;
    border-radius: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

/* Bright, High-Energy Colors with Neon Glows */
body .lifeezi-ap-root .lifeezi-ap-stat-card:nth-child(1) { 
    background: #f0fdf4 !important; 
    border: 2.5px solid #10b981 !important; 
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.15) !important;
}
body .lifeezi-ap-root .lifeezi-ap-stat-card:nth-child(2) { 
    background: #eff6ff !important; 
    border: 2.5px solid #3b82f6 !important; 
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.15) !important;
}
body .lifeezi-ap-root .lifeezi-ap-stat-card:nth-child(3) { 
    background: #fff7ed !important; 
    border: 2.5px solid #f97316 !important; 
    box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.15) !important;
}

body .lifeezi-ap-root .lifeezi-ap-stat-card:hover {
    transform: translateY(-8px) scale(1.05) !important;
    box-shadow: 0 25px 30px -10px rgba(0, 0, 0, 0.15) !important;
}

body .lifeezi-ap-root .lifeezi-ap-stat-card:nth-child(1) .lifeezi-ap-stat-value { color: #059669 !important; }
body .lifeezi-ap-root .lifeezi-ap-stat-card:nth-child(2) .lifeezi-ap-stat-value { color: #2563eb !important; }
body .lifeezi-ap-root .lifeezi-ap-stat-card:nth-child(3) .lifeezi-ap-stat-value { color: #ea580c !important; }

body .lifeezi-ap-root .lifeezi-ap-stat-value {
    font-size: 32px !important;
    font-weight: 900 !important;
    color: #16a085 !important;
    line-height: 1 !important;
    margin-bottom: 8px !important;
    font-family: 'Outfit', sans-serif !important;
    letter-spacing: -1px !important;
}

body .lifeezi-ap-root .lifeezi-ap-stat-label {
    font-size: 11px !important;
    color: #94a3b8 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    font-family: 'Outfit', sans-serif !important;
}

/* Future Chapter - Centered */
body .lifeezi-ap-root .lifeezi-ap-future-chapter {
    margin-bottom: 30px !important;
    padding: 0 20px !important;
}

body .lifeezi-ap-root .lifeezi-ap-future-chapter p {
    font-size: 15px !important;
    color: #475569 !important;
    margin-bottom: 12px !important;
    font-family: 'Outfit', sans-serif !important;
}

body .lifeezi-ap-root .lifeezi-ap-service-highlight {
    background: #16a085 !important;
    color: #ffffff !important;
    padding: 12px 25px !important;
    border-radius: 100px !important;
    display: inline-block !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    letter-spacing: 1.5px !important;
    box-shadow: 0 8px 20px rgba(22, 160, 133, 0.15) !important;
    font-family: 'Outfit', sans-serif !important;
}

/* Timeline Footer - Centered */
body .lifeezi-ap-root .lifeezi-ap-story-footer {
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 25px !important;
    margin-bottom: 25px !important;
}

body .lifeezi-ap-root .lifeezi-ap-timeline-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 20px !important;
    margin-bottom: 15px !important;
}

body .lifeezi-ap-root .lifeezi-ap-progress-line {
    width: 240px !important;
    height: 8px !important;
    background: #f1f5f9 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    position: relative !important;
}

body .lifeezi-ap-root .lifeezi-ap-progress-fill {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: 0% !important;
    background: linear-gradient(90deg, #16a085, #2ecc71) !important;
    transition: width 2s cubic-bezier(0.65, 0, 0.35, 1) !important;
}

body .lifeezi-ap-root .ap-visible .lifeezi-ap-progress-fill {
    width: 100% !important;
}

body .lifeezi-ap-root .lifeezi-ap-growing-text {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 6px !important;
    font-family: 'Outfit', sans-serif !important;
}

body .lifeezi-ap-root .lifeezi-ap-thanks-msg {
    font-size: 14px !important;
    color: #16a085 !important;
    font-weight: 500 !important;
    margin: 0 !important;
    font-family: 'Outfit', sans-serif !important;
}

/* Celebrate Button - High-Energy Orange Gradient */
body .lifeezi-ap-root .ap-celebrate-btn {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    color: white !important;
    border: none !important;
    padding: 18px 60px !important;
    border-radius: 100px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 3px !important;
    transition: all 0.3s ease !important;
    font-family: 'Outfit', sans-serif !important;
    box-shadow: 0 10px 25px rgba(234, 88, 12, 0.3) !important;
}

body .lifeezi-ap-root .ap-celebrate-btn:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
    transform: translateY(-4px) scale(1.03) !important;
    box-shadow: 0 20px 40px rgba(234, 88, 12, 0.5) !important;
}

/* Confetti Canvas */
body .lifeezi-ap-root #ap-confetti-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

/* Ultra-Compact Mobile Responsiveness (Aiming for Zero-Scroll) */
@media (max-width: 580px) {
    body .lifeezi-ap-root .lifeezi-ap-modal {
        max-width: 85% !important;
        border-radius: 20px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-banner {
        height: 60px !important;
        padding: 10px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-logo-img {
        max-height: 35px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-content {
        padding: 12px 12px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-close {
        top: 10px !important;
        right: 10px !important;
        width: 26px !important;
        height: 26px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-title {
        font-size: 18px !important;
        margin-bottom: 0 !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-subtitle {
        font-size: 9px !important;
        margin-bottom: 10px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-story-intro {
        font-size: 11px !important;
        margin-bottom: 15px !important;
        line-height: 1.4 !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        margin-bottom: 12px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-stat-card {
        padding: 6px 10px !important;
        border-radius: 10px !important;
        flex-direction: row !important; /* Horizontal stats to save height */
        justify-content: space-between !important;
        align-items: center !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-stat-value {
        font-size: 16px !important;
        margin-bottom: 0 !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-stat-label {
        font-size: 9px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-future-chapter {
        margin-bottom: 12px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-future-chapter p {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-service-highlight {
        padding: 4px 12px !important;
        font-size: 9px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-story-footer {
        padding-top: 10px !important;
        margin-bottom: 12px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-timeline-bar {
        gap: 8px !important;
        margin-bottom: 8px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-year-start, 
    body .lifeezi-ap-root .lifeezi-ap-year-end {
        font-size: 9px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-progress-line {
        width: 100px !important;
        height: 6px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-growing-text {
        font-size: 11px !important;
        margin-bottom: 2px !important;
    }
    body .lifeezi-ap-root .lifeezi-ap-thanks-msg {
        font-size: 10px !important;
    }
    body .lifeezi-ap-root .ap-celebrate-btn {
        padding: 10px 30px !important;
        font-size: 12px !important;
    }
}

/* Specific fix for very small height screens */
@media (max-height: 500px) {
    body .lifeezi-ap-root .lifeezi-ap-banner {
        display: none !important; /* Hide banner to save space on landscape phones */
    }
}
