/**
 * CPA Offers 3D Holographic Styling
 * Makes the CPA Build locker drawer/modal ultra-cinematic
 * 
 * @package ML_Starter
 * @version 2.0.0
 */

/*--------------------------------------------------------------
# CPA Build Container - Main Wrapper
--------------------------------------------------------------*/
#cpabuild_container,
.cpabuild-container,
#cpa_wall_container,
.cpa-wall-container {
    perspective: 1800px !important;
    transform-style: preserve-3d !important;
    position: fixed !important;
    z-index: 99999 !important;
}

/*--------------------------------------------------------------
# CPA Modal/Overlay - 3D Backdrop
--------------------------------------------------------------*/
#cpabuild_overlay,
.cpabuild-overlay,
#cpa_overlay {
    background: radial-gradient(
        circle at center,
        rgba(16, 185, 129, 0.15),
        rgba(0, 0, 0, 0.95)
    ) !important;
    backdrop-filter: blur(20px) saturate(1.5) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.5) !important;
    animation: overlay-fade-in 0.6s ease-out !important;
}

@keyframes overlay-fade-in {
    from {
        opacity: 0;
        backdrop-filter: blur(0) saturate(1);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(20px) saturate(1.5);
    }
}

/*--------------------------------------------------------------
# CPA Content Box - Holographic 3D Panel
--------------------------------------------------------------*/
#cpabuild_content,
.cpabuild-content,
#cpa_content_box,
.cpa-content-box,
.cpabuild-locker,
#cpabuild_locker {
    transform: 
        perspective(1800px)
        rotateX(10deg)
        rotateY(-6deg)
        translateZ(50px) !important;
    transform-style: preserve-3d !important;
    background: 
        linear-gradient(135deg, rgba(20, 20, 30, 0.95), rgba(10, 10, 20, 0.98)) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    border-radius: 24px !important;
    box-shadow:
        0 60px 120px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(16, 185, 129, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 100px rgba(16, 185, 129, 0.08) !important;
    animation: cpa-slide-in-3d 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    position: relative !important;
    overflow: visible !important;
}

#cpabuild_content::before,
.cpabuild-content::before,
#cpa_content_box::before {
    content: '' !important;
    position: absolute !important;
    inset: -3px !important;
    border-radius: inherit !important;
    background: conic-gradient(
        from 120deg,
        rgba(16, 185, 129, 0.0),
        rgba(16, 185, 129, 0.9),
        rgba(0, 217, 255, 0.8),
        rgba(255, 199, 35, 0.7),
        rgba(16, 185, 129, 0.0)
    ) !important;
    filter: blur(14px) !important;
    opacity: 0.8 !important;
    z-index: -1 !important;
    pointer-events: none !important;
    animation: cpa-border-spin 10s linear infinite !important;
}

#cpabuild_content::after,
.cpabuild-content::after,
#cpa_content_box::after {
    content: '' !important;
    position: absolute !important;
    top: -60% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 130% !important;
    height: 80% !important;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.2), transparent) !important;
    filter: blur(50px) !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

@keyframes cpa-slide-in-3d {
    0% {
        transform: 
            perspective(1800px)
            rotateX(20deg)
            rotateY(-15deg)
            translateZ(-100px)
            translateY(100px);
        opacity: 0;
    }
    100% {
        transform: 
            perspective(1800px)
            rotateX(10deg)
            rotateY(-6deg)
            translateZ(50px)
            translateY(0);
        opacity: 1;
    }
}

@keyframes cpa-border-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/*--------------------------------------------------------------
# CPA Header - Glowing Title
--------------------------------------------------------------*/
#cpabuild_header,
.cpabuild-header,
#cpa_header,
.cpa-header,
.cpabuild-title {
    transform: translateZ(30px) !important;
    text-shadow: 
        0 0 25px rgba(16, 185, 129, 0.9),
        0 0 50px rgba(16, 185, 129, 0.6),
        0 4px 20px rgba(0, 0, 0, 0.8) !important;
    animation: cpa-title-pulse 3.5s ease-in-out infinite !important;
    font-family: 'Orbitron', 'Inter', sans-serif !important;
    color: #10B981 !important;
}

@keyframes cpa-title-pulse {
    0%, 100% {
        text-shadow: 
            0 0 25px rgba(16, 185, 129, 0.9),
            0 0 50px rgba(16, 185, 129, 0.6),
            0 4px 20px rgba(0, 0, 0, 0.8);
    }
    50% {
        text-shadow: 
            0 0 35px rgba(16, 185, 129, 1),
            0 0 70px rgba(16, 185, 129, 0.8),
            0 0 100px rgba(0, 217, 255, 0.6),
            0 6px 25px rgba(0, 0, 0, 0.9);
    }
}

/*--------------------------------------------------------------
# CPA Offer Items - Floating Cards
--------------------------------------------------------------*/
.cpabuild-offer,
.cpa-offer,
.offer-item,
#cpabuild_offers .offer,
.cpabuild-locker-item {
    transform: translateZ(25px) !important;
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    margin: 12px 0 !important;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(16, 185, 129, 0.2) !important;
    position: relative !important;
    overflow: hidden !important;
}

