/* Payment Interface Styles */

/* Container Styles */
.payment-plans-container,
.token-packages-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.plans-title,
.packages-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.packages-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Grid Layouts */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Plan Cards */
.plan-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.plan-card.popular {
    border-color: #667eea;
    transform: scale(1.05);
}

.plan-card.popular:hover {
    transform: scale(1.05) translateY(-5px);
}

.plan-card.free {
    border-color: #28a745;
}

/* Popular Badge */
.popular-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Plan Header */
.plan-header {
    text-align: center;
    margin-bottom: 2rem;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.plan-price {
    margin-bottom: 1rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
}

.price-period {
    font-size: 1rem;
    color: #666;
    margin-left: 0.5rem;
}

.price-free {
    font-size: 2.5rem;
    font-weight: 700;
    color: #28a745;
}

/* Plan Features */
.plan-features {
    margin-bottom: 2rem;
}

.tokens-included {
    text-align: center;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: #667eea;
    font-size: 1.1rem;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.feature-icon {
    color: #28a745;
    font-weight: bold;
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

/* Plan Actions */
.plan-action {
    text-align: center;
}

.plan-button {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.plan-button:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.plan-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.plan-button.current-plan {
    background: #28a745;
    color: white;
    cursor: not-allowed;
}

/* Token Package Cards */
.token-package-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #f1f5f9;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0; /* Prevents overflow */
}

.token-package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: #e2e8f0;
}

/* Package Header */
.package-header {
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

.package-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.package-price {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

/* Package Details */
.package-details {
    margin-bottom: 1.5rem;
}

.tokens-breakdown {
    text-align: center;
    margin-bottom: 1rem;
}

.base-tokens {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.25rem;
}

.bonus-tokens {
    color: #28a745;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.total-tokens {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
    border-top: 1px solid #e9ecef;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.package-description {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* Package Actions */
.package-actions {
    display: flex;
    gap: 0.5rem;
}

.buy-tokens-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buy-tokens-btn.stripe-btn {
    background: #667eea;
    color: white;
}

.buy-tokens-btn.stripe-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.buy-tokens-btn.paypal-btn {
    background: #0070ba;
    color: white;
}

.buy-tokens-btn.paypal-btn:hover {
    background: #005ea6;
    transform: translateY(-1px);
}

/* Loading Overlay */
.payment-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.loader-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: #333;
    font-weight: 600;
}

/* Notifications */
.payment-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.payment-notification.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.payment-notification.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.payment-notification.info {
    background: #d1ecf1;
    border: 1px solid #b8daff;
    color: #0c5460;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.notification-icon {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.notification-message {
    flex: 1;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 1rem;
    color: inherit;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .plan-card.popular {
        transform: none;
    }
    
    .plan-card.popular:hover {
        transform: translateY(-5px);
    }
    
    .packages-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .package-actions {
        flex-direction: column;
    }
    
    .buy-tokens-btn {
        margin-bottom: 0.5rem;
    }
    
    .plans-title,
    .packages-title {
        font-size: 2rem;
    }
    
    .payment-notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* Dashboard Integration Styles */
.loader-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* ===================
   SUBSCRIPTION TABS
   =================== */

.subscription-plans-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Tab Navigation */
.billing-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 6px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.tab-button {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
    position: relative;
}

.tab-button.active {
    background: white;
    color: #1e5933;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-button:hover:not(.active) {
    color: #374151;
    background: rgba(255, 255, 255, 0.5);
}

.tab-savings {
    font-size: 0.8rem;
    font-weight: 500;
    color: #10b981;
    display: block;
    margin-top: 2px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Subscription Plan Cards */
.subscription-plan-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #f1f5f9;
    position: relative;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents overflow */
}

.subscription-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: #e2e8f0;
}

.subscription-plan-card.popular {
    border-color: #10b981;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
    transform: scale(1.05);
}

.subscription-plan-card.popular::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 18px;
    z-index: -1;
}

/* Plan Header */
.subscription-plan-card .plan-header {
    text-align: center;
    margin-bottom: 2rem;
}

.subscription-plan-card .plan-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e5933;
    margin-bottom: 0.5rem;
}

.subscription-plan-card .plan-description {
    color: #6b7280;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.subscription-plan-card .plan-price {
    margin-bottom: 1rem;
}

.subscription-plan-card .price-amount {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1e5933;
}

.subscription-plan-card .price-period {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

.monthly-equivalent {
    font-size: 0.9rem;
    color: #10b981;
    margin-top: 4px;
    font-weight: 600;
}

.subscription-plan-card .savings {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 8px;
}

/* Plan Features */
.subscription-plan-card .plan-features {
    flex: 1;
    margin-bottom: 1.5rem;
}

.subscription-plan-card .features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.subscription-plan-card .feature-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.subscription-plan-card .feature-item:last-child {
    border-bottom: none;
}

.subscription-plan-card .feature-icon {
    color: #10b981;
    font-weight: bold;
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Plan Action */
.subscription-plan-card .plan-action {
    margin-top: auto;
}

.subscription-plan-card .plan-button {
    width: 100%;
    background: linear-gradient(135deg, #1e5933, #2d7a3f);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subscription-plan-card .plan-button:hover {
    background: linear-gradient(135deg, #2d7a3f, #1e5933);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 89, 51, 0.3);
}

.subscription-plan-card.popular .plan-button {
    background: linear-gradient(135deg, #10b981, #059669);
}

.subscription-plan-card.popular .plan-button:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Active Plan Styling */
.subscription-plan-card.active-plan {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.active-plan-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}

.pending-plan-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}

.subscription-plan-card.pending-plan {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.pending-change-info {
    color: #d97706;
    font-weight: 500;
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 8px 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 6px;
}

.current-plan-status {
    color: #10b981;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.cancelled-plan-status {
    color: #f59e0b;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    font-size: 0.95rem;
    padding: 8px 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 6px;
}

.cancelled-plan-info {
    color: #6b7280;
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.4;
    padding: 0 10px;
}

.plan-action-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cancel-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    font-size: 0.9rem;
    padding: 10px 20px;
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    transform: translateY(-1px);
}

.renew-btn {
    background: linear-gradient(135deg, #10b981, #047857) !important;
    color: white !important;
    font-size: 0.9rem;
    padding: 10px 20px;
    margin-top: 10px;
}

.renew-btn:hover {
    background: linear-gradient(135deg, #047857, #065f46) !important;
    transform: translateY(-1px);
}

/* Responsive Design for Subscription Tabs */
@media (max-width: 1200px) {
    .plans-grid,
    .packages-grid {
        gap: 1rem;
        max-width: 950px;
    }
    
    .subscription-plan-card,
    .token-package-card {
        padding: 1.5rem;
    }
    
    .subscription-plan-card .price-amount {
        font-size: 2rem;
    }
}

@media (max-width: 968px) {
    .plans-grid,
    .packages-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        gap: 1.5rem;
    }
    
    .billing-tabs {
        flex-direction: column;
        gap: 4px;
        max-width: 300px;
    }
    
    .tab-button {
        text-align: center;
    }
    
    .subscription-plan-card,
    .token-package-card {
        padding: 1.5rem;
        transform: none !important; /* Remove scale on mobile */
    }
    
    .subscription-plan-card.popular {
        transform: none;
    }
    
    .subscription-plan-card .price-amount {
        font-size: 2.5rem;
    }
}