/* Buy Plan Page Styles */
.buy-plan-container {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-primary, #ffffff);
    transition: background-color 0.3s ease;
}

/* Dark Mode Support */
[data-theme="dark"] .section-title {
    color: var(--text-primary, #f9fafb);
    border-bottom-color: var(--border-color, #374151);
}

[data-theme="dark"] .payment-methods-section {
    background: var(--card-bg, #111827);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .btn-white {
    background: var(--card-bg, #111827);
    border-color: var(--border-color, #374151);
    color: var(--text-primary, #f9fafb);
}

[data-theme="dark"] .btn-white:hover {
    background: var(--bg-secondary, #1f2937);
}

[data-theme="dark"] .order-summary-section {
    background: var(--card-bg, #111827);
    border-color: var(--border-color, #374151);
}

.buy-plan-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: start;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

/* Payment Methods Section */
.payment-methods-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-group-toggle {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.btn-white {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
}

.btn-white:hover {
    border-color: #2563eb;
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.btn-check:checked + .btn-white,
.btn-white.active {
    border-color: #2563eb;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
    position: relative;
}

.btn-check:checked + .btn-white::before,
.btn-white.active::before {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.payment-method-card {
    padding: 20px 24px;
    margin: 0;
}

.payment-method-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.payment-method-info {
    flex: 1;
    padding-left: 5%;
    padding-top: 5px;
    padding-bottom: 5px;
}

.payment-method-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    display: block;
    margin-bottom: 4px;
}

[data-theme="dark"] .payment-method-title {
    color: var(--text-primary, #f9fafb);
}

.payment-powered-by {
    font-size: 13px;
    color: #999;
    margin: 0;
}

[data-theme="dark"] .payment-powered-by {
    color: var(--text-secondary, #d1d5db);
}

.payment-icons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.payment-icon {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: grayscale(0.3);
    transition: all 0.3s;
}

.payment-icon-crypto {
    height: 36px;
    width: auto;
    object-fit: contain;
    filter: grayscale(0.3);
    transition: all 0.3s;
}

.btn-check:checked + .btn-white .payment-icon,
.btn-check:checked + .btn-white .payment-icon-crypto,
.btn-white.active .payment-icon,
.btn-white.active .payment-icon-crypto {
    filter: grayscale(0);
}

/* Order Summary Section */
.order-summary-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 35px;
    position: sticky;
    top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.order-summary-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-item:last-of-type {
    border-bottom: none;
}

.order-total {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 20px 0 0 0;
    border-top: 2px solid #1a1a1a;
    margin-top: 15px;
}

.order-item-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-item-value {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 500;
}

.order-item-price {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 600;
    text-align: right;
}

.order-total .order-item-label {
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 700;
}

.order-total .order-item-price {
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
}

.discount-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.discount-input-group {
    display: flex;
    gap: 10px;
}

.discount-input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

.discount-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.discount-apply-btn {
    padding: 14px 28px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.discount-apply-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

.terms-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    transition: color 0.2s;
}

.switch-label:hover {
    color: #2563eb;
}

.switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: relative;
    width: 42px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 999px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.switch-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.switch-input:checked + .switch-slider {
    background: #2563eb;
}

.switch-input:checked + .switch-slider::before {
    transform: translateX(18px);
}

.switch-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.switch-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
    cursor: help;
    flex-shrink: 0;
}

.switch-help::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background: #111827;
    color: #f9fafb;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}

.switch-help::before {
    content: '';
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #111827 transparent transparent transparent;
    opacity: 0;
    transition: opacity 0.2s;
}

.switch-help:hover::after,
.switch-help:hover::before {
    opacity: 1;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    transition: color 0.3s;
}

.checkbox-label:hover {
    color: #2563eb;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: #2563eb;
    flex-shrink: 0;
}

.btn-continue-payment {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
}

.btn-continue-payment:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-continue-payment:active:not(:disabled) {
    transform: translateY(0);
}

.btn-continue-payment:disabled {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.btn-continue-payment.is-loading {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: #ffffff;
    cursor: wait;
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35);
    transform: translateY(0);
    padding: 18px;
}

.btn-continue-payment.is-loading:hover {
    transform: translateY(0);
}

.btn-continue-payment .btn-loading-spinner {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-right-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    display: inline-block;
    margin-right: 0;
    vertical-align: middle;
    animation: btn-spin 0.9s linear infinite;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.btn-continue-payment .btn-loading-text {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes btn-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
    .buy-plan-grid {
        grid-template-columns: 1fr;
    }
    
    .order-summary-section {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .buy-plan-container {
        padding: 15px;
    }
    
    .payment-methods-section,
    .order-summary-section {
        padding: 20px;
    }
    
    /* Country Selection Cards - Stack vertically */
    .location-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .location-item {
        width: 100%;
    }
    
    /* Order Summary - Button placement */
    .order-summary-section .btn-continue-payment {
        width: 100%;
        margin-top: 20px;
    }
    
    /* Pricing Summary - Stack elements */
    .order-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .order-total .order-item-price {
        width: 100%;
        text-align: left;
    }
    
    /* Additional Features - Stack */
    .feature-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .feature-item button {
        width: 100%;
        justify-content: center;
    }
    
    /* Country Selection Cards - Stack vertically */
    #datacenter-countries-selection {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    #datacenter-countries-selection .content-card {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Order Summary - Better mobile layout */
    .order-summary-content {
        gap: 15px;
    }
    
    .order-item {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 10px 0 !important;
    }
    
    .order-item-label {
        font-size: 12px !important;
    }
    
    .order-item-value,
    .order-item-price {
        font-size: 14px !important;
        text-align: left !important;
    }
    
    .order-total {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 15px 0 0 0 !important;
    }
    
    .order-total .order-item-label {
        font-size: 14px !important;
    }
    
    .order-total .order-item-price {
        font-size: 20px !important;
        text-align: left !important;
    }
    
    /* Discount Input Group - Stack */
    .discount-input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .discount-apply-btn {
        width: 100%;
    }
}

