/**
 * Enhanced Upgrade Page Styles
 * 
 * Stripe-style animations and glassmorphism effects
 * 
 * @package TenderPipe
 * @since   1.2.0
 */

/* ============================================
   Payment Modal - Stripe Style
   ============================================ */

.tp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.tp-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tp-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tp-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tp-modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--tp-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tp-modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--tp-gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--tp-gray-500);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color var(--tp-transition-fast);
    border-radius: 4px;
}

.tp-modal-close:hover {
    color: var(--tp-gray-900);
    background: var(--tp-gray-100);
}

.tp-modal-body {
    padding: 24px;
}

/* ============================================
   Form Styling - Stripe Inspired
   ============================================ */

.payment-form-group {
    margin-bottom: 20px;
}

.payment-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--tp-gray-700);
    margin-bottom: 6px;
}

.payment-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--tp-gray-300);
    border-radius: 8px;
    font-size: 16px;
    font-family: var(--tp-font-family);
    transition: all 0.2s ease;
    background: #ffffff;
}

.payment-form-input:focus {
    outline: none;
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.payment-form-input.valid {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.03);
}

.payment-form-input.invalid {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.03);
}

.field-error {
    display: none;
    margin-top: 6px;
    font-size: 13px;
    color: #EF4444;
}

/* Card Input Group */
.card-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.card-number-wrapper {
    position: relative;
}

#card-type-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--tp-gray-500);
}

/* Plan Options */
.plan-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.plan-option {
    padding: 16px;
    border: 2px solid var(--tp-gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.plan-option:hover {
    border-color: var(--tp-primary);
    background: rgba(0, 102, 204, 0.02);
}

.plan-option.selected {
    border-color: var(--tp-primary);
    background: rgba(0, 102, 204, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.plan-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--tp-gray-900);
    margin-bottom: 4px;
}

.plan-price {
    font-size: 14px;
    color: var(--tp-gray-600);
}

/* Billing Cycle Toggle */
.billing-cycle-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--tp-gray-50);
    border-radius: 8px;
}

.toggle-label {
    font-size: 14px;
    color: var(--tp-gray-700);
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--tp-gray-300);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--tp-primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Price Display */
.price-display {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--tp-gray-50) 0%, #ffffff 100%);
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--tp-gray-200);
}

.price-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--tp-gray-900);
    line-height: 1;
}

.price-amount.price-animate {
    animation: priceChange 0.3s ease;
}

@keyframes priceChange {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.price-period {
    font-size: 16px;
    color: var(--tp-gray-600);
    margin-top: 4px;
}

.price-detail {
    font-size: 13px;
    color: var(--tp-gray-500);
    margin-top: 8px;
}

/* Terms Checkbox */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 20px 0;
}

.terms-checkbox input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
}

.terms-label {
    font-size: 13px;
    color: var(--tp-gray-600);
    line-height: 1.5;
}

.terms-label a {
    color: var(--tp-primary);
    text-decoration: none;
}

.terms-label a:hover {
    text-decoration: underline;
}

/* Submit Button */
.btn-payment-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--tp-primary) 0%, #0052A3 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.btn-payment-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-payment-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-payment-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
}

.btn-loading .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Security Badge */
.security-badge {
    text-align: center;
    font-size: 13px;
    color: var(--tp-gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Alert Messages */
.payment-alert {
    display: none;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.payment-alert.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.payment-alert.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

/* ============================================
   Fade-in Sections
   ============================================ */

.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-section.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Pricing Cards Enhancement
   ============================================ */

.pricing-card {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pricing-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.03),
        0 20px 25px -5px rgba(0, 0, 0, 0.15),
        0 10px 10px -5px rgba(0, 0, 0, 0.08);
}

.pricing-card.featured {
    border: 2px solid var(--tp-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.featured-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--tp-primary) 0%, #0052A3 100%);
    color: #ffffff;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   ROI Calculator
   ============================================ */

.roi-calculator {
    background: linear-gradient(135deg, var(--tp-gray-50) 0%, #ffffff 100%);
    padding: 40px;
    border-radius: 16px;
    margin: 60px 0;
    border: 1px solid var(--tp-gray-200);
}

.roi-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--tp-gray-900);
    text-align: center;
    margin-bottom: 32px;
}

.roi-input-group {
    margin-bottom: 24px;
}

.roi-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--tp-gray-700);
    margin-bottom: 12px;
}

.roi-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--tp-gray-200);
    outline: none;
    -webkit-appearance: none;
}

.roi-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tp-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.roi-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tp-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
}

.roi-results {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    margin-top: 32px;
    border: 2px solid var(--tp-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.roi-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--tp-gray-200);
}

