/**
 * Lemon Funnel Frontend Styles
 * Beautiful button styles and animations
 * Performance optimized for Bricks Builder compatibility
 */

/* ==== PERFORMANCE OPTIMIZATIONS ==== */
/* Prefer GPU-accelerated properties and reduce repaints */
.lf-frontend-button,
.lf-frontend-button::before,
.lf-frontend-button::after {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .lf-frontend-button,
    .lf-trial-modal,
    .lf-notification {
        transition: none;
        animation: none;
    }
}

/* ==== BUTTON BASE STYLES ==== */
.lf-button-wrapper {
    display: inline-block;
    margin: 15px 0;
}

.lf-frontend-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lf-frontend-button:focus {
    box-shadow: 0 0 0 3px rgba(127, 84, 179, 0.3);
}

.lf-frontend-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.lf-button-spinner {
    display: none;
    font-size: 14px;
    animation: lf-spin 1s linear infinite;
}

.lf-frontend-button.lf-loading .lf-button-text {
    opacity: 0;
}

.lf-frontend-button.lf-loading .lf-button-spinner {
    display: inline-block;
    position: absolute;
}

@keyframes lf-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==== BUTTON SIZES ==== */
.lf-frontend-button.lf-button-small {
    padding: 8px 20px;
    font-size: 14px;
}

.lf-frontend-button.lf-button-medium {
    padding: 12px 30px;
    font-size: 16px;
}

.lf-frontend-button.lf-button-large {
    padding: 16px 40px;
    font-size: 18px;
}

/* ==== BUTTON STYLES ==== */

/* Default Style */
.lf-frontend-button.lf-style-default {
    border-radius: 6px;
    border: none;
}

/* Rounded Style */
.lf-frontend-button.lf-style-rounded {
    border-radius: 12px;
    border: none;
}

/* Pill Style */
.lf-frontend-button.lf-style-pill {
    border-radius: 50px;
    border: none;
}

/* Gradient Style */
.lf-frontend-button.lf-style-gradient {
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bg-color, #7F54B3), var(--text-color, #9674C4));
    border: none;
    position: relative;
    overflow: hidden;
}

.lf-frontend-button.lf-style-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.lf-frontend-button.lf-style-gradient:hover::before {
    left: 100%;
}

