/* ============================================================================
   Subscription Management Styles
   - Compact tier cards matching website pricing page design
   - Billing period toggle
   - Feature lists
   - Pricing display
   ============================================================================ */

/* Billing Period Toggle */
.billing-toggle-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.billing-toggle-btn.active {
    background: #667eea;
    color: white;
}

.billing-toggle-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
}

/* Subscription Tier Cards */
.subscription-tier-card {
    background: rgba(15, 23, 34, 0.9);
    border: 2px solid rgba(147, 112, 219, 0.3);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
    text-align: center;
}

.subscription-tier-card:hover {
    transform: translateY(-3px);
    border-color: rgba(147, 112, 219, 0.6);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
}

.subscription-tier-card.recommended {
    border-color: #9370db;
}

.subscription-tier-card.current {
    border-color: rgba(16, 185, 129, 0.5);
}

.subscription-tier-card.current:hover {
    transform: none;
    box-shadow: none;
}

/* Tier Badges */
.tier-badge {
    position: absolute;
    top: -12px;
    right: 16px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 600;
    white-space: nowrap;
}

.recommended-badge {
    background: linear-gradient(135deg, #9370db, #7b68ee);
    color: white;
}

.current-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    right: auto;
    left: 16px;
}

/* Tier Card Title */
.tier-card-title {
    font-size: 1.4em;
    font-weight: 700;
    color: #9370db;
    margin: 4px 0 10px 0;
}

/* Tier Card Price */
.tier-card-price {
    margin-bottom: 4px;
}

.tier-price-amount {
    font-size: 2.4em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.tier-price-period {
    font-size: 0.95em;
    color: var(--text-secondary);
}

/* Trial Note (compact) */
.tier-trial-note {
    font-size: 0.8em;
    color: #10b981;
    margin: 4px 0 10px 0;
}

/* Tier Features List */
.tier-features-list {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
    text-align: left;
    flex: 1;
}

.tier-features-list li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 0.88em;
    line-height: 1.4;
    padding-left: 22px;
    position: relative;
}

.tier-features-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none' stroke='%2310b981' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16.667 5L7.5 14.167l-4.167-4.167'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

.tier-features-list li.tier-feature-divider {
    color: rgba(147, 112, 219, 0.8);
    font-weight: 600;
    font-size: 0.82em;
    border-bottom: none;
    padding-bottom: 2px;
    padding-left: 0;
    margin-top: 4px;
}

.tier-features-list li.tier-feature-divider::before {
    display: none;
}

.tier-features-list li.tier-feature-extra {
    color: var(--text-primary);
    font-weight: 500;
}

.tier-features-list li.tier-feature-upcoming {
    color: #ed8936;
    font-style: italic;
}

.tier-features-list li.tier-feature-upcoming::before {
    display: none;
}

/* Tier Select Button */
.tier-select-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.tier-select-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.tier-select-btn.current-plan {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    cursor: default;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.tier-select-btn.current-plan:hover {
    transform: none;
    box-shadow: none;
}

/* Current Subscription Display in Settings */
#currentSubscriptionCard {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .subscription-tier-card {
        padding: 1.25rem 1rem;
    }

    .tier-card-title {
        font-size: 1.2em;
    }

    .tier-price-amount {
        font-size: 2em;
    }

    .tier-features-list li {
        font-size: 0.85em;
    }

    .billing-toggle-btn {
        padding: 6px 10px;
        font-size: 0.85em;
    }
}

/* Modal Overrides for Subscription Modal */
#subscriptionModal .edit-modal {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
