/**
 * FlexWoo Memberships Pro - Front-End Blocks & Widgets Stylesheet
 * Responsive, modern, customizable UI for Gutenberg Blocks & Elementor Widgets.
 */

:root {
    --fwm-primary: #4f46e5;
    --fwm-primary-hover: #4338ca;
    --fwm-primary-light: #eef2ff;
    --fwm-accent: #0ea5e9;
    --fwm-success: #10b981;
    --fwm-warning: #f59e0b;
    --fwm-danger: #ef4444;
    --fwm-text-main: #0f172a;
    --fwm-text-muted: #64748b;
    --fwm-border: #e2e8f0;
    --fwm-card-bg: #ffffff;
    --fwm-bg-subtle: #f8fafc;
    --fwm-radius-sm: 6px;
    --fwm-radius: 12px;
    --fwm-radius-lg: 16px;
    --fwm-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --fwm-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --fwm-shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --fwm-shadow-glow: 0 0 25px rgba(79, 70, 229, 0.2);
    --fwm-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   1. Member-Locked Content & Blur Overlay
   ========================================================================== */
.fwm-locked-wrap {
    position: relative;
    border-radius: var(--fwm-radius);
    overflow: hidden;
    margin: 24px 0;
}

.fwm-locked-blur {
    filter: blur(8px);
    opacity: 0.45;
    user-select: none;
    pointer-events: none;
    transition: var(--fwm-transition);
}

.fwm-locked-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10;
    padding: 24px;
}

.fwm-locked-card {
    background: var(--fwm-card-bg);
    border: 1px solid var(--fwm-border);
    border-radius: var(--fwm-radius);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--fwm-shadow-lg);
    animation: fwmFadeIn 0.3s ease;
}

.fwm-locked-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--fwm-primary-light);
    color: var(--fwm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.fwm-locked-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fwm-text-main);
    margin: 0 0 8px;
}

.fwm-locked-msg {
    font-size: 14px;
    color: var(--fwm-text-muted);
    line-height: 1.6;
    margin: 0 0 20px;
}

.fwm-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--fwm-primary) 0%, #6366f1 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    padding: 11px 24px;
    border-radius: var(--fwm-radius-sm);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    transition: var(--fwm-transition);
}

.fwm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
    color: #ffffff !important;
}

/* ==========================================================================
   2. Pricing Table
   ========================================================================== */
.fwm-pricing-table-wrap {
    margin: 32px 0;
    font-family: inherit;
}

.fwm-pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.fwm-toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--fwm-text-muted);
    cursor: pointer;
}

.fwm-toggle-label.active {
    color: var(--fwm-text-main);
}

.fwm-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.fwm-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.fwm-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 26px;
}

.fwm-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

input:checked + .fwm-slider {
    background-color: var(--fwm-primary);
}

input:checked + .fwm-slider:before {
    transform: translateX(22px);
}

.fwm-discount-badge {
    background: #ecfdf5;
    color: #059669;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
    border: 1px solid #a7f3d0;
}

.fwm-pricing-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
}

.fwm-plan-card {
    background: var(--fwm-card-bg);
    border: 1px solid var(--fwm-border);
    border-radius: var(--fwm-radius-lg);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--fwm-shadow);
    transition: var(--fwm-transition);
}

.fwm-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--fwm-shadow-lg);
}

.fwm-plan-card.featured {
    border-color: var(--fwm-primary);
    box-shadow: var(--fwm-shadow-glow), var(--fwm-shadow-lg);
}

.fwm-plan-ribbon {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--fwm-primary) 0%, #818cf8 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 14px;
    border-radius: 9999px;
    box-shadow: 0 3px 8px rgba(79, 70, 229, 0.3);
}

.fwm-plan-header {
    margin-bottom: 20px;
    text-align: center;
}

.fwm-plan-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--fwm-text-main);
    margin: 0 0 8px;
}

.fwm-plan-desc {
    font-size: 13px;
    color: var(--fwm-text-muted);
    line-height: 1.5;
    margin: 0;
}

.fwm-plan-price-wrap {
    margin: 20px 0;
    text-align: center;
    border-bottom: 1px solid var(--fwm-border);
    padding-bottom: 20px;
}

.fwm-price-val {
    font-size: 38px;
    font-weight: 800;
    color: var(--fwm-text-main);
    letter-spacing: -0.5px;
}

.fwm-price-period {
    font-size: 13px;
    color: var(--fwm-text-muted);
    margin-left: 4px;
}