.roi-result-item:last-child {
    border-bottom: none;
}

.roi-result-label {
    font-size: 14px;
    color: var(--tp-gray-600);
}

.roi-result-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--tp-primary);
}

/* ============================================
   Social Proof Section
   ============================================ */

.testimonial-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--tp-gray-200);
    box-shadow: var(--tp-shadow-sm);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tp-shadow-lg);
}

.testimonial-rating {
    color: #FCD34D;
    font-size: 18px;
    margin-bottom: 12px;
}

.testimonial-text {
    font-size: 16px;
    color: var(--tp-gray-700);
    line-height: 1.6;
    margin-bottom: 16px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--tp-gray-200);
}

.testimonial-info {
    flex: 1;
}

.testimonial-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--tp-gray-900);
}

.testimonial-role {
    font-size: 13px;
    color: var(--tp-gray-500);
}

/* ============================================
   Comparison Table
   ============================================ */

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 40px 0;
}

.comparison-table thead {
    background: var(--tp-gray-50);
}

.comparison-table th,
.comparison-table td {
    padding: 16px;
    text-align: center;
    border: 1px solid var(--tp-gray-200);
}

.comparison-table th {
    font-weight: 700;
    color: var(--tp-gray-900);
}

.comparison-table td {
    color: var(--tp-gray-700);
}

.comparison-table .feature-name {
    text-align: left;
    font-weight: 500;
}

.comparison-checkmark {
    color: #10B981;
    font-size: 20px;
}

.comparison-cross {
    color: #EF4444;
    font-size: 18px;
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 767px) {
    .tp-modal-content {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
        max-height: 85vh;
    }

    .card-input-group {
        grid-template-columns: 1fr;
    }

    .plan-options {
        grid-template-columns: 1fr;
    }

/* ============================================
   Page Layout - Grid System
   ============================================ */

.tp-upgrade-page .tp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Pricing Cards Grid */
.tp-pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

@media (max-width: 768px) {
    .tp-pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* Two Column Layout - Main Content + Sidebar */
.tp-upgrade-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 992px) {
    .tp-upgrade-content-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Pricing Card Styles */
.tp-pricing-card {
    background: var(--tp-white);
    border: 2px solid var(--tp-gray-200);
    border-radius: 12px;
    padding: 32px;
    transition: all var(--tp-transition-normal);
}

.tp-pricing-card:hover {
    border-color: var(--tp-primary);
    box-shadow: 0 8px 20px rgba(0, 112, 243, 0.1);
    transform: translateY(-4px);
}

.tp-pricing-card.featured {
    border-color: var(--tp-primary);
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
    box-shadow: 0 8px 20px rgba(0, 112, 243, 0.15);
}

.tp-pricing-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--tp-gray-200);
}

.tp-pricing-badge {
    display: inline-block;
    background: var(--tp-primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tp-pricing-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--tp-gray-900);
    margin: 0 0 8px;
}

.tp-pricing-price {
    font-size: 48px;
    font-weight: 700;
    color: var(--tp-primary);
    margin: 0;
}

.tp-pricing-price small {
    font-size: 16px;
    font-weight: 500;
    color: var(--tp-gray-600);
}

.tp-pricing-description {
    color: var(--tp-gray-600);
    font-size: 14px;
    margin: 8px 0 0;
}

.tp-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.tp-pricing-features li {
    padding: 12px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--tp-gray-700);
    font-size: 15px;
}

.tp-pricing-features li:before {
    content: "✓";
    color: var(--tp-success);
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.tp-pricing-features li.disabled {
    opacity: 0.5;
}

.tp-pricing-features li.disabled:before {
    content: "✕";
    color: var(--tp-gray-400);
}

/* Contact Form Sidebar */
.tp-contact-sidebar {
    position: sticky;
    top: 100px;
    background: var(--tp-white);
    border: 2px solid var(--tp-gray-200);
    border-radius: 12px;
    padding: 32px;
}

@media (max-width: 992px) {
    .tp-contact-sidebar {
        position: static;
        margin-top: 40px;
    }
}

/* Feature Comparison Table */
.tp-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 40px 0;
}

.tp-comparison-table th,
.tp-comparison-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--tp-gray-200);
}

.tp-comparison-table th {
    background: var(--tp-gray-50);
    font-weight: 600;
    color: var(--tp-gray-900);
}

.tp-comparison-table td {
    color: var(--tp-gray-700);
}

    .roi-calculator {
        padding: 24px 16px;
    }

    .pricing-card {
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .tp-modal-body {
        padding: 16px;
    }

    .price-amount {
        font-size: 28px;
    }
}