/**
 * Mamba - Custom Freemius Pricing Page Styles
 * Matches the Mamba admin theme for a cohesive look
 * 
 * NOTE: Freemius Pricing Page 2.0 is a React app that renders inside #fs_pricing_app
 * CSS variables MUST be applied to #fs_pricing_app container, not :root
 */

/* ============================================
   CSS VARIABLES - Applied to Freemius App Container
   ============================================ */
#fs_pricing_app,
#fs_pricing,
.fs-full-size-wrapper {
    /* Mamba brand colors - Primary accent (green) */
    --fs-ds-theme-primary-accent-color: #10b981 !important;
    --fs-ds-theme-primary-accent-color-hover: #059669 !important;
    
    /* Freemius blue palette overrides with Mamba green tones */
    --fs-ds-blue-10: #ecfdf5 !important;
    --fs-ds-blue-100: #d1fae5 !important;
    --fs-ds-blue-200: #a7f3d0 !important;
    --fs-ds-blue-300: #6ee7b7 !important;
    --fs-ds-blue-400: #34d399 !important;
    --fs-ds-blue-500: #10b981 !important;
    --fs-ds-blue-600: #059669 !important;
    --fs-ds-blue-700: #047857 !important;
    --fs-ds-blue-800: #065f46 !important;
    --fs-ds-blue-900: #064e3b !important;
    
    /* Typography */
    --fs-ds-typography-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    --fs-ds-typography-font-size-base: 14px !important;
    --fs-ds-typography-line-height-base: 1.6 !important;
    
    /* Spacing & Radius */
    --fs-ds-appearance-radius-sm: 6px !important;
    --fs-ds-appearance-radius-md: 8px !important;
    --fs-ds-appearance-radius-lg: 10px !important;
    --fs-ds-appearance-gutter: 16px !important;
    
    /* Colors */
    --fs-ds-color-background: #f8fafc !important;
    --fs-ds-color-surface: #ffffff !important;
    --fs-ds-color-border: #e2e8f0 !important;
    --fs-ds-color-text-primary: #0f172a !important;
    --fs-ds-color-text-secondary: #64748b !important;
    --fs-ds-color-text-muted: #94a3b8 !important;
    
    /* Shadows */
    --fs-ds-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    --fs-ds-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    --fs-ds-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
}

/* ============================================
   PLUGIN TITLE AND LOGO SECTION - Premium Hero Style
   ============================================ */
.fs-plugin-title-and-logo {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 48px 32px 40px !important;
    margin-bottom: 32px !important;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
    border-radius: 24px !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(16, 185, 129, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Subtle gradient glow effect */
.fs-plugin-title-and-logo::before {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.08) 0%, transparent 50%) !important;
    pointer-events: none !important;
}

.fs-plugin-title-and-logo .fs-plugin-logo {
    width: 80px !important;
    height: 80px !important;
    border-radius: 20px !important;
    box-shadow: 
        0 8px 32px rgba(16, 185, 129, 0.3),
        0 0 0 3px rgba(16, 185, 129, 0.2) !important;
    margin-bottom: 20px !important;
    object-fit: contain !important;
    position: relative !important;
    z-index: 1 !important;
}

.fs-plugin-title-and-logo h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin: 0 0 8px !important;
    letter-spacing: -0.5px !important;
    position: relative !important;
    z-index: 1 !important;
    /* Hide original Freemius title */
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
}

/* Replace title with "Mamba Cache for WooCommerce" */
.fs-plugin-title-and-logo::after {
    content: "Mamba Cache for WooCommerce" !important;
    display: block !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    position: relative !important;
    z-index: 1 !important;
    letter-spacing: -0.5px !important;
    margin-bottom: 8px !important;
}