.cpabuild-offer::before,
.cpa-offer::before,
.offer-item::before {
    content: '' !important;
    position: absolute !important;
    inset: -2px !important;
    border-radius: inherit !important;
    background: linear-gradient(
        135deg,
        rgba(16, 185, 129, 0.3),
        rgba(0, 217, 255, 0.2),
        transparent
    ) !important;
    opacity: 0 !important;
    transition: opacity 0.4s ease !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

.cpabuild-offer:hover,
.cpa-offer:hover,
.offer-item:hover {
    transform: translateZ(40px) scale(1.03) !important;
    border-color: rgba(16, 185, 129, 0.6) !important;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(16, 185, 129, 0.5),
        0 0 0 1px rgba(16, 185, 129, 0.4) !important;
}

.cpabuild-offer:hover::before,
.cpa-offer:hover::before,
.offer-item:hover::before {
    opacity: 1 !important;
}

/*--------------------------------------------------------------
# CPA Buttons - Neon 3D Effects
--------------------------------------------------------------*/
.cpabuild-button,
.cpa-button,
.cpabuild-btn,
.offer-button,
button[onclick*="cpa"],
button[onclick*="offer"] {
    transform: translateZ(20px) !important;
    background: linear-gradient(135deg, #10B981, #059669) !important;
    border: 1px solid rgba(16, 185, 129, 0.6) !important;
    border-radius: 12px !important;
    padding: 12px 28px !important;
    color: white !important;
    font-weight: 600 !important;
    font-family: 'Orbitron', 'Inter', sans-serif !important;
    box-shadow:
        0 0 25px rgba(16, 185, 129, 0.5),
        0 8px 30px rgba(0, 0, 0, 0.6) !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
}

.cpabuild-button::before,
.cpa-button::before,
.offer-button::before {
    content: '' !important;
    position: absolute !important;
    inset: -3px !important;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
    transform: translateX(-120%) !important;
    transition: transform 0.6s ease !important;
}

.cpabuild-button:hover,
.cpa-button:hover,
.offer-button:hover {
    transform: translateZ(35px) translateY(-3px) scale(1.06) !important;
    box-shadow:
        0 0 40px rgba(16, 185, 129, 0.8),
        0 0 70px rgba(16, 185, 129, 0.5),
        0 12px 40px rgba(0, 0, 0, 0.8) !important;
}

.cpabuild-button:hover::before,
.cpa-button:hover::before,
.offer-button:hover::before {
    transform: translateX(220%) !important;
}

.cpabuild-button:active,
.cpa-button:active,
.offer-button:active {
    transform: translateZ(28px) translateY(-1px) scale(1.02) !important;
}

/*--------------------------------------------------------------
# CPA Close Button - Holographic X
--------------------------------------------------------------*/
#cpabuild_close,
.cpabuild-close,
.cpa-close,
button.close,
.close-button {
    transform: translateZ(40px) !important;
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #EF4444 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    box-shadow:
        0 0 20px rgba(239, 68, 68, 0.4),
        0 8px 30px rgba(0, 0, 0, 0.7) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    z-index: 1000 !important;
}

#cpabuild_close:hover,
.cpabuild-close:hover,
.cpa-close:hover {
    transform: translateZ(50px) rotate(90deg) scale(1.15) !important;
    background: rgba(239, 68, 68, 0.4) !important;
    border-color: rgba(239, 68, 68, 0.8) !important;
    box-shadow:
        0 0 35px rgba(239, 68, 68, 0.7),
        0 0 60px rgba(239, 68, 68, 0.4),
        0 10px 40px rgba(0, 0, 0, 0.8) !important;
}

/*--------------------------------------------------------------
# CPA Progress/Loader - Holographic Spinner
--------------------------------------------------------------*/
.cpabuild-loader,
.cpa-loader,
.loader-spinner {
    border: 4px solid rgba(16, 185, 129, 0.2) !important;
    border-top-color: #10B981 !important;
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    animation: cpa-spinner-3d 1.2s linear infinite !important;
    box-shadow:
        0 0 30px rgba(16, 185, 129, 0.6),
        inset 0 0 20px rgba(16, 185, 129, 0.3) !important;
    transform: translateZ(30px) !important;
}

@keyframes cpa-spinner-3d {
    0% {
        transform: translateZ(30px) rotate(0deg);
    }
    100% {
        transform: translateZ(30px) rotate(360deg);
    }
}

/*--------------------------------------------------------------
# CPA Description/Text - Enhanced Readability
--------------------------------------------------------------*/
.cpabuild-description,
.cpa-description,
.offer-description {
    color: rgba(255, 255, 255, 0.85) !important;
    line-height: 1.6 !important;
    font-size: 15px !important;
    transform: translateZ(15px) !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
}

/*--------------------------------------------------------------
# CPA Footer - Subtle Glow
--------------------------------------------------------------*/
#cpabuild_footer,
.cpabuild-footer,
.cpa-footer {
    transform: translateZ(10px) !important;
    padding: 16px !important;
    border-top: 1px solid rgba(16, 185, 129, 0.2) !important;
    background: linear-gradient(180deg, transparent, rgba(16, 185, 129, 0.05)) !important;
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    text-align: center !important;
}

/*--------------------------------------------------------------
# Responsive Adjustments
--------------------------------------------------------------*/
@media (max-width: 768px) {
    #cpabuild_content,
    .cpabuild-content,
    #cpa_content_box {
        transform: 
            perspective(1800px)
            rotateX(5deg)
            rotateY(-3deg)
            translateZ(25px) !important;
    }
    
    .cpabuild-offer,
    .cpa-offer,
    .offer-item {
        transform: translateZ(15px) !important;
    }
}

/*--------------------------------------------------------------
# Accessibility - Reduced Motion
--------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
    #cpabuild_content,
    .cpabuild-content,
    #cpa_content_box,
    .cpabuild-offer,
    .cpa-offer,
    .cpabuild-button,
    #cpabuild_close {
        animation: none !important;
        transition-duration: 0.05s !important;
    }
    
    #cpabuild_content::before,
    .cpabuild-content::before {
        animation: none !important;
    }
}