/* Outline Style */
.lf-frontend-button.lf-style-outline {
    background: transparent;
    border: 2px solid var(--bg-color, #7F54B3);
    color: var(--bg-color, #7F54B3);
    border-radius: 8px;
}

.lf-frontend-button.lf-style-outline:hover {
    background: var(--bg-color, #7F54B3);
    color: var(--text-color, #FFFFFF);
}

/* Glass Style */
.lf-frontend-button.lf-style-glass {
    background: rgba(127, 84, 179, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.lf-frontend-button.lf-style-glass:hover {
    background: rgba(127, 84, 179, 0.3);
    transform: translateY(-2px);
}

/* Neon Style */
.lf-frontend-button.lf-style-neon {
    background: var(--bg-color, #7F54B3);
    border: 2px solid var(--bg-color, #7F54B3);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(127, 84, 179, 0.5);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.lf-frontend-button.lf-style-neon:hover {
    box-shadow: 0 0 30px rgba(127, 84, 179, 0.8), 
                0 0 40px rgba(127, 84, 179, 0.6);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* Shadow Style */
.lf-frontend-button.lf-style-shadow {
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: none;
}

.lf-frontend-button.lf-style-shadow:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-3px);
}

/* Minimal Style */
.lf-frontend-button.lf-style-minimal {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--bg-color, #7F54B3);
    border-radius: 0;
    padding: 8px 16px;
}

.lf-frontend-button.lf-style-minimal:hover {
    border-bottom-width: 3px;
    color: var(--bg-color, #7F54B3);
}

/* Retro Style */
.lf-frontend-button.lf-style-retro {
    background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcf7f, #4d96ff, #9c88ff);
    border: 3px solid #000;
    border-radius: 0;
    box-shadow: 4px 4px 0 #000;
    text-transform: uppercase;
    font-weight: 800;
    color: #000;
}

.lf-frontend-button.lf-style-retro:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

/* WOO Classic Style (from old plugin) */
.lf-frontend-button.lf-style-woo-classic {
    background: linear-gradient(135deg, #7F54B3, #9674C4);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    color: white;
    font-weight: 800;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(127, 84, 179, 0.4);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.lf-frontend-button.lf-style-woo-classic::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.lf-frontend-button.lf-style-woo-classic:hover::before {
    left: 100%;
}

.lf-frontend-button.lf-style-woo-classic:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(127, 84, 179, 0.4), 
                0 0 40px rgba(127, 84, 179, 0.4),
                inset 0 0 20px rgba(255,255,255,0.1);
    background: linear-gradient(135deg, #9674C4, #7F54B3);
    border-color: rgba(255,255,255,0.4);
}

/* Cyber Style */
.lf-frontend-button.lf-style-cyber {
    background: linear-gradient(45deg, #00ff41, #00d4aa);
    border: 2px solid #00ff41;
    border-radius: 0;
    color: #000;
    font-weight: 900;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5),
                inset 0 0 20px rgba(0, 255, 65, 0.1);
    position: relative;
    overflow: hidden;
}

.lf-frontend-button.lf-style-cyber::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

.lf-frontend-button.lf-style-cyber:hover::before {
    animation: lf-cyber-scan 1.2s ease-in-out;
}

.lf-frontend-button.lf-style-cyber:hover {
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.8),
                0 0 60px rgba(0, 255, 65, 0.6),
                inset 0 0 30px rgba(0, 255, 65, 0.2);
    text-shadow: 0 0 10px rgba(0, 255, 65, 1);
}

@keyframes lf-cyber-scan {
    0% { transform: translateX(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) rotate(45deg); opacity: 0; }
}

/* Premium Style */
.lf-frontend-button.lf-style-premium {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 2px solid #FFD700;
    border-radius: 8px;
    color: #000;
    font-weight: 800;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.lf-frontend-button.lf-style-premium::before {
    content: '✨';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 30px;
    opacity: 0;
    transition: all 0.4s ease;
}

.lf-frontend-button.lf-style-premium:hover::before {
    top: 10px;
    right: 10px;
    opacity: 1;
    animation: lf-sparkle 1s ease-in-out infinite;
}

.lf-frontend-button.lf-style-premium:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 45px rgba(255, 215, 0, 0.6),
                0 0 50px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #FFA500, #FFD700);
}

@keyframes lf-sparkle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
}

/* ==== HOVER EFFECTS ==== */

/* Glow Effect */
.lf-frontend-button.lf-hover-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(127, 84, 179, 0.4), 
                0 0 20px rgba(127, 84, 179, 0.3);
}

/* Scale Effect */
.lf-frontend-button.lf-hover-scale:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Slide Effect */
.lf-frontend-button.lf-hover-slide {
    background-size: 200% 100%;
    background-position: right bottom;
    transition: all 0.4s ease;
}

.lf-frontend-button.lf-hover-slide:hover {
    background-position: left bottom;
    transform: translateY(-1px);
}

/* Bounce Effect */
.lf-frontend-button.lf-hover-bounce:hover {
    animation: lf-bounce 0.6s ease;
}

@keyframes lf-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* Pulse Effect */
.lf-frontend-button.lf-hover-pulse:hover {
    animation: lf-pulse 0.8s ease;
}

@keyframes lf-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Lift Effect (from old plugin) */
.lf-frontend-button.lf-hover-lift:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(127, 84, 179, 0.4), 
                0 0 30px rgba(127, 84, 179, 0.3);
}

/* Rotate Effect */
.lf-frontend-button.lf-hover-rotate:hover {
    transform: rotate(3deg) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Shake Effect */
.lf-frontend-button.lf-hover-shake:hover {
    animation: lf-shake 0.5s ease-in-out;
}

@keyframes lf-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Flip Effect */
.lf-frontend-button.lf-hover-flip {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.lf-frontend-button.lf-hover-flip:hover {
    transform: rotateY(180deg);
}

/* Magnetic Effect */
.lf-frontend-button.lf-hover-magnetic {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.lf-frontend-button.lf-hover-magnetic:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(127, 84, 179, 0.3);
}

/* Morphing Effect */
.lf-frontend-button.lf-hover-morph {
    border-radius: 8px;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lf-frontend-button.lf-hover-morph:hover {
    border-radius: 50px;
    transform: scale(1.1);
    padding: 20px 40px;
}

/* Electric Effect */
.lf-frontend-button.lf-hover-electric:hover {
    animation: lf-electric 1s ease-in-out;
    box-shadow: 0 0 5px #fff,
                0 0 10px #fff,
                0 0 15px var(--bg-color, #7F54B3),
                0 0 20px var(--bg-color, #7F54B3),
                0 0 35px var(--bg-color, #7F54B3),
                0 0 40px var(--bg-color, #7F54B3);
}

@keyframes lf-electric {
    0%, 100% { 
        box-shadow: 0 0 5px #fff,
                    0 0 10px #fff,
                    0 0 15px var(--bg-color, #7F54B3),
                    0 0 20px var(--bg-color, #7F54B3);
    }
    50% { 
        box-shadow: 0 0 10px #fff,
                    0 0 20px #fff,
                    0 0 30px var(--bg-color, #7F54B3),
                    0 0 40px var(--bg-color, #7F54B3),
                    0 0 70px var(--bg-color, #7F54B3),
                    0 0 80px var(--bg-color, #7F54B3);
    }
}

/* Ripple Effect */
.lf-frontend-button.lf-hover-ripple {
    position: relative;
    overflow: hidden;
}

.lf-frontend-button.lf-hover-ripple:hover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    animation: lf-ripple 0.6s ease-out;
}

@keyframes lf-ripple {
    to {
        width: 300px;
        height: 300px;
        margin-left: -150px;
        margin-top: -150px;
        opacity: 0;
    }
}

/* No Animation - Just Color Change */
.lf-frontend-button.lf-hover-none:hover {
    opacity: 0.9;
}

/* ==== TRIAL MODAL STYLES ==== */
.lf-trial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lf-trial-modal.lf-modal-open {
    opacity: 1;
    visibility: visible;
}

.lf-trial-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(50px);
    transition: transform 0.3s ease;
}

.lf-trial-modal.lf-modal-open .lf-trial-modal-content {
    transform: translateY(0);
}

.lf-trial-modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lf-trial-modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 20px;
    font-weight: 700;
}

.lf-trial-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    color: #6b7280;
    line-height: 1;
    transition: color 0.2s ease;
}

.lf-trial-modal-close:hover {
    color: #1f2937;
}

.lf-trial-modal-body {
    padding: 30px;
}

.lf-trial-modal-body p {
    margin: 0 0 25px 0;
    color: #4b5563;
    line-height: 1.6;
}

.lf-trial-form-row {
    margin-bottom: 20px;
}

.lf-trial-email,
.lf-trial-name {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
}

.lf-trial-email:focus,
.lf-trial-name:focus {
    outline: none;
    border-color: #7f54b3;
    box-shadow: 0 0 0 3px rgba(127, 84, 179, 0.1);
}

.lf-trial-submit-btn {
    width: 100%;
    padding: 15px 25px;
    background: linear-gradient(135deg, #7f54b3, #9674c4);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.lf-trial-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(127, 84, 179, 0.4);
}

.lf-trial-submit-btn:active {
    transform: translateY(0);
}

.lf-trial-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.lf-trial-submit-btn.lf-loading::after {
    content: "⏳ Sending...";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==== NOTIFICATIONS ==== */
.lf-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.lf-notification.lf-notification-show {
    transform: translateX(0);
}

.lf-notification.lf-notification-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.lf-notification.lf-notification-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.lf-notification.lf-notification-info {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

/* ==== PERFORMANCE & LOADING OPTIMIZATIONS ==== */
/* Improve button rendering performance */
.lf-frontend-button {
    contain: layout style;
    transform: translateZ(0); /* Force GPU acceleration */
}

/* Optimize heavy box-shadows */
.lf-frontend-button {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lf-frontend-button:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Lazy load heavy animations only on hover */
.lf-frontend-button:not(:hover)::before,
.lf-frontend-button:not(:hover)::after {
    animation-play-state: paused;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
    .lf-trial-modal {
        padding: 10px;
    }
    
    .lf-trial-modal-content {
        max-width: none;
    }
    
    .lf-trial-modal-header {
        padding: 20px 20px 15px;
    }
    
    .lf-trial-modal-body {
        padding: 20px;
    }
    
    .lf-trial-modal-header h3 {
        font-size: 18px;
    }
    
    .lf-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }
    
    .lf-notification.lf-notification-show {
        transform: translateY(0);
    }
}

/* ==== BUTTON WIDTH VARIATIONS ==== */
.lf-button-wrapper.lf-width-full .lf-frontend-button {
    width: 100%;
}

.lf-button-wrapper.lf-width-auto .lf-frontend-button {
    width: auto;
}

/* ==== FREEBIE FORM STYLES ==== */
.lf-freebie-form-container {
    max-width: 600px;
    margin: 30px auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.lf-freebie-form {
    width: 100%;
}

.lf-freebie-title {
    font-weight: 700;
    text-align: center;
    margin: 0 0 30px 0;
}

.lf-form-field-wrapper {
    margin-bottom: 20px;
}

.lf-form-field-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.lf-form-field-wrapper input[type="text"],
.lf-form-field-wrapper input[type="email"],
.lf-form-field-wrapper input[type="tel"],
.lf-form-field-wrapper select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.lf-form-field-wrapper input:focus,
.lf-form-field-wrapper select:focus {
    outline: none;
    border-color: #7F54B3;
    box-shadow: 0 0 0 3px rgba(127, 84, 179, 0.1);
}

.lf-form-field-wrapper .required {
    color: #EF4444;
}

/* ==== ACCESSIBILITY ==== */
@media (prefers-reduced-motion: reduce) {
    .lf-frontend-button,
    .lf-trial-modal,
    .lf-trial-modal-content,
    .lf-notification {
        transition: none;
    }
    
    .lf-frontend-button.lf-hover-bounce:hover,
    .lf-frontend-button.lf-hover-pulse:hover {
        animation: none;
        transform: none;
    }
}

/* ==== HIGH CONTRAST MODE ==== */
@media (prefers-contrast: high) {
    .lf-frontend-button {
        border: 2px solid;
    }
    
    .lf-trial-email,
    .lf-trial-name {
        border-width: 3px;
    }
}