.fs-plugin-title-and-logo h1 strong {
    font-weight: 700 !important;
    background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Add a tagline style if present */
.fs-plugin-title-and-logo p,
.fs-plugin-title-and-logo .fs-plugin-tagline {
    font-size: 15px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    margin: 0 !important;
    max-width: 400px !important;
    position: relative !important;
    z-index: 1 !important;
}

/* ============================================
   GLOBAL WRAPPER STYLES
   ============================================ */
#fs_pricing,
.fs-section {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #0f172a !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#fs_pricing_wrapper {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 32px 24px !important;
    background: transparent !important;
}

#fs_pricing_app {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.fs-pricing-header,
.fs-section-header {
    text-align: center;
    margin-bottom: 24px;
}

.fs-pricing-header h1,
.fs-section-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--fs-ds-color-text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.fs-pricing-header p,
.fs-section-header p {
    font-size: 14px;
    color: var(--fs-ds-color-text-secondary);
    margin: 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   BILLING TOGGLE
   ============================================ */
.fs-billing-toggle,
[class*="billing-cycle"] {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--fs-ds-color-surface);
    border: 1px solid var(--fs-ds-color-border);
    border-radius: 24px;
    padding: 4px;
    margin-bottom: 20px;
}

.fs-billing-toggle button,
[class*="billing-cycle"] button {
    padding: 8px 18px;
    border: none;
    background: transparent;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fs-ds-color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.fs-billing-toggle button.active,
.fs-billing-toggle button:hover,
[class*="billing-cycle"] button.active,
[class*="billing-cycle"] button:hover {
    background: var(--fs-ds-theme-primary-accent-color);
    color: #ffffff;
}

/* ============================================
   PRICING CARDS GRID - 4 Plans Layout
   ============================================ */
.fs-plans,
.fs-pricing-plans,
[class*="plans-container"] {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    max-width: 1320px !important;
    margin: 0 auto !important;
    padding: 0 16px !important;
}

/* ============================================
   INDIVIDUAL PRICING CARD
   ============================================ */
.fs-plan,
.fs-pricing-plan,
[class*="plan-card"] {
    background: var(--fs-ds-color-surface);
    border: 1px solid var(--fs-ds-color-border);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    position: relative;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fs-plan:hover,
.fs-pricing-plan:hover,
[class*="plan-card"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(16, 185, 129, 0.4);
}

/* Featured/Recommended Plan */
.fs-plan.featured,
.fs-plan.recommended,
.fs-pricing-plan.featured,
[class*="plan-card"].featured,
[class*="plan-card"].recommended {
    border: 1.5px solid var(--fs-ds-theme-primary-accent-color);
    transform: scale(1.01);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
}

.fs-plan.featured::before,
.fs-plan.recommended::before,
[class*="plan-card"].featured::before,
[class*="plan-card"].recommended::before {
    content: 'Popular';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Plan Name */
.fs-plan-name,
.fs-plan h3,
[class*="plan-name"] {
    font-size: 16px;
    font-weight: 600;
    color: var(--fs-ds-color-text-primary);
    margin: 0 0 4px;
}

/* Plan Description */
.fs-plan-description,
.fs-plan > p,
[class*="plan-description"] {
    font-size: 12px;
    color: var(--fs-ds-color-text-secondary);
    margin: 0 0 16px;
    line-height: 1.4;
}

/* ============================================
   PRICING DISPLAY
   ============================================ */
.fs-plan-price,
.fs-price,
[class*="plan-price"] {
    margin: 16px 0;
}

.fs-plan-price .amount,
.fs-price .amount,
[class*="price-amount"] {
    font-size: 36px;
    font-weight: 700;
    color: var(--fs-ds-color-text-primary);
    line-height: 1;
    letter-spacing: -1px;
}

.fs-plan-price .currency,
.fs-price .currency,
[class*="price-currency"] {
    font-size: 18px;
    font-weight: 600;
    color: var(--fs-ds-color-text-secondary);
    vertical-align: super;
}

.fs-plan-price .period,
.fs-price .period,
[class*="price-period"] {
    font-size: 12px;
    color: var(--fs-ds-color-text-muted);
    display: block;
    margin-top: 2px;
}

/* Discount Badge */
.fs-discount,
[class*="discount-badge"] {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================
   FEATURES LIST
   ============================================ */
.fs-plan-features,
.fs-features,
[class*="features-list"] {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    text-align: left;
}

.fs-plan-features li,
.fs-features li,
[class*="features-list"] li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: var(--fs-ds-color-text-secondary);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.fs-plan-features li:last-child,
.fs-features li:last-child,
[class*="features-list"] li:last-child {
    border-bottom: none;
}

.fs-plan-features li::before,
.fs-features li::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--fs-ds-theme-primary-accent-color);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ============================================
   CTA BUTTONS
   ============================================ */
.fs-plan-cta,
.fs-cta-button,
.fs-plan button,
[class*="plan-cta"] button,
[class*="cta-button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    text-decoration: none;
}

.fs-plan-cta:hover,
.fs-cta-button:hover,
.fs-plan button:hover,
[class*="plan-cta"] button:hover,
[class*="cta-button"]:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* Secondary Button Style */
.fs-plan-cta.secondary,
.fs-cta-button.secondary,
[class*="cta-button"].secondary {
    background: transparent;
    border: 2px solid var(--fs-ds-color-border);
    color: var(--fs-ds-color-text-primary);
    box-shadow: none;
}

.fs-plan-cta.secondary:hover,
.fs-cta-button.secondary:hover,
[class*="cta-button"].secondary:hover {
    border-color: var(--fs-ds-theme-primary-accent-color);
    color: var(--fs-ds-theme-primary-accent-color);
    background: rgba(16, 185, 129, 0.05);
    transform: translateY(-2px);
}

/* ============================================
   FAQ SECTION
   ============================================ */
.fs-faq,
[class*="faq-section"] {
    max-width: 800px;
    margin: 60px auto 0;
    padding-top: 40px;
    border-top: 1px solid var(--fs-ds-color-border);
}

.fs-faq h2,
[class*="faq-section"] h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--fs-ds-color-text-primary);
    text-align: center;
    margin: 0 0 32px;
}

.fs-faq-item,
[class*="faq-item"] {
    background: var(--fs-ds-color-surface);
    border: 1px solid var(--fs-ds-color-border);
    border-radius: var(--fs-ds-appearance-radius-md);
    margin-bottom: 12px;
    overflow: hidden;
}

.fs-faq-item summary,
.fs-faq-item .question,
[class*="faq-item"] summary,
[class*="faq-question"] {
    padding: 18px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--fs-ds-color-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease;
}

.fs-faq-item summary:hover,
.fs-faq-item .question:hover,
[class*="faq-item"] summary:hover {
    background: var(--fs-ds-color-background);
}

.fs-faq-item .answer,
.fs-faq-item p,
[class*="faq-answer"] {
    padding: 0 24px 18px;
    font-size: 14px;
    color: var(--fs-ds-color-text-secondary);
    line-height: 1.6;
}

/* ============================================
   MONEY BACK GUARANTEE
   ============================================ */
.fs-guarantee,
[class*="guarantee"] {
    text-align: center;
    margin-top: 40px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--fs-ds-appearance-radius-lg);
}

.fs-guarantee p,
[class*="guarantee"] p {
    margin: 0;
    font-size: 14px;
    color: var(--fs-ds-color-text-secondary);
}

.fs-guarantee strong,
[class*="guarantee"] strong {
    color: var(--fs-ds-theme-primary-accent-color);
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.fs-testimonials,
[class*="testimonials"] {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--fs-ds-color-border);
}

.fs-testimonial,
[class*="testimonial-card"] {
    background: var(--fs-ds-color-surface);
    border: 1px solid var(--fs-ds-color-border);
    border-radius: var(--fs-ds-appearance-radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.fs-testimonial blockquote,
[class*="testimonial-card"] blockquote {
    margin: 0 0 16px;
    font-size: 15px;
    color: var(--fs-ds-color-text-primary);
    font-style: italic;
    line-height: 1.6;
}

.fs-testimonial cite,
[class*="testimonial-card"] cite {
    font-size: 13px;
    color: var(--fs-ds-color-text-muted);
    font-style: normal;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    #fs_pricing_wrapper {
        padding: 24px 16px;
    }
    
    .fs-plans,
    .fs-pricing-plans,
    [class*="plans-container"] {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .fs-plan.featured,
    .fs-plan.recommended,
    [class*="plan-card"].featured {
        transform: none;
    }
    
    .fs-plan-price .amount,
    .fs-price .amount,
    [class*="price-amount"] {
        font-size: 40px;
    }
    
    .fs-pricing-header h1,
    .fs-section-header h1 {
        font-size: 24px;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */
.fs-loading,
[class*="loading"] {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.fs-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--fs-ds-color-border);
    border-top-color: var(--fs-ds-theme-primary-accent-color);
    border-radius: 50%;
    animation: fs-spin 1s linear infinite;
}

@keyframes fs-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   NOTICES & ALERTS
   ============================================ */
.fs-notice,
[class*="notice"] {
    padding: 16px 20px;
    border-radius: var(--fs-ds-appearance-radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.fs-notice.success,
[class*="notice-success"] {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #065f46;
}

.fs-notice.error,
[class*="notice-error"] {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #991b1b;
}

.fs-notice.warning,
[class*="notice-warning"] {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #92400e;
}

/* ============================================
   FORM ELEMENTS (License Activation, etc.)
   ============================================ */
.fs-form input[type="text"],
.fs-form input[type="email"],
[class*="license-input"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--fs-ds-color-border);
    border-radius: var(--fs-ds-appearance-radius-md);
    font-size: 14px;
    font-family: var(--fs-ds-typography-font-family);
    color: var(--fs-ds-color-text-primary);
    background: var(--fs-ds-color-surface);
    transition: all 0.2s ease;
}

.fs-form input[type="text"]:focus,
.fs-form input[type="email"]:focus,
[class*="license-input"]:focus {
    outline: none;
    border-color: var(--fs-ds-theme-primary-accent-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ============================================
   LINKS
   ============================================ */
#fs_pricing a,
.fs-section a {
    color: var(--fs-ds-theme-primary-accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

#fs_pricing a:hover,
.fs-section a:hover {
    color: var(--fs-ds-theme-primary-accent-color-hover);
    text-decoration: underline;
}

/* ============================================
   HIDE UNWANTED FREEMIUS ELEMENTS
   ============================================ */
.fs-powered-by {
    opacity: 0.5;
    font-size: 11px;
    margin-top: 40px;
}

/* ============================================
   RESPONSIVE - 4 column layout breakpoints
   ============================================ */
@media (max-width: 1200px) {
    .fs-plans,
    .fs-pricing-plans,
    [class*="plans-container"] {
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 700px !important;
    }
}

@media (max-width: 700px) {
    .fs-plans,
    .fs-pricing-plans,
    [class*="plans-container"] {
        grid-template-columns: 1fr !important;
        max-width: 400px !important;
    }
    
    #fs_pricing_wrapper {
        padding: 16px !important;
    }
    
    .fs-plugin-title-and-logo {
        padding: 32px 20px !important;
    }
    
    .fs-plugin-title-and-logo h1 {
        font-size: 22px !important;
    }
}
