/* Subscription Plans Frontend Styles */
.subscription-plans-container {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

.subscription-plans-container.columns-1 {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.subscription-plans-container.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.subscription-plans-container.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.subscription-plans-container.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Package Style Cards */
.subscription-plan-card {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.subscription-plan-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.subscription-plan-card.status-inactive {
    opacity: 0.7;
}

/* Popular Plan Styling */
.subscription-plan-card.popular {
    border: 2px solid #5266ff;
    transform: scale(1.05);
    position: relative;
}

.subscription-plan-card.popular::before {
    content: "Most Popular";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #5266ff, #3a4eff);
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(82, 102, 255, 0.3);
}

.subscription-plan-card.popular:hover {
    transform: scale(1.05) translateY(-8px);
}

/* Plan Header with Gradient */
.plan-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
}

.plan-header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
}

.popular .plan-header {
    background: linear-gradient(135deg, #5266ff 0%, #3a4eff 100%);
}

.plan-name {
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plan-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Plan Image */
.plan-image {
    margin: 0;
}

.plan-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Pricing Section */
.plan-pricing {
    padding: 25px 20px;
    background: #f8f9ff;
    border-bottom: 1px solid #e8e8e8;
}

.price-selector {
    margin-bottom: 15px;
}

.price-selector select {
    width: 100%;
    padding: 0px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.price-selector select:focus {
    border-color: #5266ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(82, 102, 255, 0.1);
}

.selected-price {
    font-size: 2.5em;
    font-weight: 800;
    color: #2c3338;
    margin: 10px 0;
    position: relative;
}

.price-period {
    font-size: 0.4em;
    color: #666;
    font-weight: 500;
    margin-left: 5px;
}

.yearly-savings {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: 600;
    margin-top: 15px;
    border: 1px solid #a7f3d0;
}

/* Features Section */
.plan-features {
    padding: 25px 20px;
    text-align: left;
    flex-grow: 1;
}

.plan-features h4 {
    margin: 0 0 15px 0;
    color: #2c3338;
    font-size: 1.1em;
    font-weight: 700;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f1;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-features li {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
    padding-left: 25px;
    color: #555;
    font-size: 0.95em;
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #00a32a;
    font-weight: bold;
    font-size: 1.1em;
}

.plan-features li.feature-unavailable {
    color: #999;
    text-decoration: line-through;
}

.plan-features li.feature-unavailable::before {
    content: "✗";
    color: #dc2626;
}

/* Plan Details */
.plan-details {
    padding: 20px;
    text-align: left;
    font-size: 0.9em;
    line-height: 1.6;
    color: #666;
    background: #fafafa;
    border-top: 1px solid #f0f0f1;
}

.plan-details p:first-child {
    margin-top: 0;
}

.plan-details p:last-child {
    margin-bottom: 0;
}

/* Plan Actions */
.plan-actions {
    padding: 25px 20px;
    background: white;
    border-top: 1px solid #f0f0f1;
}

.subscribe-btn {
    display: inline-block;
    background: linear-gradient(135deg, #5266ff, #3a4eff);
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1em;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(82, 102, 255, 0.3);
}

.subscribe-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.subscribe-btn:hover {
    background: linear-gradient(135deg, #3a4eff, #5266ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(82, 102, 255, 0.4);
}

.subscribe-btn:hover::before {
    left: 100%;
}

.subscribe-btn.disabled {
    background: #a7aaad;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.subscribe-btn.disabled:hover {
    background: #a7aaad;
    transform: none;
    box-shadow: none;
}

.popular .subscribe-btn {
    background: linear-gradient(135deg, #00a940, #008732);
    box-shadow: 0 4px 15px rgba(0, 169, 64, 0.3);
}

.popular .subscribe-btn:hover {
    background: linear-gradient(135deg, #008732, #00a940);
    box-shadow: 0 6px 20px rgba(0, 169, 64, 0.4);
}

/* Payment Modal */
.subscription-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    z-index: 1;
    background: rgba(255,255,255,0.9);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: #5266ff;
    color: white;
    transform: rotate(90deg);
}

.modal-content h3 {
    margin: 0;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5em;
    font-weight: 700;
}

#payment-details {
    padding: 30px;
    background: #f8f9ff;
    margin: 0;
}

#payment-details p {
    margin: 12px 0;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e8e8e8;
}

#payment-details p:last-child {
    border-bottom: none;
    font-size: 18px;
    font-weight: 700;
    color: #5266ff;
}

.payment-options {
    padding: 0 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-btn {
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.payment-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.payment-btn:hover::before {
    left: 100%;
}

.razorpay-btn {
    background: linear-gradient(135deg, #5266ff, #3a4eff);
    color: white;
    box-shadow: 0 4px 15px rgba(82, 102, 255, 0.3);
}

.razorpay-btn:hover {
    background: linear-gradient(135deg, #3a4eff, #5266ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(82, 102, 255, 0.4);
}

.upi-btn {
    background: linear-gradient(135deg, #00a940, #008732);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 169, 64, 0.3);
}

.upi-btn:hover {
    background: linear-gradient(135deg, #008732, #00a940);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 169, 64, 0.4);
}

.woocommerce-btn {
    background: linear-gradient(135deg, #96588a, #7c4972);
    color: white;
    box-shadow: 0 4px 15px rgba(150, 88, 138, 0.3);
}

.woocommerce-btn:hover {
    background: linear-gradient(135deg, #7c4972, #96588a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(150, 88, 138, 0.4);
}

.payment-btn:disabled {
    background: #a7aaad;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#payment-status {
    margin: 0 30px 30px;
    padding: 20px;
    border-radius: 12px;
    display: none;
    text-align: center;
    font-weight: 600;
}

.payment-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.payment-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.payment-processing {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Success Page */
.subscription-success {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    margin: 40px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.subscription-success::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
}

.subscription-success .success-icon {
    font-size: 80px;
    color: #a7f3d0;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.subscription-success h2 {
    color: white;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    font-size: 2.5em;
    font-weight: 700;
}

.subscription-details {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 15px;
    margin: 30px auto;
    text-align: left;
    max-width: 500px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
}

.subscription-details h3 {
    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding-bottom: 15px;
    margin-top: 0;
    color: white;
}

.subscription-details p {
    margin: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.subscription-details p:last-child {
    border-bottom: none;
}

.status-active {
    background: #ffffff;
    color: #065f46;
    padding: 12px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.success-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.success-actions .button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.success-actions .button:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
}

.success-actions .button-primary {
    background: white;
    color: #667eea;
    border-color: white;
}

.success-actions .button-primary:hover {
    background: #f8f9ff;
    color: #5266ff;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.subscription-plans-empty {
    text-align: center;
    padding: 60px 40px;
    background: #f8f9fa;
    border-radius: 16px;
    margin: 40px 0;
    color: #666;
    font-size: 1.1em;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .subscription-plans-container.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .subscription-plans-container.columns-3,
    .subscription-plans-container.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .subscription-plan-card.popular {
        transform: scale(1);
    }
    
    .subscription-plan-card.popular:hover {
        transform: scale(1) translateY(-8px);
    }
}

@media (max-width: 768px) {
    .subscription-plans-container.columns-2,
    .subscription-plans-container.columns-3,
    .subscription-plans-container.columns-4 {
        grid-template-columns: 1fr;
    }
    
    .subscription-plan-card {
        padding: 0;
    }
    
    .selected-price {
        font-size: 2em;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
    
    .payment-options {
        padding: 0 20px 20px;
    }
    
    .payment-btn {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .subscription-success {
        padding: 40px 20px;
    }
    
    .success-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .success-actions .button {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .plan-header {
        padding: 20px 15px;
    }
    
    .plan-pricing {
        padding: 20px 15px;
    }
    
    .plan-features {
        padding: 20px 15px;
    }
    
    .plan-actions {
        padding: 20px 15px;
    }
    
    .subscribe-btn {
        padding: 12px 20px;
        font-size: 1em;
    }
}