/* Redesigned Checkout Modal */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.97) 0%, rgba(10, 10, 20, 0.98) 100%);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    z-index: 1000;
    display: none;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkout-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.checkout-content {
    max-width: 1000px;
    width: 100%;
    max-height: 95vh;
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.95) 0%, rgba(5, 5, 15, 0.98) 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.checkout-header {
    text-align: center;
    padding: 32px 24px 24px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.checkout-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 2px;
}

.checkout-title {
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.checkout-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
}

.checkout-apps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 0;
    -webkit-overflow-scrolling: touch;
}

.checkout-app {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    min-height: 140px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
}

.checkout-app::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.checkout-app.selected {
    border-color: rgba(147, 51, 234, 0.4);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
    box-shadow: 
        0 8px 32px rgba(147, 51, 234, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.checkout-app:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.checkout-checkbox {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.checkout-app.selected .checkout-checkbox {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    border-color: rgba(147, 51, 234, 0.6);
    box-shadow: 
        0 4px 16px rgba(147, 51, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.checkout-checkbox::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(0.8);
}

.checkout-app.selected .checkout-checkbox::after {
    opacity: 1;
    transform: scale(1);
}

.checkout-icon {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, currentColor 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.checkout-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.checkout-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    margin-bottom: 0;
}

.checkout-price {
    font-size: 10px;
    color: #00d4ff;
    font-weight: 600;
    position: absolute;
    bottom: 14px;
    left: 14px;
}

.checkout-summary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 16px;
    padding: 24px;
    margin: 0 24px 24px;
    flex-shrink: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.checkout-summary-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

.checkout-summary-apps {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #333;
}

.checkout-summary-app {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #aaa;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 700;
    color: #00d4ff;
}

.checkout-button {
    display: block;
    width: calc(100% - 48px);
    max-width: 400px;
    margin: 0 auto 24px;
    padding: 18px;
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 50%, #6366f1 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    box-shadow: 
        0 8px 32px rgba(147, 51, 234, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.checkout-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.checkout-button:hover:not(:disabled)::before {
    left: 100%;
}

.checkout-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 50%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(147, 51, 234, 0.35),
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.15);
}

.checkout-button:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.05);
}

.checkout-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.checkout-close:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.checkout-close svg {
    width: 22px;
    height: 22px;
    color: #fff;
    transition: transform 0.3s ease;
}

.checkout-close:hover svg {
    transform: rotate(90deg);
}

/* Zero-Knowledge Info */
.zero-knowledge-info {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.zero-knowledge-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 8px;
}

.zero-knowledge-icon {
    width: 20px;
    height: 20px;
}

.zero-knowledge-text {
    font-size: 12px;
    color: #aaa;
    line-height: 1.5;
}

/* Checkout Loading State */
.checkout-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.checkout-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 212, 255, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.checkout-loading-text {
    font-size: 16px;
    color: #888;
}

/* Desktop adjustments */
@media (min-width: 1024px) {
    .checkout-apps {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large desktop adjustments */
@media (min-width: 1440px) {
    .checkout-apps {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Ultra-wide screen adjustments */
@media (min-width: 1920px) {
    .checkout-content {
        max-width: 1600px;
    }

    .checkout-apps {
        grid-template-columns: repeat(6, 1fr);
        gap: 14px;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .checkout-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .checkout-header {
        padding: 20px 15px 15px;
    }

    .checkout-title {
        font-size: 24px;
    }

    .checkout-subtitle {
        font-size: 12px;
    }

    .checkout-apps {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 15px;
    }

    .checkout-app {
        padding: 12px;
        min-height: 110px;
    }

    .checkout-icon {
        font-size: 24px;
    }

    .checkout-name {
        font-size: 11px;
    }

    .checkout-desc {
        font-size: 8px;
    }

    .checkout-summary {
        margin: 0 15px 15px;
        padding: 15px;
    }

    .checkout-summary-title {
        font-size: 16px;
    }

    .checkout-button {
        width: calc(100% - 30px);
        margin: 0 15px 15px;
        font-size: 13px;
        padding: 12px;
    }

    .checkout-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
    }
}