.fwm-price-subtext {
    font-size: 12px;
    color: var(--fwm-success);
    font-weight: 600;
    margin-top: 4px;
}

.fwm-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px 0;
    flex-grow: 1;
}

.fwm-plan-features li {
    font-size: 13.5px;
    color: #334155;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.fwm-feat-icon {
    color: var(--fwm-success);
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    margin-top: 1px;
}

.fwm-plan-action {
    margin-top: auto;
}

.fwm-plan-btn {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    border-radius: var(--fwm-radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    display: block;
    transition: var(--fwm-transition);
}

.fwm-plan-btn-primary {
    background: var(--fwm-primary);
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.fwm-plan-btn-primary:hover {
    background: var(--fwm-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.35);
}

.fwm-plan-btn-outline {
    background: transparent;
    color: var(--fwm-text-main) !important;
    border: 1px solid #cbd5e1;
}

.fwm-plan-btn-outline:hover {
    background: var(--fwm-bg-subtle);
    border-color: #94a3b8;
}

.fwm-plan-btn.current {
    background: #f1f5f9;
    color: #64748b !important;
    border: 1px solid #e2e8f0;
    cursor: default;
}

/* ==========================================================================
   3. Member Credits Counter
   ========================================================================== */
.fwm-credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--fwm-card-bg);
    border: 1px solid var(--fwm-border);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fwm-text-main);
    box-shadow: var(--fwm-shadow-sm);
}

.fwm-credits-card {
    background: var(--fwm-card-bg);
    border: 1px solid var(--fwm-border);
    border-radius: var(--fwm-radius);
    padding: 24px;
    box-shadow: var(--fwm-shadow);
    max-width: 440px;
}

.fwm-credits-meter {
    background: #e2e8f0;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin: 12px 0 8px 0;
}

.fwm-credits-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--fwm-primary) 0%, #38bdf8 100%);
    border-radius: 5px;
    transition: width 0.6s ease;
}

/* ==========================================================================
   4. Downloads Vault
   ========================================================================== */
.fwm-vault-wrap {
    margin: 28px 0;
}

.fwm-vault-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fwm-search-input {
    flex: 1;
    min-width: 220px;
    padding: 10px 14px;
    border: 1px solid var(--fwm-border);
    border-radius: var(--fwm-radius-sm);
    font-size: 14px;
    outline: none;
    transition: var(--fwm-transition);
}

.fwm-search-input:focus {
    border-color: var(--fwm-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.fwm-vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.fwm-file-card {
    background: var(--fwm-card-bg);
    border: 1px solid var(--fwm-border);
    border-radius: var(--fwm-radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--fwm-shadow-sm);
    transition: var(--fwm-transition);
}

.fwm-file-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--fwm-shadow);
    border-color: #cbd5e1;
}

.fwm-file-ext {
    display: inline-block;
    background: var(--fwm-primary-light);
    color: var(--fwm-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.fwm-file-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--fwm-text-main);
    margin: 0 0 6px 0;
}

.fwm-file-meta {
    font-size: 12px;
    color: var(--fwm-text-muted);
    margin-bottom: 14px;
}

/* ==========================================================================
   5. Member Status Card
   ========================================================================== */
.fwm-status-card {
    background: var(--fwm-card-bg);
    border: 1px solid var(--fwm-border);
    border-radius: var(--fwm-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--fwm-shadow-sm);
}

.fwm-status-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.fwm-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fdf2f8;
    color: #be185d;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    margin-top: 4px;
}

/* ==========================================================================
   6. Drip Schedule Timeline
   ========================================================================== */
.fwm-drip-timeline {
    position: relative;
    padding-left: 28px;
    margin: 24px 0;
}

.fwm-drip-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #e2e8f0;
}

.fwm-drip-item {
    position: relative;
    margin-bottom: 20px;
}

.fwm-drip-dot {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.fwm-drip-item.unlocked .fwm-drip-dot {
    border-color: var(--fwm-success);
    background: var(--fwm-success);
    color: #ffffff;
}

/* ==========================================================================
   7. Alert Banner
   ========================================================================== */
.fwm-alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-radius: var(--fwm-radius);
    margin: 20px 0;
    font-size: 14px;
}

.fwm-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.fwm-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.fwm-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Keyframes */
@keyframes fwmFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 640px) {
    .fwm-pricing-grid {
        grid-template-columns: 1fr;
    }
    .fwm-status-card {
        flex-direction: column;
        text-align: center;
    }
}
