/* ============================================
   STOCGLE SUBSCRIPTION & PRICING STYLES
   ============================================ */

/* ---------------------------------------------------------------------------
   Pricing page
   --------------------------------------------------------------------------- */

.pricing-page {
    min-height: 100vh;
    padding: 2rem 1rem 4rem;
    background: var(--bg-primary, #fafbfc);
}

.pricing-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.pricing-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin-bottom: 0.5rem;
}

.pricing-header p {
    color: var(--text-secondary, #475569);
    font-size: 1.05rem;
}

/* Interval toggle */
.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.pricing-toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}

.pricing-toggle-label.active {
    color: var(--primary, #2563eb);
    font-weight: 600;
}

.pricing-toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: #cbd5e1;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.pricing-toggle-switch.annual {
    background: var(--primary, #2563eb);
}

.pricing-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.pricing-toggle-switch.annual::after {
    transform: translateX(22px);
}

.pricing-save-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #10b981;
    background: #ecfdf5;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

/* Cards */
.pricing-cards {
    display: flex;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    align-items: stretch;
}

.pricing-card {
    flex: 1;
    background: var(--surface, #fff);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.pricing-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.pricing-card.featured {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 2px var(--primary, #2563eb), 0 8px 24px rgba(37,99,235,0.12);
    position: relative;
}

.pricing-card-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary, #2563eb);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 1rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pricing-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.pricing-card-price {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.pricing-card-price .currency {
    font-size: 1.25rem;
    font-weight: 600;
    vertical-align: super;
}

.pricing-card-price .period {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.pricing-card-subtitle {
    font-size: 0.85rem;
    color: var(--text-tertiary, #94a3b8);
    margin-bottom: 1.5rem;
    min-height: 1.2em;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    flex-grow: 1;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pricing-features .check {
    color: #10b981;
    flex-shrink: 0;
    font-weight: 700;
}

.pricing-features .cross {
    color: #cbd5e1;
    flex-shrink: 0;
    font-weight: 700;
}

.pricing-cta-btn {
    display: block;
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 0.625rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, transform 0.1s;
}

.pricing-cta-btn:active {
    transform: scale(0.98);
}

.pricing-cta-btn.secondary {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.pricing-cta-btn.primary {
    background: var(--primary, #2563eb);
    color: #fff;
}

.pricing-cta-btn.primary:hover {
    background: var(--primary-hover, #1d4ed8);
}

.pricing-cta-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 640px) {
    .pricing-cards {
        flex-direction: column;
    }
    .pricing-header h1 {
        font-size: 1.5rem;
    }
    .pricing-card-price {
        font-size: 1.75rem;
    }
}

/* ---------------------------------------------------------------------------
   Premium gate overlay (used on best-stocks, etc.)
   --------------------------------------------------------------------------- */

.premium-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 300px;
}

.premium-gate-icon {
    color: var(--text-tertiary, #94a3b8);
    margin-bottom: 1rem;
}

.premium-gate-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.premium-gate-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 400px;
}

.premium-gate-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.premium-gate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary, #2563eb);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.premium-gate-btn:hover {
    background: var(--primary-hover, #1d4ed8);
}

.premium-gate-link {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-decoration: underline;
}

/* Upgrade link in table cells */
.upgrade-link {
    color: var(--primary, #2563eb);
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.upgrade-link:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Upgrade success overlay
   --------------------------------------------------------------------------- */

.upgrade-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.upgrade-success-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: scaleIn 0.3s ease;
}

.upgrade-success-icon {
    margin-bottom: 1rem;
}

.upgrade-success-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upgrade-success-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1);   }
}

/* ---------------------------------------------------------------------------
   Chat limit banner
   --------------------------------------------------------------------------- */

.chat-limit-banner {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #92400e;
}

.chat-limit-banner a {
    color: var(--primary, #2563eb);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Nav premium badge
   --------------------------------------------------------------------------- */

.nav-premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    margin-left: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   Subscription Wall — full-page overlay for logged-in free users
   ═══════════════════════════════════════════════════════════════════════ */
.subscription-wall {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.sub-wall-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    padding: 2.25rem 2rem 1.75rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    animation: subWallIn 0.25s ease-out;
}
@keyframes subWallIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.sub-wall-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
}
.sub-wall-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.4rem;
}
.sub-wall-desc {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.55;
    margin: 0 0 1.25rem;
}
.sub-wall-plans {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.1rem;
}
.sub-wall-plan {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: left;
}
.sub-wall-plan:hover { border-color: #93c5fd; }
.sub-wall-plan.active {
    border-color: #2563eb;
    background: #eff6ff;
}
.sub-plan-radio {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s;
}
.sub-wall-plan.active .sub-plan-radio {
    border-color: #2563eb;
}
.sub-wall-plan.active .sub-plan-radio::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #2563eb;
}
.sub-plan-detail {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sub-plan-detail strong {
    font-size: 0.9rem;
    color: #1e293b;
}
.sub-plan-price {
    font-size: 0.82rem;
    color: #475569;
}
.sub-plan-price small {
    color: #94a3b8;
}
.sub-plan-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    color: #16a34a;
    background: #dcfce7;
    padding: 1px 7px;
    border-radius: 999px;
    margin-top: 2px;
    width: fit-content;
}
.sub-wall-cta {
    width: 100%;
    padding: 0.75rem;
    background: #2563eb;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 1rem;
}
.sub-wall-cta:hover { background: #1d4ed8; }
.sub-wall-cta:disabled { opacity: 0.7; cursor: not-allowed; }
.sub-wall-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    text-align: left;
}
.sub-wall-features li {
    font-size: 0.78rem;
    color: #475569;
    padding-left: 18px;
    position: relative;
    line-height: 1.5;
}
.sub-wall-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}
.sub-wall-logout {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.15s;
}
.sub-wall-logout:hover { color: #ef4444; }

@media (max-width: 480px) {
    .sub-wall-card { padding: 1.5rem 1.25rem 1.25rem; }
    .sub-wall-features { grid-template-columns: 1fr; }
}
