/**
 * Upgrade Modal CSS
 * SEO-optimized, conversion-focused design
 */

.bbai-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    pointer-events: auto;
    animation: fadeIn 0.2s ease-out;
}

@supports not (inset: 0) {
    .bbai-modal-backdrop {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        height: auto;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bbai-upgrade-modal__content {
    background: #ffffff !important;
    background: var(--bbai-white, #ffffff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1100px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1000000;
    pointer-events: auto;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bbai-upgrade-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 40px 40px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff !important;
    background: var(--bbai-white, #ffffff);
}

.bbai-upgrade-modal__header-content {
    flex: 1;
    max-width: 85%;
}

.bbai-upgrade-modal__header h2 {
    margin: 0 0 16px 0;
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.bbai-upgrade-modal__subtitle {
    margin: 0 0 24px 0;
    font-size: 18px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.6;
}

/* Trust Badges */
.bbai-trust-badges {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.bbai-trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.bbai-trust-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.bbai-trust-badge-text {
    line-height: 1.4;
}

.bbai-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    margin-left: 16px;
}

.bbai-modal-close:hover {
    background-color: #f3f4f6;
    color: #111827;
    transform: rotate(90deg);
}

.bbai-modal-close svg {
    width: 20px;
    height: 20px;
}

.bbai-upgrade-modal__body {
    padding: 32px 40px 40px;
    background: #ffffff !important;
    background: var(--bbai-white, #ffffff);
}

/* Auth Notice */
.bbai-auth-notice {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bbai-auth-notice__icon {
    font-size: 20px;
    flex-shrink: 0;
}

.bbai-auth-notice p {
    margin: 0;
    color: #1e40af;
    font-size: 14px;
    line-height: 1.5;
}

.bbai-auth-notice a {
    color: #3b82f6;
    text-decoration: underline;
    font-weight: 600;
}

.bbai-auth-notice a:hover {
    color: #2563eb;
    text-decoration: none;
}

/* Why Upgrade Bar */
.bbai-why-upgrade {
    display: flex;
    gap: 32px;
    padding: 24px 32px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #10b981;
    border-radius: 12px;
    margin-bottom: 32px;
}

.bbai-why-upgrade-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.bbai-why-upgrade-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.bbai-why-upgrade-text {
    font-size: 15px;
    font-weight: 600;
    color: #065f46;
    line-height: 1.4;
}

/* Billing Toggle */
.bbai-billing-toggle {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 32px;
    gap: 4px;
}

.bbai-billing-toggle__option {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bbai-billing-toggle__option:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.5);
}

.bbai-billing-toggle__option--active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bbai-billing-savings {
    background: #10b981;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bbai-billing-toggle__option--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    pointer-events: none;
    position: relative;
}

.bbai-billing-toggle__option--disabled:hover {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    transform: none !important;
}

.bbai-billing-coming-soon {
    background: #6b7280;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bbai-plan-credits-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.bbai-plan-credits-info small {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

/* Pricing Container */
.bbai-pricing-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* Plan Cards */
.bbai-plan-card {
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px;
    position: relative;
    background: #ffffff !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bbai-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.bbai-plan-card--pro {
    border-color: #e5e7eb;
}

.bbai-plan-card--pro:hover {
    border-color: #2563eb;
}

.bbai-plan-card--agency {
    border-color: #10b981;
    border-width: 2px;
}

.bbai-plan-card--agency:hover {
    border-color: #059669;
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.2);
}

/* Plan Badges */
.bbai-plan-badge {
    position: absolute;
    top: -12px;
    left: 24px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bbai-plan-badge--popular {
    background: #f59e0b;
    color: #ffffff;
}

.bbai-plan-badge--professional {
    background: #10b981;
    color: #ffffff;
}

/* Plan Header */
.bbai-plan-header {
    margin-bottom: 24px;
    text-align: center;
}

.bbai-plan-header h3 {
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.bbai-plan-price {
    margin: 0 0 8px 0;
    text-align: center;
}

.bbai-price-amount {
    font-size: 42px;
    font-weight: 800;
    color: #111827;
    line-height: 1;
    letter-spacing: -0.02em;
    display: inline-block;
}

.bbai-price-value {
    display: inline;
}

.bbai-price-period {
    font-size: 18px;
    color: #6b7280;
    margin-left: 4px;
    font-weight: 500;
}

/* Plan Features */
.bbai-plan-features {
    flex: 1;
    margin: 0 0 24px 0;
}

.bbai-plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.bbai-plan-features li {
    padding: 12px 0 12px 32px;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
}

.bbai-plan-features li:last-child {
    border-bottom: none;
}

.bbai-plan-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #10b981;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
    top: 10px;
}

.bbai-feature-highlight {
    font-weight: 800;
    color: #2563eb;
    font-size: 18px;
}

/* Plan CTA Buttons - Vibrant Colors */
.bbai-plan-cta {
    width: 100%;
    padding: 16px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 0;
    margin-bottom: 12px;
    text-transform: none !important;
    letter-spacing: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bbai-plan-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.bbai-plan-cta:active {
    transform: translateY(0);
}

.bbai-plan-cta--pro {
    background: #2563eb !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4) !important;
}

.bbai-plan-cta--pro:hover {
    background: #1d4ed8 !important;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5) !important;
}

.bbai-plan-cta--agency {
    background: #10b981 !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4) !important;
}

.bbai-plan-cta--agency:hover {
    background: #059669 !important;
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5) !important;
}

.bbai-plan-trust {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
    line-height: 1.5;
}

/* Credits Section */
.bbai-credits-section {
    margin-bottom: 32px;
}

.bbai-plan-card--credits {
    width: 100%;
    border-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%) !important;
    padding: 32px;
}

.bbai-credits-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.bbai-credits-header-left {
    flex: 1;
}

.bbai-credits-header-left h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    text-align: left;
}

.bbai-credits-features {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.bbai-credits-feature {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #e0f2fe;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
}

.bbai-plan-card--credits .bbai-plan-price {
    flex-shrink: 0;
    text-align: right;
}

.bbai-plan-card--credits .bbai-plan-cta {
    background: #3b82f6 !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4) !important;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.bbai-plan-card--credits .bbai-plan-cta:hover {
    background: #2563eb !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5) !important;
}

/* Footer Trust Line */
.bbai-upgrade-modal__footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.bbai-footer-trust {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.6;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .bbai-upgrade-modal__content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .bbai-upgrade-modal__header {
        padding: 24px 24px 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .bbai-upgrade-modal__header-content {
        max-width: 100%;
        margin-bottom: 16px;
    }
    
    .bbai-upgrade-modal__header h2 {
        font-size: 24px;
    }
    
    .bbai-upgrade-modal__subtitle {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .bbai-trust-badges {
        flex-direction: column;
        gap: 12px;
    }
    
    .bbai-modal-close {
        align-self: flex-end;
        margin-left: 0;
        margin-top: -12px;
    }
    
    .bbai-upgrade-modal__body {
        padding: 24px;
    }
    
    .bbai-why-upgrade {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }
    
    .bbai-why-upgrade-item {
        flex-direction: row;
    }
    
    .bbai-billing-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .bbai-pricing-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .bbai-plan-card {
        padding: 24px;
    }
    
    .bbai-credits-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .bbai-credits-header-left h3 {
        text-align: center;
    }
    
    .bbai-credits-features {
        justify-content: center;
    }
    
    .bbai-plan-card--credits .bbai-plan-price {
        text-align: center;
        width: 100%;
    }
    
    .bbai-plan-card--credits .bbai-plan-cta {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .bbai-upgrade-modal__header h2 {
        font-size: 20px;
    }
    
    .bbai-upgrade-modal__subtitle {
        font-size: 14px;
    }
    
    .bbai-price-amount {
        font-size: 36px;
    }
    
    .bbai-plan-cta {
        font-size: 14px !important;
        padding: 14px 20px !important;
    }
}
